nRF51 SDK - S110 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 Field not present, 0x01 Field 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 Field not present, 0x01 Field present |
In case of a successful command, i.e. 'nRF Error Code' = NRF_SUCCESS
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 Field not present, 0x01 Field 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 Field not present, 0x01 Field 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 |
8 ... 201 bytes | GAP Advertising Parameters | see ble_gap_adv_params_t |
The data inside ble_gap_adv_start_params_t are encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | GAP Advertising Type | see ble_gap_adv_params_t::type |
1 byte | Peer Address Present | 0x00 Field not present, 0x01 Field 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 Field not present, 0x01 Field present |
2 ... 186 bytes | Conditional: GAP Whitelist | see ble_gap_adv_params_t::p_whitelist (Encoding details can be seen in Figure 3) |
2 bytes | Interval | see in ble_gap_adv_params_t::interval |
2 bytes | Timeout | see in ble_gap_adv_params_t::timeout |
If 'Peer Address Present' = 0x01, then the encoding of the 'Peer Address' will follow. 'Peer Address' is a ble_gap_addr_t .
The data 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 |
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, then the encoding of the 'GAP Whitelist' will follow.
'GAP Whitelist' is a 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 pointing to array of device address pointers, pointing to addresses to be used in whitelist, and a pointer ble_gap_whitelist_t::pp_irks pointing to array of Identity Resolving Key (IRK) pointers, each pointing 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 are encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | Address Counter | see ble_gap_whitelist_t::addr_count |
0 ... 56 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 |
0 ... 128 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 start with the 'Whitelist Count' according to the value in ble_gap_whitelist_t::addr_count.
If, the value of 'Whitelist Count' is 0, then no whitelist addresses are encoded, and the 'Whitelist Count' 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. Each address is 7 bytes, with first byte specifying the address type.
The Whitelist addresses are encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | Whitelist Address Count | see ble_gap_whitelist_t::addr_count |
For each address, as defined by 'Whitelist Address Count', the following data are encoded:
Length | Parameter | Value |
---|---|---|
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.
If, the value of 'IRK Count' is 0, then no IRKs are encoded, and the 'IRK Count' 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. Each IRK is 16 bytes.
The IRKs are encoded as:
Length | Parameter | Value |
---|---|---|
1 byte | IRK Count | see ble_gap_whitelist_t::irk_count |
For each IRK, as defined by 'IRK Count', the following data are encoded:
Length | Parameter | Value |
---|---|---|
16 bytes | IRK | see ble_gap_irk_t |
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 Field not present, 0x01 Field 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 | see ble_gap_conn_params_t::min_conn_interval | Minimum Connection Interval |
2 bytes | see ble_gap_conn_params_t::max_conn_interval | Maximum Connection Interval |
2 bytes | see ble_gap_conn_params_t::slave_latency | Slave Latency in number of connection events |
2 bytes | see ble_gap_conn_params_t::conn_sup_timeout | Connection Supervision 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 Field not present, 0x01 Field 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 Field not present, 0x01 Field present |
8 bytes | GAP Connection Parameters | see ble_gap_conn_params_t |
GAP Connection Parameters are encoded in 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 Field not present, 0x01 Field present |
In case of a successful command, i.e. 'nRF Error Code' = NRF_SUCCESS
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 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 Field not present, 0x01 Field 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 Field not present, 0x01 Field 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 Field not present, 0x01 Field present |
2 bytes | Conditional: Device Name Length | see sd_ble_gap_device_name_get |
2 bytes | Device Name Buffer Present | 0x00 Field not present, 0x01 Field present |
In case of a successful command, i.e. 'nRF Error Code' = NRF_SUCCESS
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 Field not present, 0x01 Field 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 can not indicate larger buffer than what the command decoder can be able to 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 Field not present, 0x01 Field present |
5 bytes | Conditional: Security Parameters | see sd_ble_gap_authenticate |
ble_gap_sec_params_t are encoded in following order:
Length | Parameter | Value |
---|---|---|
2 bytes | Timeout | see ble_gap_sec_params_t::timeout |
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 |
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 Field not present, 0x01 Field present |
2 bytes | Conditional: ble_gap_sec_params_t::timeout | Timeout for SMP transactions or Security Request in seconds |
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 |
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_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 |
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 Field not present, 0x01 Field 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_sec_info_reply 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 | Encryption Information Present | 0x00 Field not present, 0x01 Field present |
19 bytes | Conditional: Encryption Information | see ble_gap_enc_info_t |
1 byte | Signing Information Present | 0x00 Field not present, 0x01 Field 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 | 0x81, 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 | 0x82, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
1 byte | Connection Security field present | 0x00 Field not present, 0x01 Field present |
In case of a successful command, i.e. 'nRF Error Code' = NRF_SUCCESS
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 | 0x82, see BLE_GAP_SVCS |
4 bytes | nRF Error Code | see sd_ble_gap_ppcp_get |
1 byte | Conditional: Connection Security field present | 0x00 Field not present, 0x01 Field 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 | 0x83, see BLE_GAP_SVCS |
2 bytes | Connection Handle | Handle value |
Frame format encoding of the sd_ble_gap_rssi_start response packet:
Length | Parameter | Value |
---|---|---|
1 byte | Operation Code | 0x83 |
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 | 0x84, 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 | 0x84 |
4 bytes | nRF Error Code | see sd_ble_gap_rssi_stop |