nRF51 SDK - S120 SoftDevice
|
Frame format encoding of the BLE_GATTS_EVT_WRITE packet.
Event ID = 0x50 for BLE_GATTS_EVT_WRITE
All BLE events, ble_evt_t, are encoded with the header ble_evt_hdr_t first, containing only the Event ID followed by the event. The Event Length will not be encoded, because the size of the event could differ depending on the decoder architecture.
The BLE GAP event contains a connection handle. For the BLE GATTS Write event, the ble_gatts_evt_write_t is encoded after the connection handle, as seen in Figure 2.
The order of the encoding is:
Length | Parameter | Value |
---|---|---|
2 bytes | Connection Handle | See ble_gatts_evt_t::conn_handle |
2 bytes | Attribute Handle | See ble_gatts_evt_write_t::handle |
1 byte | Write Operation | See ble_gatts_evt_write_t::op |
2 bytes | Service UUID | UUID value |
1 byte | Service UUID Type | UUID type |
2 bytes | Char UUID | Characteristic UUID if applicable |
1 byte | Char UUID Type | Characteristic UUID type if applicable (BLE_UUID_TYPE_UNKNOWN if N/A) |
2 bytes | Desc UUID | Descriptor UUID if applicable |
1 byte | Desc UUID Type | Descriptor UUID type if applicable (BLE_UUID_TYPE_UNKNOWN if N/A) |
2 bytes | Service Handle | Handle value |
2 bytes | Value Handle | Characteristic handle if applicable (BLE_GATT_HANDLE_INVALID if N/A) |
1 byte | Attribute Type | See GATT Server Attribute Types |
2 bytes | Offset | See ble_gatts_evt_write_t::offset |
2 bytes | Data Length | See ble_gatts_evt_write_t::len |
0...'Data Length' bytes | Data | See ble_gatts_evt_write_t::data |
2 bytes | User Memory Block Length | See ble_user_mem_block_t::len |
0...'User Memory Block Length' bytes | User Memory Block | See ble_user_mem_block_t::p_mem |
The fields 'User Memory Block Length' and 'User Memory Block' are conditional based on the 'Write Operation' field and if the context corresponding to a given connection handle was found.
Frame format encoding of the BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST packet.
Event ID = 0x51 for BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST
All BLE events, ble_evt_t, are encoded with the header ble_evt_hdr_t first, containing only the Event ID followed by the event. The Event Length will not be encoded, because the size of the event could differ depending on the decoder architecture.
The BLE GAP event contains a connection handle. For the BLE GATTS RW Authorize Request event, the ble_gatts_evt_rw_authorize_request_t is encoded after the connection handle, as seen in Figure 1 and Figure 2.
The order of the encoding for read authorization is:
Length | Parameter | Value |
---|---|---|
2 bytes | Connection Handle | See ble_gatts_evt_t::conn_handle |
1 byte | Authorization Type | See ble_gatts_evt_rw_authorize_request_t::type |
2 bytes | Attribute Handle | See ble_gatts_evt_read_t::handle |
2 bytes | Service UUID | UUID value |
1 byte | Service UUID Type | UUID type |
2 bytes | Char UUID | Characteristic UUID if applicable |
1 byte | Char UUID Type | Characteristic UUID type if applicable (BLE_UUID_TYPE_UNKNOWN if N/A) |
2 bytes | Desc UUID | Descriptor UUID if applicable |
1 byte | Desc UUID Type | Descriptor UUID type if applicable (BLE_UUID_TYPE_UNKNOWN if N/A) |
2 bytes | Service Handle | Handle value |
2 bytes | Value Handle | Characteristic handle if applicable (BLE_GATT_HANDLE_INVALID if N/A) |
1 byte | Attribute Type | See GATT Server Attribute Types |
2 bytes | Offset | Offset for the write operation |
The order of the encoding for write authorization is:
Length | Parameter | Value |
---|---|---|
2 bytes | Connection Handle | See ble_gatts_evt_t::conn_handle |
1 byte | Authorization Type | See ble_gatts_evt_rw_authorize_request_t::type |
2 bytes | Attribute Handle | See ble_gatts_evt_write_t::handle |
1 byte | Write Operation | Type of write operation, see GATT Server Operations |
2 bytes | Service UUID | UUID value |
1 byte | Service UUID Type | UUID type |
2 bytes | Char UUID | Characteristic UUID if applicable |
1 byte | Char UUID Type | Characteristic UUID type if applicable (BLE_UUID_TYPE_UNKNOWN if N/A) |
2 bytes | Desc UUID | Descriptor UUID if applicable |
1 byte | Desc UUID Type | Descriptor UUID type if applicable (BLE_UUID_TYPE_UNKNOWN if N/A) |
2 bytes | Service Handle | Handle value |
2 bytes | Value Handle | Characteristic handle if applicable (BLE_GATT_HANDLE_INVALID if N/A) |
1 byte | Attribute Type | See GATT Server Attribute Types |
2 bytes | Offset | Offset for the write operation |
2 bytes | Data Length | Length of the incoming data |
0...'Data Length' bytes | Data | Incoming data, variable length |
2 bytes | User Memory Block Length | See ble_user_mem_block_t::len |
0...'User Memory Block Length' bytes | User Memory Block | See ble_user_mem_block_t::p_mem |
The fields 'User Memory Block Length' and 'User Memory Block' are conditional based on the 'Authorization Type' and 'Write Operation' fields and if the context corresponding to a given connection handle was found.
Frame format encoding of the BLE_GATTS_EVT_SYS_ATTR_MISSING packet.
Event ID = 0x52 for BLE_GATTS_EVT_SYS_ATTR_MISSING
All BLE events, ble_evt_t, are encoded with the header ble_evt_hdr_t first, containing only the Event ID followed by the event. The Event Length will not be encoded, because the size of the event could differ depending on the decoder architecture.
The BLE GATTS event contains a connection handle. For the BLE GATTS System Attributes Missing event, the ble_gatts_evt_sys_attr_missing_t is encoded after the connection handle, as seen in Figure 1.
The order of the encoding is:
Length | Parameter | Value |
---|---|---|
2 bytes | Connection Handle | See ble_gatts_evt_t::conn_handle |
1 byte | Hint | See ble_gatts_evt_sys_attr_missing_t::hint |
Frame format encoding of the BLE_GATTS_EVT_HVC packet.
Event ID = 0x53 for BLE_GATTS_EVT_HVC
All BLE events, ble_evt_t, are encoded with the header ble_evt_hdr_t first, containing only the Event ID followed by the event. The Event Length will not be encoded, because the size of the event could differ depending on the decoder architecture.
The BLE GATTS event contains a connection handle. For the BLE GATTS HVC event, the ble_gatts_evt_hvc_t is encoded after the connection handle, as seen in Figure 1.
The order of the encoding is:
Length | Parameter | Value |
---|---|---|
2 bytes | Connection Handle | See ble_gatts_evt_t::conn_handle |
2 bytes | Attribute Handle | See ble_gatts_evt_hvc_t::handle |
Frame format encoding of the BLE_GATTS_EVT_SC_CONFIRM packet.
Event ID = 0x54 for BLE_GATTS_EVT_SC_CONFIRM
All BLE events, ble_evt_t, are encoded with the header ble_evt_hdr_t first, containing only the Event ID followed by the event. The Event Length will not be encoded, because the size of the event could differ depending on the decoder architecture.
The BLE_GATTS_EVT_SC_CONFIRM event is encoded in the following order (also presented in Figure 1):
Length | Parameter | Value |
---|---|---|
2 bytes | Connection Handle | See ble_gatts_evt_t::conn_handle |
Frame format encoding of the BLE_GATTS_EVT_TIMEOUT packet.
Event ID = 0x55 for BLE_GATTS_EVT_TIMEOUT
All BLE events, ble_evt_t, are encoded with the header ble_evt_hdr_t first, containing only the Event ID followed by the event. The Event Length will not be encoded, because the size of the event could differ depending on the decoder architecture.
The BLE GATTS event contains a connection handle. For the BLE GATTS Timeout event, the ble_gatts_evt_timeout_t is encoded after the connection handle, as seen in Figure 1.
The order of the encoding is:
Length | Parameter | Value |
---|---|---|
2 bytes | Connection Handle | See ble_gatts_evt_t::conn_handle |
1 byte | Timeout Source | See ble_gatts_evt_timeout_t::src |