Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.

Dependents:   nRF51822 nRF51822

Embed: (wiki syntax)

« Back to documentation index

Peer_manager

Data Structures

struct  pm_peer_data_bonding_t
 Data associated with a bond to a peer. More...
struct  pm_peer_data_local_gatt_db_t
 Data on a local GATT database. More...
struct  pm_peer_data_local_gatt_db_flash_t
 Data on a local GATT database, as formatted in flash. More...
struct  pm_peer_data_remote_gatt_db_t
 Data on a remote GATT database. More...
struct  pm_peer_data_remote_gatt_db_flash_t
 Data on a remote GATT database, as formatted in flash. More...
union  pm_peer_data_unit_t
 Union of all data associated with one peer. More...
union  pm_peer_data_unit_const_t
 Immutable version of pm_peer_data_unit_t. More...
union  pm_peer_data_unit_flash_t
 Data from pm_peer_data_unit_t, as mapped in flash. More...
struct  pm_peer_data_t
 One piece of data associated with a peer, together with the type. More...
struct  pm_peer_data_const_t
 Immutable version of pm_peer_data_t. More...
struct  pm_peer_data_flash_t
 Data from pm_peer_data_t, as mapped in flash. More...

Modules

 ID Manager
 

An internal module of Peer_manager.


 Peer Data
 

An internal module of Peer_manager.


 Peer Data Storage
 

An internal module of Peer_manager.


 Peer Database
 

An internal module of Peer_manager.


 Peer IDs
 

An internal module of Peer_manager.


 Buffer
 

An internal module of Peer_manager.


 Mutex
 

An internal module of Peer_manager.


Typedefs

typedef uint16_t pm_peer_id_t
 Handle to uniquely identify a peer for which we have persistently stored data.
typedef uint32_t pm_prepare_token_t
 Typedef for type used for write prepares.
typedef uint32_t pm_store_token_t
 Typedef for type used to hold reference to stored item in flash.

Enumerations

enum  pm_sec_error_code_t { PM_SEC_ERROR_CODE_PIN_OR_KEY_MISSING = BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING, PM_SEC_ERROR_CODE_MIC_FAILURE = BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE, PM_SEC_ERROR_SMP_TIMEOUT }
 

Errors originating from the Peer Manager module.

More...
enum  pm_sec_procedure_t { PM_LINK_SECURED_PROCEDURE_ENCRYPTION, PM_LINK_SECURED_PROCEDURE_BONDING, PM_LINK_SECURED_PROCEDURE_PAIRING }
 

Enumeration describing the different procedures that can lead to an encrypted link.

More...
enum  pm_peer_data_id_t
 

The different types of data associated with a peer.

More...

Functions

static __INLINE uint16_t PM_BONDING_DATA_N_WORDS (void)
 Function for calculating the flash size of bonding data.
static __INLINE uint16_t PM_SC_STATE_N_WORDS (void)
 Function for calculating the flash size of service changed pending state.
static __INLINE uint16_t PM_LOCAL_DB_N_WORDS (uint16_t local_db_len)
 Function for calculating the flash size of local GATT database data.
static __INLINE uint16_t PM_LOCAL_DB_LEN (uint16_t n_words)
 Function for calculating the length of a local GATT database attribute array.
static __INLINE uint16_t PM_REMOTE_DB_N_WORDS (uint16_t service_count)
 Function for calculating the flash size of remote GATT database data.
static __INLINE bool PM_PEER_DATA_ID_IS_VALID (pm_peer_data_id_t data_id)
 Macro saying whether a data_id is valid, i.e.

Typedef Documentation

typedef uint16_t pm_peer_id_t

Handle to uniquely identify a peer for which we have persistently stored data.

Definition at line 60 of file peer_manager_types.h.

typedef uint32_t pm_prepare_token_t

Typedef for type used for write prepares.

Used to reserve space in flash

Definition at line 291 of file peer_manager_types.h.

typedef uint32_t pm_store_token_t

Typedef for type used to hold reference to stored item in flash.

this token can be used for locking and validity check

Definition at line 297 of file peer_manager_types.h.


Enumeration Type Documentation

The different types of data associated with a peer.

Definition at line 237 of file peer_manager_types.h.

Errors originating from the Peer Manager module.

Enumerator:
PM_SEC_ERROR_CODE_PIN_OR_KEY_MISSING 

Encryption failed because the peripheral has lost the LTK for this bond.

PM_SEC_ERROR_CODE_MIC_FAILURE 

Pairing ended with disconnection because of mismatching keys.

PM_SEC_ERROR_SMP_TIMEOUT 

Pairing/bonding could not start because an SMP timeout has already happened on this link.

This means that no more pairing or bonding can happen on this link. To be able to pair or bond, the link must be disconnected and then reconnected. See Bluetooth specification 4.2 section 3.H.3.4

Definition at line 74 of file peer_manager_types.h.

Enumeration describing the different procedures that can lead to an encrypted link.

Enumerator:
PM_LINK_SECURED_PROCEDURE_ENCRYPTION 

Using an LTK shared during a previous bonding procedure to encrypt the link.

PM_LINK_SECURED_PROCEDURE_BONDING 

A pairing procedure, followed by a bonding procedure.

PM_LINK_SECURED_PROCEDURE_PAIRING 

A pairing procedure with no bonding.

Definition at line 84 of file peer_manager_types.h.


Function Documentation

static __INLINE uint16_t PM_BONDING_DATA_N_WORDS ( void   ) [static]

Function for calculating the flash size of bonding data.

Returns:
The number of words the data will take in flash.

Definition at line 107 of file peer_manager_types.h.

static __INLINE uint16_t PM_LOCAL_DB_LEN ( uint16_t  n_words ) [static]

Function for calculating the length of a local GATT database attribute array.

Parameters:
[in]n_wordsThe number of words the data takes in flash.
Returns:
The length of the database attribute array.

Definition at line 162 of file peer_manager_types.h.

static __INLINE uint16_t PM_LOCAL_DB_N_WORDS ( uint16_t  local_db_len ) [static]

Function for calculating the flash size of local GATT database data.

Parameters:
[in]local_db_lenThe length of the database as reported by the SoftDevice.
Returns:
The number of words the data will take in flash.

Definition at line 150 of file peer_manager_types.h.

static __INLINE bool PM_PEER_DATA_ID_IS_VALID ( pm_peer_data_id_t  data_id ) [static]

Macro saying whether a data_id is valid, i.e.

one of the valid enum values.

Parameters:
[in]data_idThe data_id to check.

Definition at line 255 of file peer_manager_types.h.

static __INLINE uint16_t PM_REMOTE_DB_N_WORDS ( uint16_t  service_count ) [static]

Function for calculating the flash size of remote GATT database data.

Parameters:
[in]service_countThe number of services in the service array.
Returns:
The number of words the data will take in flash.

Definition at line 193 of file peer_manager_types.h.

static __INLINE uint16_t PM_SC_STATE_N_WORDS ( void   ) [static]

Function for calculating the flash size of service changed pending state.

Returns:
The number of words the data will take in flash.

Definition at line 117 of file peer_manager_types.h.