nRF51 SDK - S120 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Device Module Set-up APIs

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...
 

Detailed Description

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.

Function Documentation

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.

Parameters
[in]p_ble_evtBLE 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.

Parameters
[in]p_init_paramInitialization parameters.
Return values
NRF_SUCCESSOn success, else an error code indicating reason for failure.
Note
It is mandatory that pstorage is initialized before initializing this module.
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.

Parameters
[in]p_appl_paramApplication parameters.
[out]p_appl_instanceApplication Instance Identifier in case registration is successful.
Return values
NRF_SUCCESSOn success, else an error code indicating reason for failure.
NRF_ERROR_INVALID_STATEIf the API is called without module initialization.
NRF_ERROR_NO_MEMIf module cannot support more applications.
Note
Currently only one application instance is supported by the module.