nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0x6D - sd_ble_gap_device_name_get

Function packet format

Frame format encoding of the sd_ble_gap_device_name_get packet.

Operation Code = 0x6D (109) for sd_ble_gap_device_name_get, see BLE_GAP_SVCS.

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

- 1 byte: Operation Code, Value = 0x6D (109)
- 1 byte: Device Name length present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 2 bytes: Conditional: Device Name buffer Size
- 1 byte: Device Name result buffer present
0x00 Field not present
0x01 Field present


device_name_get_packet.png
Figure 1: Packet format for sd_ble_gap_device_name_get function.


Response packet format

Frame format encoding of the sd_ble_gap_device_name_get response packet.

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

- 1 byte:Operation Code, Value = 0x6D (109)
- 1 byte:nRF Error Code


default_error_response_packet.png
Figure 2: Packet format for sd_ble_gap_device_name_get 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 = 0x6D (109)
- 4 bytes: Error code
- 2 bytes: Length of Device Name
- 0 ... 20 bytes:Device Name
'Device Name Length' specifies the actual number of bytes encoded.


device_name_get_response_packet.png
Figure 3: Packet format for sd_ble_gap_device_name_get response.

Device name data length

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.