nRF51 SDK: Device Manager Data Types

| nRF51 SDK

- Home
- Related Pages
- API Reference
- Data Structures

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Typedefs | Enumerations
Device Manager Data Types
Device Manager

## Data Structures

struct | device_handle
| Device Handle used for unique identification of each peer. More...
struct | dm_context_t
| Context Data Definition. More...
struct | dm_service_context_t
| Service Context. More...
union | dm_event_param_t
| Event parameters. More...
struct | dm_event_t
| Asynchronous events details notified to the application by the module. More...
struct | dm_init_param_t
| Initialization Parameters. More...
struct | dm_application_param_t
| Application Registration Parameters. More...

## Typedefs

typedef uint8_t | dm_application_instance_t
| Application Instance. More...
typedef uint8_t | dm_connection_instance_t
| Connection Instance. More...
typedef uint8_t | dm_device_instance_t
| Device Instance. More...
typedef uint8_t | dm_service_instance_t
| Device Instance. More...
typedef uint8_t | service_type_t
| Service/Protocol Type Identifier. More...
typedef struct device_handle | dm_handle_t
| Device Handle used for unique identification of each peer. More...
typedef dm_context_t | dm_device_context_t
typedef dm_context_t | dm_application_context_t
| Application context. More...
typedef api_result_t(* | dm_event_cb_t )(dm_handle_t const *p_handle, dm_event_t const *p_event, api_result_t event_result)
| Event notification callback registered by application with the module. More...

## Enumerations

enum | dm_security_status_t { NONE, PROCEDURE_IN_PROGRESS, ENCRYPTED }
| Defines possible states security status. More...

## Detailed Description

This section describes all the data types exposed by the module to the application.

## Typedef Documentation

typedef dm_context_t dm_application_context_t

Application context.

The application context can be used by the application to map any application level information that is to be mapped with a particular peer. For bonded peers, this information will be stored by the bond manager persistently. However, it should be noted that the device manager treats this information as an opaque blob. Necessary APIs to get and set this context for a peer have been provided

typedef uint8_t dm_application_instance_t

Application Instance.

Application instance uniquely identifies an application. The identifier is allocated by the device manager when application registers with the module. The application is expected to identify itself with this instance identifier when initiating subsequent requests. Application should use the utility API dm_application_instance_set in order to set its application instance in dm_handle_t needed for all subsequent APIs. See also dm_application_register.

typedef uint8_t dm_connection_instance_t

Connection Instance.

Identifies connection instance for an active device. This instance is allocated by the' device manager when a connection is established which is notified with DM_CONNECTION_IND with event result NRF_SUCCESS.

typedef uint8_t dm_device_instance_t

Device Instance.

Uniquely identifies a peer entity. The peer entity may or may not be connected. This instance is allocated by the device manager when a device is bonded and this notified when security procedures have been initiated notified with DM_SECURITY_SETUP_IND with success event result. In case the event result indicates that the module cannot add more bonded devices, no instance is allocated. Application can chose to disconnect the link.

typedef api_result_t(* dm_event_cb_t)(dm_handle_t const *p_handle, dm_event_t const *p_event, api_result_t event_result)

Event notification callback registered by application with the module.

Event notification callback registered by application with the module when registering the module using dm_application_register API.

Parameters

  p_handle | Identifies the peer for which the event is being notified.
  p_event | Identifies the event, any associated parameters and parameter length. See Device Manager Events for details on event types and their significance.
  event_result | Provide additional information on the event. For example, in case of error event, one of the SDK error codes is used to indicate nature of error. Additionally, indications of data base being maximum connection instances that can be managed being reached is indicated with connection or bonding events.

Returns
  Application can return a success or a failure to indicate if it could handle the event successfully. There is no action taken in case application returns a failure.

typedef struct device_handle dm_handle_t

Device Handle used for unique identification of each peer.

This data type is used to uniquely identify each peer device. A peer device could be active and/or bonded. Therefore an instance for active and bonded is provided. Application is however expected to treat this is an opaque structure and use this for all API interactions once stored on appropriate events. See Device Manager Events.

typedef uint8_t dm_service_instance_t

Device Instance.

Uniquely identifies a peer entity. The peer entity may or may not be connected. This instance is allocated by the device manager when a device is bonded and this notified when security procedures have been initiated notified with DM_SECURITY_SETUP_IND with success event result. In case the event result indicates that the module cannot add more bonded devices, no instance is allocated. Application can chose to disconnect the link.

typedef uint8_t service_type_t

Service/Protocol Type Identifier.

Uniquely identifies a service or a protocol type. Service/Protocol Type identification is needed as each service/protocol can have its own contextual data and there can be more than one service accessed by the peer. Service/Protocol Types describes the list of services/protocols supported.

## Enumeration Type Documentation

enum dm_security_status_t

Defines possible states security status.

Defines possible states security status of a link when requested by application using the dm_security_status_req.