nRF51 SDK - S110 SoftDevice
|
Device Manager manages all bonded devices managing all contexts for a bonded device. Various contexts are identified under -#a. Device Context: Bonding and peer identification information. -#b. Service Context: GATT Server's configuration for peer device is a typical example for service context. Module has provision to store GATT client related information as well, but not completely implemented. In case application does not implement GATT Server or Client, DM_PROTOCOL_CNTXT_NONE can be used when registering the application to indicate respective service context are not used. See dm_service_cntext_types for details. -#c. Application Context: In case application requires to store application specific data per bonded device, it can do so by requesting Device Manager to store application context for the device. Application context is not permitted to be set for a non bonded device.
Device Manager cab be compile time to suit the application. Configuration includes number of active peers, bonded device module should support, number of CCCDs in GATT Server, Application context size etc. Active refers to maximum connections that the module wants to be able to manage concurrently. Configurable parameters are described in device_manager_cnfg.h.
Device manager should be initialized before using any of module APIs. Initialization should be done once.
None. Asynchronous events from module are only received after module is successfully initialized and registered.
None. Initialization procedure is unaltered by configuration of the module.
The application should register with the device manager before using any other APIs of the module. Registration is done using the dm_register API. Sample code below demonstrate registration procedure with the module.
None. Asynchronous events from module are only received after module is successfully initialized and registered. Once successfully registered, application will have one or more events associated with each procedure it requests. Few events could be triggered due to an action on the peer. An example of such an event is the disconnection event DM_EVT_DISCONNECTION.