nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0x10 - BLE_GAP_EVT_CONNECTED

Event packet encoding

Frame format encoding of the BLE_GAP_EVT_CONNECTED packet.

Event ID = 0x10 for BLE_GAP_EVT_CONNECTED.

All BLE Events, ble_evt_t, are encoded with the header ble_evt_hdr_t first, containing only the 'Event ID', followed by the event. The 'Event Length' will not be encoded as the size of the event could be of different sizes depending on decoder architecture.

The BLE GAP event contains a connection handle, and for the BLE GAP Connected event, the ble_gap_evt_connected_t is encoded after connection handle as seen in Figure 1.

The order of the encoding is:

- 2 bytes:Connection Handle
- 7 bytes:ble_gap_addr_t Peer Address (See Figure 3 for details on encoding)
- 7 bits: IRK Index
- 1 bit: IRK Match
IRK Match & Index are encoded together in 1 byte.
- 8 bytes:ble_gap_conn_params_t : GAP Connection Parameters (See Figure 4 for details on encoding)

Encoding of BLE GAP Event - Connected

event_connected_packet.png
Figure 1: Encoding of BLE GAP Connected event.

Encoding of Peer Address

event_connected_peer_addr_packet.png
Figure 2: Encoding of peer address inside the BLE GAP Connected event.

Encoding of IRK byte

event_connected_irk.png
Figure 3: Encoding of IRK byte inside BLE GAP Connected event.

Encoding of GAP Connection Parameters

event_connected_conn_param_packet.png
Figure 4: Encoding of GAP Connection Parameters inside the BLE GAP Connected event.