nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0x6F - sd_ble_gap_sec_params_reply

Function packet format

Frame format encoding of the sd_ble_gap_sec_params_reply packet.

Operation Code = 0x6F (111) for sd_ble_gap_sec_params_reply, see BLE_GAP_SVCS.

The parameters provided as input to sd_ble_gap_sec_params_reply is encoded in the following order:

- 1 byte: Operation Code, Value = 0x6F (111)
- 2 bytes: Connection Handle
- 1 byte:GAP Security status Security status
- 1 byte: Security Parameters Present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 2 bytes:ble_gap_sec_params_t::timeoutConditional: Timeout for SMP transactions or Security Request in seconds
- 1 byte:ble_gap_sec_params_tConditional: Bond, MITM, IO capabilites and OOB bitfield
- 1 byte:ble_gap_sec_params_t::min_key_size Conditional: Minimum encryption key size in octets
- 1 byte:ble_gap_sec_params_t::max_key_size Conditional: Maximum encryption key size in octets


sec_params_reply_packet.png
Figure 1: Packet format for sd_ble_gap_sec_params_reply function.

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

Encoding of Bond, MITM, IO Caps and OOB

sec_params_reply_packet_bitfields.png
Figure 2: Encoding of Bond, MITM, IO Caps and OOB inside a sd_ble_gap_sec_params_reply function packet.

Response packet format

Frame format encoding of the sd_ble_gap_sec_params_reply response packet.

In case of an error, the following data is encoded:

- 1 byte:Operation Code, Value = 0x6F (111)
- 4 byte:nRF Error Code


default_error_response_packet.png
Figure 2: Packet format for sd_ble_gap_sec_params_reply error response.

In case of a successful command, i.e. 'nRF Error Code' = NRF_SUCCESS, the following data is encoded:

- 1 byte: Operation Code, Value = 0x6F (111)
- 4 bytes:nRF Error Code


default_success_response_packet.png
Figure 3: Packet format for sd_ble_gap_sec_params_reply success response.