nRF51 SDK - S110 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
BLE S110 GATTS Events

0x50 - BLE_GATTS_EVT_WRITE

Event packet encoding

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 as the size of the event could be of different sizes depending on decoder architecture.

The BLE GAP event contains a connection handle, and for the BLE GATTS Write event, the ble_gatts_evt_write_t is encoded after 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


Encoding of GATTS Write event

event_gatts_write_packet.png
Figure 1: Encoding of GATTS Write event.


Encoding of Context

event_gatts_write_packet_context.png
Figure 2: Encoding of Context inside a GATTS Write event.


0x51 - BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST

Event packet encoding

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 as the size of the event could be of different sizes depending on decoder architecture.

The BLE GAP event contains a connection handle, and for the BLE GATTS RW Authorize Request event, the ble_gatts_evt_rw_authorize_request_t is encoded after connection handle as seen in Figure 1 and Figure 2.

Read authorization the order of the encoding 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


Write authorization the order of the encoding 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


Encoding of GATTS RW Authorize Request event - Read

gatts_event_rw_authorize_request_dec_read.png
Figure 1: Encoding of GATTS RW Authorize Request event.


Encoding of GATTS RW Authorize Request event - Write

gatts_event_rw_authorize_request_dec_write.png
Figure 2: Encoding of GATTS RW Authorize Request event.


Encoding of Attribute Context

event_gatts_write_packet_context.png
Figure 3: Encoding of Context inside a GATTS RW Authorize Request event.


0x52 - BLE_GATTS_EVT_SYS_ATTR_MISSING

Event packet encoding

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 as the size of the event could be of different sizes depending on decoder architecture.

The BLE GATTS event contains a connection handle, and for the BLE GATTS System Attributes Missing event, the ble_gatts_evt_sys_attr_missing_t is encoded after 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


Encoding of GATTS System Attributes Missing event

event_sys_attr_missing.png
Figure 1: Encoding of GATTS System Attributes Missing event.


0x53 - BLE_GATTS_EVT_HVC

Event packet encoding

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 as the size of the event could be of different sizes depending on decoder architecture.

The BLE GATTS event contains a connection handle, and for the BLE GATTS HVC event, the ble_gatts_evt_hvc_t is encoded after 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


Encoding of BLE GATTS HVC event

gatts_event_hvc.png
Figure 1: Encoding of BLE GATTS HVC event.


0x54 - BLE_GATTS_EVT_SC_CONFIRM

Event packet encoding

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 as the size of the event could be of different sizes depending on decoder architecture.

BLE_GATTS_EVT_SC_CONFIRM event is encoded in a following order (also presented in Figure 1):

Length Parameter Value
2 bytes Connection Handle see ble_gatts_evt_t::conn_handle


Encoding of BLE GATTS SC Confirm event

event_gatts_evt_sc_confirm.png
Figure 1: Encoding of BLE GATTS SC Confirm event.


0x55 - BLE_GATTS_EVT_TIMEOUT

Event packet encoding

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 as the size of the event could be of different sizes depending on decoder architecture.

The BLE GATTS event contains a connection handle, and for the BLE GATTS Timeout event, the ble_gatts_evt_timeout_t is encoded after 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


Encoding of BLE GATTS Timeout event

gatts_event_timeout.png
Figure 1: Encoding of BLE GATTS Timeout event.