nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0x13 - BLE_GAP_EVT_SEC_PARAMS_REQUEST

Event packet encoding

Frame format encoding of the BLE_GAP_EVT_SEC_PARAMS_REQUEST packet.

Event ID = 0x13 for BLE_GAP_EVT_SEC_PARAMS_REQUEST

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 Security Parameters Request event, the ble_gap_evt_sec_params_request_t is encoded after connection handle as seen in Figure 1.

The Bond, MITM, IO Capabilities and OOB fields are all bitfields inside 1 byte as seen in Figure 2.

The order of the encoding is:

- 2 bytes: Connection Handle
- 2 bytes: Timeout
- 1 byte: (See Figure 2)
- 1 bit: Bond
- 1 bit: MITM
- 3 bits: IO Capabilities
- 1 bit: OOB
- 1 byte: Minimum keysize
- 1 byte: Maximum keysize

Encoding of GAP Security Parameters Request event

event_sec_params_request_packet.png
Figure 1: Encoding of GAP Security Parameters Request event.

Encoding of Bond, MITM, IO Caps and OOB

event_sec_params_request_bond_mitm_iocaps_oob.png
Figure 2: Encoding of Bond, MITM, IO Caps and OOB inside a GAP Security Parameters Request event.