nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0xA4 - sd_ble_gatts_value_set

Function packet format

Frame format encoding of the sd_ble_gatts_value_set packet.

Operation Code = 0xA4 (164) for sd_ble_gatts_value_set, see BLE_GATTS_SVCS.

The parameter provided as input to sd_ble_gatts_value_set is encoded in the following order:

- 1 byte: Operation Code, Value = 0xA4 (164)
- 2 bytes: Attribute Handle
- 2 bytes: Offset
- 1 byte: Length Present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 2 byte: Conditional: Length
- 1 byte: Attribute Value Present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 0...Length bytes: Conditional: The number of bytes encoded is specified by the Length field.


gatts_value_set.png
Figure 1: Packet format for sd_ble_gatts_value_set function.

Response packet format

Frame format encoding of the sd_ble_gatts_value_set response packet.

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

- 1 byte:Operation Code, Value = 0xA4 (164)
- 4 byte:nRF Error Code


default_error_response_packet.png
Figure 2: Packet format for sd_ble_gatts_value_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 = 0xA4 (164)
- 4 bytes:Return Code
- 2 bytes:Length of bytes written


gatts_value_set_response.png
Figure 3: Packet format for sd_ble_gatts_value_set function response.