nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0x6C - sd_ble_gap_device_name_set

Function packet format

Frame format encoding of the sd_ble_gap_device_name_set packet.

Operation Code = 0x6C (108) for sd_ble_gap_device_name_set, see BLE_GAP_SVCS.

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

- 1 byte: Operation Code, Value = 0x6C (108)
- 1 byte: Write Permissions Present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 1 byte: ble_gap_conn_sec_mode_t Conditional: Write Permissions
- 2 bytes: Length of Device Name
- 1 byte: Device Name Present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 0 ... 20 bytes:Conditional: Device Name
'Device Name Length' specifies the actual number of bytes encoded.


The bit fields of Write Permissions are encoded as:

- bit 0 to 3:ble_gap_conn_sec_mode_t::sm Security Mode
- bit 4 to 7:ble_gap_conn_sec_mode_t::lv Security Level


device_name_set_packet.png
Figure 1: Packet format for sd_ble_gap_device_name_set function.

Response packet format

Frame format encoding of the sd_ble_gap_device_name_set response packet.

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

- 1 byte:Operation Code, Value = 0x6C (108)
- 4 byte:nRF Error Code


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


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