nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0x62 - sd_ble_gap_adv_data_set

Function packet format

Frame format encoding of the sd_ble_gap_adv_data_set packet.

Operation Code = 0x62 (98) for sd_ble_gap_adv_data_set, see BLE_GAP_SVCS.

The parameters provided as input to sd_ble_gap_adv_data_set are encoded in the following order:

- 1 byte: Operation Code, Value = 0x62 (98)
- 1 byte: Length of Advertising data
- 0 ... 31 bytes: Advertising Data array
The number of bytes encoded are specified in the 'Advertising Data Length' field
If 'Advertising Data Length' = 0, no data are encoded, and the following byte will be the 'Scan Response Data Length' field, see Figure 2
- 1 byte: Length of Scan Response data
- 0 ... 31 bytes: Scan Response Data array
The number of bytes encoded are specified in the 'Scan Response Data Length' field
If 'Scan Response Data Length' = 0, no data are encoded, and no more bytes are encoded in the packet, see Figure 2


advertising_set_packet.png
Figure 1: Packet format for sd_ble_gap_adv_set function.

Encoding of Advertising Packet when data is zero length

empty_advertising_set_packet.png
Figure 2: Packet format for an empty sd_ble_gap_adv_set function.

Response packet format

Frame format encoding of the sd_ble_gap_adv_data_set response packet.

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

- 1 byte:Operation Code, Value = 0x62 (98)
- 4 byte:nRF Error Code


default_error_response_packet.png
Figure 2: Packet format for sd_ble_gap_adv_data_set 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 = 0x62 (98)
- 4 bytes:nRF Error Code


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