nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
0xAA - sd_ble_gatts_sys_attr_get

Function packet format

Frame format encoding of the sd_ble_gatts_sys_attr_get packet.

Operation code = 0xAA (170) for sd_ble_gatts_sys_attr_get, see BLE_GATTS_SVCS.

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

- 1 byte: Operation Code, Value = 0x5A (68)
- 2 bytes: Connection Handle
- 1 byte: System Attribute Length Present
0x00 Field not present
0x01 Field present and follows immediately in the packet
- 2 byte: Conditional: Length
- 1 byte: System Attribute Data Present Length


sys_attr_get_packet.png
Figure 1: Packet format for sys_attr_get_packet function.

Response packet format

Frame format encoding of the sd_ble_gatts_sys_attr_get response packet.

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

- 1 byte:Operation Code, Value = 0xAA (170)
- 4 byte:nRF Error Code


default_error_response_packet.png
Figure 2: Packet format for sd_ble_gatts_sys_attr_get error response.

In case of a successful command, The response packet will encode the return value NRF_SUCCESS. If a valid pointer were provided in the function packet, i.e. 'System Attribute Present' = 0x01, then the System Attributes from the BLE S110 SoftDevice will be encoded, and the length of the data will be encoded in the length field.
If a NULL pointer where provided in the function packet, i.e. 'System Attribute Present' = 0x00 , then the length of the System Attribute Data will be encoded, but no data will follow.

- 1 byte:Operation Code, Value = 0xAA (170)
- 4 byte:nRF Success
- 2 bytes:System Attributes Length
- 1 byte:System Attributes Present
0x01 if System Attributes Data are encoded.
0x00 otherwise
- 0 ... n bytesConditional: System Attributes Data
The number, n , of bytes encoded in the packet is defined in the System Attributes Data Length field.


sys_attr_get_resp_packet.png
Figure 3: Packet format for sd_ble_gatts_sys_attr_get function response.