nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0x54 - sd_ble_uuid_encode

Function packet format

Frame format encoding of the sd_ble_uuid_encode packet.

Operation Code = 0x54 (84) for sd_ble_uuid_encode, see BLE_COMMON_SVCS.

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

- 1 byte:Operation Code, Value = 0x54 (84)
- 1 byte:UUID present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 3 bytes:ble_uuid_t Conditional: UUID
- 1 byte:Length present
0x00 Field not present
0x01 Field present
- 1 byte:UUID result buffer present
0x00 Field not present
0x01 Field present


As can also be seen inside Figure 1 the 3 bytes inside ble_uuid_t are encoded as:

- 2 bytes:ble_uuid_t::uuid UUID Value
- 1 byte:ble_uuid_t::type UUID Type, see Types of UUID


uuid_encode_packet.png
Figure 1: Packet format for sd_ble_uuid_encode function.


Response packet format

Frame format encoding of the sd_ble_uuid_encode response packet.

The response packet will encode the return value and in case NRF_SUCCESS is returned, the handle value is also encoded.
In case of an error, only the error code is encoded, without additional data.

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

- 1 byte:Operation Code, Value = 0x54 (84)
- 4 byte:nRF Error Code


default_error_response_packet.png
Figure 2: Packet format for sd_ble_uuid_encode 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 = 0x54 (84)
- 4 byte:nRF Error Code
- 1 byte:Length of encoded UUID, if 'nRF Error Code' is NRF_SUCCESS
- 2 or 16 bytes:Encoded UUID, if 'nRF Error Code' is NRF_SUCCESS
Otherwise nothing is encoded.


uuid_encode_response_packet.png
Figure 3: Packet format sd_ble_uuid_encode response.