nRF51 SDK - S130 SoftDevice
|
Frame format encoding of the sd_ble_gap_address_set packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x70, see BLE_GAP_SVCS |
1 byte | Address Cycle Mode | See sd_ble_gap_address_set |
1 byte | Address present | 0x00 - not present, 0x01 - present |
7 bytes | Address | See ble_gap_addr_t |
As can also be seen inside Figure 1, the 7 bytes inside ble_gap_addr_t are encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | Address Type | See ble_gap_addr_t::addr_type |
6 bytes | Address | See ble_gap_addr_t::addr |
Frame format encoding of the sd_ble_gap_address_set response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x70, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_address_set |
Frame format encoding of the sd_ble_gap_address_get packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x71, see BLE_GAP_SVCS |
1 byte | Address present | 0x00 - not present, 0x01 - present |
If a command was executed successfully, so that 'nRF Error Code' = NRF_SUCCESS
, the nRF Error Code is followed by conditional data.
Frame format encoding of the sd_ble_gap_address_get response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x71, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_address_get |
7 bytes | Conditional: Address | See ble_gap_addr_t |
ble_gap_addr_t is encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | Address Type | See ble_gap_addr_t::addr_type |
6 bytes | Address | See ble_gap_addr_t::addr |
Frame format encoding of the sd_ble_gap_adv_data_set packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x72, see BLE_GAP_SVCS |
1 byte | Advertising Data Length | See sd_ble_gap_adv_data_set |
1 byte | Advertising Data Present | 0x00 - not present, 0x01 - present |
n bytes | Advertising Data | See sd_ble_gap_adv_data_set |
1 byte | Scan Response Data Length | See sd_ble_gap_adv_data_set |
1 byte | Scan Response Data Present | 0x00 - not present, 0x01 - present |
n bytes | Scan Response Data | See sd_ble_gap_adv_data_set |
Frame format encoding of the sd_ble_gap_adv_data_set response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x72, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_adv_data_set |
Frame format encoding of the sd_ble_gap_adv_start packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x73, see BLE_GAP_SVCS |
1 byte | Advertising Parameters Present | 0x00 Fields not present, 0x01 Fields present |
9 ... 220 bytes | GAP Advertising Parameters | See ble_gap_adv_params_t |
The data inside ble_gap_adv_start_params_t is encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | GAP Advertising Type | See ble_gap_adv_params_t::type |
1 byte | Peer Address Present | 0x00 - not present, 0x01 - present |
7 bytes | Conditional: Peer Address | See ble_gap_adv_params_t::p_peer_addr (Encoding details can be seen in Figure 2) |
1 byte | Filter Policy | See ble_gap_adv_params_t::fp |
1 byte | GAP Whitelist Present | 0x00 - not present, 0x01 - present |
4 ... 204 bytes | Conditional: GAP Whitelist | See ble_gap_adv_params_t::p_whitelist (Encoding details can be seen in Figure 3) |
2 bytes | Interval | See ble_gap_adv_params_t::interval |
2 bytes | Timeout | See ble_gap_adv_params_t::timeout |
1 byte | Channel Mask (bitfields): - ch_37_off: 1 bit, - ch_38_off: 1 bit, - ch_39_off: 1 bit | See ble_gap_adv_params_t::channel_mask |
If 'Peer Address Present' = 0x01, the encoding of the 'Peer Address' will follow. 'Peer Address' is of type ble_gap_addr_t.
The data inside ble_gap_addr_t is encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | Address type | See ble_gap_addr_t::addr_type |
6 bytes | Address | See ble_gap_addr_t::addr |
If 'Peer Address Present' = 0x00, the encoding of 'Filter Policy' will follow, and hence no 'Peer Address' will be encoded in the packet.
If 'GAP Whitelist Present' = 0x01, the encoding of the 'GAP Whitelist' will follow. 'GAP Whitelist' is of type ble_gap_whitelist_t.
ble_gap_whitelist_t contains two counters, ble_gap_whitelist_t::addr_count and ble_gap_whitelist_t::irk_count, as well as two pointers to arrays. One pointer (ble_gap_whitelist_t::pp_addrs) points to an array of device address pointers (which point to addresses to be used in the whitelist. The other pointer (ble_gap_whitelist_t::pp_irks) points to an array of Identity Resolving Key (IRK) pointers (which each point to an IRK in the whitelist).
The encoded 'GAP whitelist' will first contain the address counter, followed by the encoding of each address. Then the IRK counter, followed by the encoding of each IRK.
The data inside ble_gap_whitelist_t is encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | Address Counter | See ble_gap_whitelist_t::addr_count |
1 byte | Address list present | 0x00 - not present, 0x01 - present |
0 ... 64 bytes | Address list | See ble_gap_addr_t ('Address Counter' specifies the actual number of addresses encoded) |
1 byte | IRK Counter | See ble_gap_whitelist_t::irk_count |
1 byte | IRK list present | 0x00 - not present, 0x01 - present |
0 ... 136 bytes | IRK list | See ble_gap_irk_t ('IRK Counter' specifies the actual number of IRKs encoded) |
If 'GAP Whitelist Present' = 0x00, the encoding of 'Interval' will follow, and hence no 'GAP Whitelist' will be encoded in the packet.
The encoding of whitelist addresses starts with the 'Whitelist Address Count' according to the value in ble_gap_whitelist_t::addr_count. It is followed by the 'Address list present' field, which indicates whether the ble_gap_whitelist_t::pp_addrs pointer equals NULL. If the value of 'Address list present' is 0, no whitelist addresses are encoded, and the 'Address list present' will be followed by the 'IRK Count' as seen in the top of Figure 4. Otherwise each whitelist address (ble_gap_addr_t) will be encoded as specified by the counter. Before each address, the 'Address present' field is encoded indicating whether the pointer to the address is NULL. Each address is 7 bytes, with the first byte specifying the address type.
The whitelist addresses are encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | Address list present | 0x00 - not present, 0x01 - present |
1 byte | Whitelist Address Count | See ble_gap_whitelist_t::addr_count |
For each address, as defined by 'Whitelist Address Count', the following data is encoded:
Length | Parameter | Value |
---|---|---|
1 byte | Address present | 0x00 - not present, 0x01 - present |
1 byte | Address type | See ble_gap_addr_t::addr_type |
6 bytes | Address | See ble_gap_addr_t::addr |
The encoding of whitelist IRKs start with the 'IRK Count' according to the value in ble_gap_whitelist_t::irk_count. It is followed by the 'IRK list present' field, which indicates whether the ble_gap_whitelist_t::pp_irks pointer equals NULL. If the value of 'IRK list present' is 0, no IRKs are encoded, and the 'IRK list present' will be followed by the 'Interval' field as seen in the top of Figure 5. Otherwise each IRK (ble_gap_irk_t) will be encoded as specified by the counter. Before each IRK, the 'IRK present' field is encoded indicating whether the pointer to IRK is NULL. Each IRK is 16 bytes.
The IRKs are encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | IRK list present | 0x00 - not present, 0x01 - present |
1 byte | IRK Count | See ble_gap_whitelist_t::irk_count |
For each IRK, as defined by 'IRK Count', the following data is encoded:
Length | Parameter | Value |
---|---|---|
1 byte | IRK present | 0x00 - not present, 0x01 - present |
16 bytes | IRK | See ble_gap_irk_t |
The channel mask structure consists of 3 bitfields that are encoded in one byte as follows:
Frame format encoding of the sd_ble_gap_adv_start response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x73, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_adv_start |
Frame format encoding of the sd_ble_gap_adv_stop packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x74, see BLE_GAP_SVCS |
Frame format encoding of the sd_ble_gap_adv_stop response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x74, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_adv_stop |
Frame format encoding of the sd_ble_gap_conn_param_update packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x75, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Connection Parameters Present | 0x00 - not present, 0x01 - present |
8 bytes | Conditional: Connection Parameters | See ble_gap_conn_params_t |
As can also be seen inside Figure 1, the 8 bytes inside ble_gap_conn_params_t are encoded as:
Length | Parameter | Value |
---|---|---|
2 bytes | Minimum Connection Interval | See ble_gap_conn_params_t::min_conn_interval |
2 bytes | Maximum Connection Interval | See ble_gap_conn_params_t::max_conn_interval |
2 bytes | Slave Latency in number of connection events | See ble_gap_conn_params_t::slave_latency |
2 bytes | Connection Supervision Timeout | See ble_gap_conn_params_t::conn_sup_timeout |
Frame format encoding of the sd_ble_gap_conn_param_update response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x75 (117) |
4 bytes | nRF Error Code | See sd_ble_gap_conn_param_update |
Frame format encoding of the sd_ble_gap_disconnect packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x76, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle |
1 byte | HCI Status Code | See Bluetooth status codes |
Frame format encoding of the sd_ble_gap_disconnect response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x76, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_disconnect |
Frame format encoding of the sd_ble_gap_tx_power_set packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x77, see BLE_GAP_SVCS |
1 byte | TX Power in dBm | See sd_ble_gap_tx_power_set |
Frame format encoding of the sd_ble_gap_tx_power_set response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x77, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_tx_power_set |
Frame format encoding of the sd_ble_gap_appearance_set packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x78, see BLE_GAP_SVCS |
2 bytes | Appearance | See Bluetooth Appearance values |
Frame format encoding of the sd_ble_gap_appearance_set response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x78, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_appearance_set |
Frame format encoding of the sd_ble_gap_appearance_get packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x79, see BLE_GAP_SVCS |
1 byte | Appearance present | 0x00 - not present, 0x01 - present |
Frame format encoding of the sd_ble_gap_appearance_get response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x79, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_appearance_get |
2 bytes | Conditional: Appearance | See sd_ble_gap_appearance_get |
Frame format encoding of the sd_ble_gap_ppcp_set packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7A, see BLE_GAP_SVCS |
1 byte | Next Field Present | 0x00 - not present, 0x01 - present |
8 bytes | GAP Connection Parameters | See ble_gap_conn_params_t |
GAP Connection Parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
2 bytes | Minimum Connection Interval | See ble_gap_conn_params_t::min_conn_interval |
2 bytes | Maximum Connection Interval | See ble_gap_conn_params_t::max_conn_interval |
2 bytes | Slave Latency | See ble_gap_conn_params_t::slave_latency |
2 bytes | Connection Supervision Timeout | See ble_gap_conn_params_t::conn_sup_timeout |
Frame format encoding of the sd_ble_gap_ppcp_set response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7A, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_ppcp_set |
Frame format encoding of the sd_ble_gap_ppcp_get packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7B, see BLE_GAP_SVCS |
1 byte | Peripheral Preferred Connection Parameters field present | 0x00 - not present, 0x01 - present |
If a command was executed successfully, so that 'nRF Error Code' = NRF_SUCCESS
, the nRF Error Code is followed by conditional data.
Frame format encoding of the sd_ble_gap_ppcp_get response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7B, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_ppcp_get |
8 bytes | Conditional: Connection Parameters | See ble_gap_conn_params_t |
GAP Connection Parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
2 bytes | Minimum Connection Interval | See ble_gap_conn_params_t::min_conn_interval |
2 bytes | Maximum Connection Interval | See ble_gap_conn_params_t::max_conn_interval |
2 bytes | Slave Latency | See ble_gap_conn_params_t::slave_latency |
2 bytes | Connection Supervision Timeout | See ble_gap_conn_params_t::conn_sup_timeout |
Frame format encoding of the sd_ble_gap_device_name_set packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7C, see BLE_GAP_SVCS |
1 byte | Next Field Present | 0x00 - not present, 0x01 - present |
1 byte | Conditional: Write Permissions | See ble_gap_conn_sec_mode_t |
2 bytes | Device Name Length | See sd_ble_gap_device_name_set |
1 byte | Next Field Present | 0x00 - not present, 0x01 - present |
n bytes | Conditional: Device Name | See sd_ble_gap_device_name_set |
The bit fields of Write Permissions are encoded as:
Length | Parameter | Value |
---|---|---|
bit 0 to 3 | Security Mode | See ble_gap_conn_sec_mode_t::sm |
bit 4 to 7 | Security Level | See ble_gap_conn_sec_mode_t::lv |
Frame format encoding of the sd_ble_gap_device_name_set response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7C, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_device_name_set |
Frame format encoding of the sd_ble_gap_device_name_get packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7D, see BLE_GAP_SVCS |
1 byte | Device Name Length Present | 0x00 - not present, 0x01 - present |
2 bytes | Conditional: Device Name Length | See sd_ble_gap_device_name_get |
2 bytes | Device Name Buffer Present | 0x00 - not present, 0x01 - present |
If a command was executed successfully, so that 'nRF Error Code' = NRF_SUCCESS
, the nRF Error Code is followed by conditional data.
Frame format encoding of the sd_ble_gap_device_name_get response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7D, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_device_name_get |
2 bytes | Conditional: Device Name Length | See sd_ble_gap_device_name_get |
1 byte | Conditional: Next Field Present | 0x00 - not present, 0x01 - present |
n bytes | Conditional: Device Name | See sd_ble_gap_device_name_get |
The device name length and device name data will not be returned if the device name length in sd_ble_gap_device_name_get is larger than the internal connectivity buffer size. The caller of the function cannot indicate a larger buffer than what the command decoder can provide to the SoftDevice. An NRF_ERROR_DATA_SIZE will be returned in the error code field of the packet, and no device name length or data will be returned.
Frame format encoding of the sd_ble_gap_authenticate packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7E, see BLE_GAP_SVCS |
2 bytes | Connection Handle | See sd_ble_gap_authenticate |
1 byte | Security Parameters Present | 0x00 - not present, 0x01 - present |
5 bytes | Conditional: Security Parameters | See sd_ble_gap_authenticate |
ble_gap_sec_params_t are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Bond, MITM, IO Caps and OOB | See ble_gap_sec_params_t |
1 byte | Minimum Key Size | See ble_gap_sec_params_t::min_key_size |
1 byte | Maximum Key Size | See ble_gap_sec_params_t::max_key_size |
1 byte | Peripheral Key Distribution Bitmap | See ble_gap_sec_params_t::kdist_periph |
1 byte | Peripheral Key Distribution Bitmap | See ble_gap_sec_params_t::kdist_central |
The Bond, MITM, IO Capabilities, and OOB fields are all bitfields inside 1 byte, as seen in Figure 2.
Frame format encoding of the sd_ble_gap_authenticate response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7E, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_authenticate |
Frame format encoding of the sd_ble_gap_sec_params_reply packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7F, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Security Status | Status code |
1 byte | Security Parameters Present | 0x00 - not present, 0x01 - present |
1 byte | Conditional: bitfields of ble_gap_sec_params_t | Bond, MITM, IO capabilites, and OOB bitfield |
1 byte | Conditional: ble_gap_sec_params_t::min_key_size | Minimum encryption key size in octets |
1 byte | Conditional: ble_gap_sec_params_t::max_key_size | Maximum encryption key size in octets |
1 byte | Conditional: bitfields of ble_gap_sec_params_t::kdist_periph | Peripheral key distribution bitmap |
1 byte | Conditional: bitfields of ble_gap_sec_params_t::kdist_central | Central key distribution bitmap |
1 byte | Security Keyset Present | 0x00 - not present, 0x01 - present |
1 byte | Conditional: Peripheral Encryption Keys Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Encryption Info: Long Term Key | See ble_gap_enc_info_t::ltk |
1 bytes | Conditional: Encryption Info: bitfields | See ble_gap_enc_info_t::auth, ble_gap_enc_info_t::ltk_len |
2 bytes | Conditional: Master identification: Encrypted Diversifier | See ble_gap_master_id_t::ediv |
8 bytes | Conditional: Master identification: Random Number | See ble_gap_master_id_t::ediv |
1 byte | Conditional: Peripheral Identity Keys Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Identity Resolving Key | See ble_gap_id_key_t::id_info |
1 byte | Conditional: Identity Address Info: Address Type | See ble_gap_id_key_t::id_addr_info |
6 bytes | Conditional: Identity Address Info: Address | See ble_gap_id_key_t::id_addr_info |
1 byte | Conditional: Peripheral Signing Information Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Connection Signature Resolving Key | See ble_gap_sign_info_t |
1 byte | Conditional: Central Encryption Keys Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Encryption Info: Long Term Key | See ble_gap_enc_info_t::ltk |
1 bytes | Conditional: Encryption Info: bitfields | See ble_gap_enc_info_t::auth, ble_gap_enc_info_t::ltk_len |
2 bytes | Conditional: Master identification: Encrypted Diversifier | See ble_gap_master_id_t::ediv |
8 bytes | Conditional: Master identification: Random Number | See ble_gap_master_id_t::ediv |
1 byte | Conditional: Central Identity Keys Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Identity Resolving Key | See ble_gap_id_key_t::id_info |
1 byte | Conditional: Identity Address Info: Address Type | See ble_gap_id_key_t::id_addr_info |
6 bytes | Conditional: Identity Address Info: Address | See ble_gap_id_key_t::id_addr_info |
1 byte | Conditional: Central Signing Information Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Connection Signature Resolving Key | See ble_gap_sign_info_t |
The Bond, MITM, IO capabilities, and OOB fields are all bitfields inside 1 byte, as seen in Figure 2. The Key Distribution Bitmap is a structure containing bitfields inside 1 byte, as seen in Figure 3. The Security Keyset Structure is encoded as shown in Figures 4 and 5.
When sd_ble_gap_sec_params_reply is called, a security context is created using conn_ble_gap_sec_context_create and app_ble_gap_sec_context_create on Connectivity and Application processors respectively. The context is used to handle security keys. It is released using conn_ble_gap_sec_context_destroy and app_ble_gap_sec_context_destroy when BLE_GAP_EVT_AUTH_STATUS is received.
Each member of the Keyset Structure (Peripheral Keys and Central Keys) is encoded the same way. Encoding details are shown in Figure 5.
Frame format encoding of the sd_ble_gap_sec_params_reply response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x7F, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_sec_params_reply |
1 byte | Security Keyset Present | 0x00 - not present, 0x01 - present |
6 ... 138 byte | Security Keyset | See ble_gap_sec_keyset_t |
The Security Keyset field in the response packet is encoded the same way as in the command packet (see Figures 4 and 5).
Frame format encoding of the sd_ble_gap_auth_key_reply packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x80, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Key Type | See GAP Authentication Key Types |
1 byte | Key Present | 0x00 - not present, 0x01 - present |
6 or 16 bytes | Conditional: Key | Key value |
Frame format encoding of the sd_ble_gap_auth_key_reply response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x80 (128) |
4 bytes | nRF Error Code | See sd_ble_gap_auth_key_reply |
Frame format encoding of the sd_ble_gap_encrypt packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x81, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Master Identification Present | 0x00 - not present, 0x01 - present |
10 bytes | Conditional: Master Identification | See ble_gap_master_id_t |
1 byte | Encryption Information Present | 0x00 - not present, 0x01 - present |
17 bytes | Conditional: Encryption Information | See ble_gap_enc_info_t |
Frame format encoding of the sd_ble_gap_encrypt response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x81, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_encrypt |
Frame format encoding of the sd_ble_gap_sec_info_reply packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x82, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Encryption Information Present | 0x00 - not present, 0x01 - present |
17 bytes | Conditional: Encryption Information | See ble_gap_enc_info_t |
1 byte | Identity Information Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Identity Information | See ble_gap_irk_t |
1 byte | Signing Information Present | 0x00 - not present, 0x01 - present |
16 bytes | Conditional: Signing Information | See ble_gap_sign_info_t |
The bit fields of Encryption Information are encoded as below and depicted in Figure 2 and Figure 3:
Length | Parameter | Value |
---|---|---|
bit 0 | Authenticated Key | See ble_gap_enc_info_t::auth |
bit 1 to 7 | LTK length in octets | See ble_gap_enc_info_t::ltk_len |
Frame format encoding of the sd_ble_gap_sec_info_reply response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x82, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_sec_info_reply |
Frame format encoding of the sd_ble_gap_conn_sec_get packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x83, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Connection Security field present | 0x00 - not present, 0x01 - present |
If a command was executed successfully, so that 'nRF Error Code' = NRF_SUCCESS
, the nRF Error Code is followed by conditional data.
Frame format encoding of the sd_ble_gap_conn_sec_get response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x83, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | See sd_ble_gap_ppcp_get |
1 byte | Conditional: Connection Security field present | 0x00 - not present, 0x01 - present |
2 bytes | Conditional: Connection Security | See ble_gap_conn_sec_t |
Frame format encoding of the sd_ble_gap_rssi_start packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x84, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Threshold | Threshold value in dBm |
1 byte | Skip count | Number of RSSI samples |
Frame format encoding of the sd_ble_gap_rssi_start response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x84 |
4 bytes | nRF Error Code | See sd_ble_gap_rssi_start |
Frame format encoding of the sd_ble_gap_rssi_stop packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x85, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
Frame format encoding of the sd_ble_gap_rssi_stop response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x85 |
4 bytes | nRF Error Code | See sd_ble_gap_rssi_stop |
Frame format encoding of the sd_ble_gap_scan_start packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x86, see BLE_GAP_SVCS |
1 byte | Scan Params field present | 0x00 - not present, 0x01 - present |
1 byte | Active, selective fields | See ble_gap_scan_params_t::active and ble_gap_scan_params_t::selective |
1 byte | GAP Whitelist field present | 0x00 - not present, 0x01 - present |
2...186 bytes | GAP Whitelist | See 0x73 - sd_ble_gap_adv_start codec for encoding details |
2 bytes | Scan interval | See ble_gap_scan_params_t::interval |
2 bytes | Scan window | See ble_gap_scan_params_t::window |
2 bytes | Scan timeout | See ble_gap_scan_params_t::timeout |
Frame format encoding of the sd_ble_gap_scan_start response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x86 |
4 bytes | nRF Error Code | See sd_ble_gap_scan_start |
Frame format encoding of the sd_ble_gap_scan_stop packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x87, see BLE_GAP_SVCS |
Frame format encoding of the sd_ble_gap_scan_stop response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x87 |
4 bytes | nRF Error Code | See sd_ble_gap_scan_stop |
Frame format encoding of the sd_ble_gap_connect packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x88, see BLE_GAP_SVCS |
1 byte | Peer Address Present | 0x00 - not present, 0x01 - present |
7 bytes | Peer Address | See Function packet format for encoding details |
1 byte | Scan Parameters Present | 0x00 - not present, 0x01 - present |
8...194 bytes | Scan Parameters | See Function packet format for encoding details |
1 byte | Connection Parameters Present | 0x00 - not present, 0x01 - present |
8 bytes | Connection Parameters | See Function packet format for encoding details |
Frame format encoding of the sd_ble_gap_connect response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x88 |
4 bytes | nRF Error Code | See sd_ble_gap_connect |
Frame format encoding of the sd_ble_gap_connect_cancel packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x89, see BLE_GAP_SVCS |
Frame format encoding of the sd_ble_gap_connect_cancel response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x89 |
4 bytes | nRF Error Code | See sd_ble_gap_connect |
Frame format encoding of the sd_ble_gap_rssi_get packet.
The parameters are encoded in the following order:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x8A, see BLE_GAP_SVCS |
2 bytes | Connection handle | Handle value |
1 byte | RSSI field present | 0x00 - not present, 0x01 - present |
If a command was executed successfully, so that 'nRF Error Code' = NRF_SUCCESS
, the nRF Error Code is followed by conditional data.
Frame format encoding of the sd_ble_gap_rssi_get response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x8A |
4 bytes | nRF Error Code | See sd_ble_gap_rssi_get |
1 byte | Conditional: RSSI | Measured RSSI |