nRF51 SDK v10.0.0
Modules | Macros | Enumerations
Connection state

Module for storing data on BLE connections. More...


 BLE connection state functions




enum  ble_conn_state_status_t {
 Connection handle statuses. More...
enum  ble_conn_state_user_flag_id_t {
 One ID for each user flag collection. More...

Detailed Description

Module for storing data on BLE connections.

This module stores certain states for each connection, which can be queried by connection handle. The module uses BLE events to keep the states updated.

In addition to the preprogrammed states, this module can also keep track of a number of binary user states, or user flags. These are reset to 0 for new connections, but otherwise not touched by this module.

This module uses the Mapped flags module, with connection handles as keys and the connection states as flags.

A connection handle is not immediately invalidated when it is disconnected. Certain states, such as the role, can still be queried until the next time a new connection is established to any device.

To function properly, this module must be provided with BLE events from the SoftDevice through the ble_conn_state_on_ble_evt() function. This module should be the first to receive BLE events if they are dispatched to multiple modules.

Macro Definition Documentation


The number of available user flags.

Enumeration Type Documentation

Connection handle statuses.


The connection handle is invalid.


The connection handle refers to a connection that has been disconnected, but not yet invalidated.


The connection handle refers to an active connection.

One ID for each user flag collection.

These IDs are used to identify user flag collections in the API calls.

This document was last updated on Mon Nov 9 2015.
Please send us your feedback about the documentation! For technical questions, visit the Nordic Developer Zone.