You can develop applications which track the state transitions of devices and drivers. To do so you need to subscribe for the events that are published when such a transition takes place i.e. register an event handler.
You can subscribe for the following events:
Events about peripheral devices
Topics
PeripheralEventConstants.TOPIC_PERIPHERAL_ADDED – to receive events when peripheral devices are added
PeripheralEventConstants.TOPIC_PERIPHERAL_REMOVED – to receive events when peripheral devices are removed
PeripheralEventConstants.TOPIC_PERIPHERAL_DESCRIPTOR_UPDATED – to receive events when a peripheral descriptor is updated
PeripheralEventConstants.TOPIC_PERIPHERAL_STATUS_UPDATED – to receive events when the status of a peripheral device is updated
DriverEventConstants.TOPIC_DRIVER_STATUS_UPDATED – to receive events when the status of a driver is updated
DriverEventConstants.TOPIC_DRIVER_OPERATION_PROGRESS – to receive events when a driver operation passes through intermediate phases
Properties
Common Properties
Properties that are common for both event topics:
PeripheralDescriptor.UID
DriverEventConstants.PROPERTY_UIDS – an array of peripheral UIDs matching this descriptor
DriverEventConstants.PROPERTY_DRIVER_OPERATION – the type of driver operation with one of the following values:
DriverInfo.OPERATION_INSTALL
DriverInfo.OPERATION_START
DriverInfo.OPERATION_STOP
DriverInfo.OPERATION_UNINSTALL
DriverInfo.OPERATION_UPDATE
TOPIC_DRIVER_STATUS_UPDATED Event Properties
DriverEventConstants.PROPERTY_DRIVER_STATUS – contains the driver status value
DriverEventConstants.PROPERTY_DRIVER_ERROR_CODE – contains the driver status update error code if an error has occurred during a device driver status update.
DriverEventConstants.PROPERTY_DRIVER_ERROR_MESSAGE – contains the driver status update error message if an error has occurred during a device driver status update.
TOPIC_DRIVER_OPERATION_PROGRES Event Properties
DriverEventConstants.PROPERTY_DRIVER_OPERATION_PROGRESS_VALUE – a value in the range [0,100] that represents the driver operation progress in percentage.
For further details about events associated with peripheral devices and their drivers, please see the Peripheral API