![]() |
![]() |
![]() |
![]() |
Register and unregister for events from the MME
#include <mme/mme.h> int mme_register_for_events( mme_hdl_t *hdl, mme_event_class_t event_class, struct sigevent *event );
mme
The function mme_register_for_events() allows the client application to determine the events it wants to receive from the MME.
The MME does not deliver events to a client application unless it is specifically instructed to do so. To receive events from the MME, a client application must register for events after connecting to the MME, specifying the class or classes of events it wants to receive.
The client application must register after each connection. This feature allows the client application to register different different classes of events for connections. For example, a connection used to handle synchronizations can register for synchronization events, but not for playback events, because it will never call functions that deliver playback events.
Each event class has a different sigevent. When it has registered for an event class, the client application has told the MME which sigevents it wants to receive. When it has a relevant event, the MME will:
The client application can then decide from the sigevent if it needs to see the associated event. When it needs to see events, the client application can use the function mme_get_event() to have them delivered from the MME's event queue.
To stop receiving a class of events, the client application must unregister for that event class. To unregister for an event class, call the function mme_register_for_events() with the event_class set to the event class for which you want to stop receiving events, and the argument event set to NULL.
If the client application has registered for several or all event classes, it can unregister for any event class without affecting the registration for the other event classes. For example:
mme_register_for_events( hdl, MME_EVENT_CLASS_ALL, &event ); // Do some work here. mme_register_for_events( hdl, MM_EVENT_CLASS_COPY, NULL);
mme_event_classes_t defines the different MME event classes as bitmasks:
The MME event classes are bitmasks. They can be used together with an OR operator to register for several events at once. For example, to register for playback and synchronization events call the function mme_register_for_events() as follows:
mme_register_for_events( hdl, MME_EVENT_CLASS_PLAY | MME_EVENT_CLASS_SYNC, event);
For more information about events, see the chapter MME Events and following.
None delivered.
This function doesn't block.
QNX Neutrino
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
mme_connect(), mme_disconnect(), mme_get_event(), MME Events
![]() |
![]() |
![]() |
![]() |