nRF51 SDK: APIs to set-up or know status of security on a link.

| nRF51 SDK

- Home
- Related Pages
- API Reference
- Data Structures

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
APIs to set-up or know status of security on a link.
Device Module APIs

This section describes APIs to Set Up Security. These APIs require that the peer be connected for the procedures to requested. More...

## Functions

api_result_t | dm_security_setup_req (dm_handle_t *p_handle)
| Routine to request setting up security on a link. More...
api_result_t | dm_security_status_req (dm_handle_t const *p_handle, dm_security_status_t *p_status)
| Routine to know status of security on a link. More...
api_result_t | dm_whitelist_create (dm_application_instance_t const *p_handle, ble_gap_whitelist_t *p_whitelist)
| Routine to create white-list. More...

## Detailed Description

This section describes APIs to Set Up Security. These APIs require that the peer be connected for the procedures to requested.

This group allows application to request security procedures or know status of security on a link.

## Function Documentation

api_result_t dm_security_setup_req | ( | dm_handle_t * | p_handle | ) |

Routine to request setting up security on a link.

This API initiates security procedures with a peer device. DM_SECURITY_SETUP_IND event is notified to the application when the procedure is complete.

Note
  In case of GAP Central role, in case peer is not bonded, request to bond is initiated, else, link is re-encrypted using the existing bond information. In case of GAP peripheral role, a Slave security request is sent.

Parameters

  [in] | p_handle | Identifies the link on which security is desired.

Returns
  NRF_SUCCESS or appropriate error code indicating reason for failure.

api_result_t dm_security_status_req | ( | dm_handle_t const * | p_handle,
|  | dm_security_status_t * | p_status
| ) |  |

Routine to know status of security on a link.

This API allows application to query status of security on a link.

Parameters

  [in] | p_handle | Identifies the link on which security is desired.
  [out] | p_status | Pointer where security status is provided to the application.

Returns
  NRF_SUCCESS or appropriate error code indicating reason for failure.

api_result_t dm_whitelist_create | ( | dm_application_instance_t const * | p_handle,
|  | ble_gap_whitelist_t * | p_whitelist
| ) |  |

Routine to create white-list.

This API allows application to create whitelist based on bonded peer devices in module data base.

Parameters

  [in] | p_handle | Identifies the application requesting white-list creation.
  [out] | p_whitelist | Pointer where created white-list is provided to the application.

Note
  'addr_count' and 'irk_count' fields of the structure should be populated with maximum number of devices that the application wishes to request in the whitelist. In case, number of bonded device list are less than requested, these fields will be updated with actuals. In case number of devices are more than numbers requested, module will populate the list with devices in order of bond established with the peer devices. Also, if this routine is is called when a connection exists with one or more peer devices, device(s) with which connection exists are not added to the whitelist.

Returns
  NRF_SUCCESS or appropriate error code indicating reason for failure.