nRF51 SDK - S120 SoftDevice
|
Initialization & registration APIs that are pre-requisite for all other module procedures. More...
Functions | |
ret_code_t | dm_init (dm_init_param_t const *p_init_param) |
Module Initialization Routine. More... | |
ret_code_t | dm_register (dm_application_instance_t *p_appl_instance, dm_application_param_t const *p_appl_param) |
Function for registering the application. More... | |
void | dm_ble_evt_handler (ble_evt_t *p_ble_evt) |
Function for handling BLE events. More... | |
Initialization & registration APIs that are pre-requisite for all other module procedures.
This section describes the Module Initialization and Registration APIs needed to be set up by the application before device manager can start managing devices and device contexts for the application.
void dm_ble_evt_handler | ( | ble_evt_t * | p_ble_evt | ) |
Function for handling BLE events.
BLE Event Handler for the module. This routine should be called from BLE stack event dispatcher for the module to work as expected.
[in] | p_ble_evt | BLE stack event being dispatched to the function. |
ret_code_t dm_init | ( | dm_init_param_t const * | p_init_param | ) |
Module Initialization Routine.
Function for initializing the module. Must called before any other APIs of the module are used.
[in] | p_init_param | Initialization parameters. |
NRF_SUCCESS | On success, else an error code indicating reason for failure. |
ret_code_t dm_register | ( | dm_application_instance_t * | p_appl_instance, |
dm_application_param_t const * | p_appl_param | ||
) |
Function for registering the application.
This routine is used by the application to register for asynchronous events with the device manager. During registration the application also indicates the services that it intends to support on this instance. It is possible to register multiple times with the device manager. At least one instance shall be registered with the device manager after the module has been initialized. Maximum number of application instances device manager can support is determined by DM_MAX_APPLICATIONS.
All applications must be registered before initiating or accepting connections from the peer.
[in] | p_appl_param | Application parameters. |
[out] | p_appl_instance | Application Instance Identifier in case registration is successful. |
NRF_SUCCESS | On success, else an error code indicating reason for failure. |
NRF_ERROR_INVALID_STATE | If the API is called without module initialization. |
NRF_ERROR_NO_MEM | If module cannot support more applications. |