Registers an event for notifications.
#include <peripheral_discovery.h>
int pd_register_event(pd_class_t class_id, struct sigevent *event)
BlackBerry 10.2.0
The class of peripherals you want to be notified of.
The sigevent to use as a notification.
This event is delivered when peripherals are inserted or removed for a specific class. On registration, you will get a separate notification for each currently connected peripheral. After receiving a notification event, call pd_get_event() to get the event data.
#define MY_PULSE_CODE 1 struct sigevent ev; // Initialize pulse sigevent. // You can add the class id to help identify events later, if you're // registering for multiple classes. SIGEV_PULSE_INIT( &ev, coid, SIGEV_PULSE_PRIO_INHERIT, MY_PULSE_CODE, PD_CLASS_SERIAL ); pd_register_event( PD_CLASS_SERIAL, &ev );
EOK on success.