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

0x30 - BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP packet.

Event ID = 0x30 for BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Primary Service Discovery Response event, the ble_gattc_evt_prim_srvc_disc_rsp_t is encoded after the GATTC Event header as seen in Figure 1 and 2.

The order of the encoding is:

Length Parameter Value
2 bytes Connection Handle see ble_gattc_evt_t::conn_handle
2 bytes GATT Status see ble_gattc_evt_t::gatt_status
2 bytes Error Handle see ble_gattc_evt_t::error_handle
2 bytes Service Count see ble_gattc_evt_prim_srvc_disc_rsp_t::count
0 .. n byte(s) Service Data see ble_gattc_evt_prim_srvc_disc_rsp_t::services (Encoding details can be seen in Figure 2)


Encoding of BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP event

event_gattc_evt_prim_srvc_disc_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP event.


Encoding of Service Data

Service Count field defines number of services in the Service Data. Each ble_gattc_service_t from the Service Data is encoded in the following order:

Length Parameter Value
2 bytes Service UUID see ble_uuid_t::uuid
1 byte Service UUID Type see ble_uuid_t::type
2 bytes Service Start Handle see ble_gattc_handle_range_t::start_handle
2 bytes Service End Handle see ble_gattc_handle_range_t::end_handle


event_gattc_evt_prim_srvc_disc_rsp_service_data.png
Figure 2: Encoding of Service data.


0x31 - BLE_GATTC_EVT_REL_DISC_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_REL_DISC_RSP packet.

Event ID = 0x31 for BLE_GATTC_EVT_REL_DISC_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Read multiple Response event, the ble_gattc_evt_rel_disc_rsp_t is encoded after the GATTC Event header as seen in Figure 1.

The order of the encoding is:

Length Parameter Value
2 byte Connection Handle see ble_gattc_evt_t::conn_handle
2 byte GATT Status see ble_gattc_evt_t::error_handle
2 byte Error Handle see ble_gattc_evt_t::gatt_status
2 byte Include Count see ble_gattc_evt_rel_disc_rsp_t::count
0..n byte(s) Include Data, variable length see ble_gattc_evt_rel_disc_rsp_t::includes (Encoding details can be seen in Figure 2)


Encoding of BLE_GATTC_EVT_REL_DISC_RSP event

event_gattc_evt_rel_disc_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_REL_DISC_RSP event.


Encoding of Include Data

Include Count field defines number of includes in the Include Data. Each ble_gattc_include_t from the Include Data is encoded in the following order:

Length Parameter Value
2 bytes Include Handle see ble_gattc_include_t::handle
2 bytes Included Service UUID see ble_uuid_t::uuid
1 byte Included Service UUID Type see ble_uuid_t::type
2 bytes Included Service Start Handle see ble_gattc_handle_range_t::start_handle
2 bytes Included Service End Handle see ble_gattc_handle_range_t::end_handle


event_gattc_evt_rel_disc_rsp_include_data.png
Figure 2: Encoding of Include.


0x32 - BLE_GATTC_EVT_CHAR_DISC_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_CHAR_DISC_RSP packet.

Event ID = 0x32 for BLE_GATTC_EVT_CHAR_DISC_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Characteristics Discovery Response event, the ble_gattc_evt_char_disc_rsp_t is encoded after the GATTC Event header as seen in Figure 1 and 2.

The order of the encoding is:

Length Parameter Value
2 bytes Connection Handle see ble_gattc_evt_t::conn_handle
2 bytes GATT Status see ble_gattc_evt_t::gatt_status
2 bytes Error Handle see ble_gattc_evt_t::error_handle
2 bytes Characteristic count see ble_gattc_evt_char_disc_rsp_t::count
0..n byte(s) Characteristic Data, variable length see ble_gattc_evt_char_disc_rsp_t::chars (Encoding details can be seen in Figure 2)


Encoding of BLE_GATTC_EVT_CHAR_DISC_RSP event

event_gattc_evt_char_disc_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_CHAR_DISC_RSP event.


Characteristic Count field defines number of characteristics in the Characteristic Data. Each ble_gattc_char_t from the Characteristic Data is encoded in the following order:

Length Parameter Value
2 bytes Characteristic UUID see ble_uuid_t::uuid
1 byte Characteristic UUID Type see ble_uuid_t::type
1 byte Characteristic Properties (bitfields) see ble_gattc_char_t::char_props (Encoding order of the bitfields is shown in the table below)
1 byte Characteristic Extended Properties Present (bitfield)see ble_gattc_char_t::char_ext_props (Encoding order of the bitfields is shown in the table below)
2 bytes Characteristic Declaration Handle see ble_gattc_char_t::handle_decl
2 bytes Characteristic Value Handle see ble_gattc_char_t::handle_value


Characteristic Properties bitfields are encoded in a single byte in the following order:

Bit number Field name Value
bit 0 Broadcast see ble_gatt_char_props_t::broadcast
bit 1 Read see ble_gatt_char_props_t::read
bit 2 Write wo resp see ble_gatt_char_props_t::write_wo_resp
bit 3 Write see ble_gatt_char_props_t::write
bit 4 Notify see ble_gatt_char_props_t::notify
bit 5 Indicate see ble_gatt_char_props_t::indicate
bit 6 Auth signed write see ble_gatt_char_props_t::auth_signed_wr
bit 7 Not used


Characteristic Extended Properties Present bitfields are encoded in a single byte in the following order:

Bit number Field name Value
bit 0 Extended properties present See ble_gattc_char_t::char_ext_props
bits 1-7 Not used


Encoding of Characteristic data

event_gattc_evt_char_disc_rsp_char_data.png
Figure 2: Encoding of Service data.


0x33 - BLE_GATTC_EVT_DESC_DISC_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_DESC_DISC_RSP packet.

Event ID = 0x33 for BLE_GATTC_EVT_DESC_DISC_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Descriptor Discovery Response event, the ble_gattc_evt_desc_disc_rsp_t is encoded after the GATTC Event header as seen in Figure 1 and 2.

The order of the encoding is:

Length Parameter Value
2 bytes Connection Handle see ble_gattc_evt_t::conn_handle
2 bytes GATT Status see ble_gattc_evt_t::gatt_status
2 bytes Error Handle see ble_gattc_evt_t::error_handle
2 bytes Descriptor count see ble_gattc_evt_desc_disc_rsp_t::count
0..n byte(s) Descriptor Data, variable length see ble_gattc_evt_desc_disc_rsp_t::descs (Encoding details can be seen in Figure 2)


Encoding of BLE_GATTC_EVT_DESC_DISC_RSP event

event_gattc_evt_desc_disc_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_DESC_DISC_RSP event.


Encoding of Descriptor data

Descriptor Count field defines number of descriptors in the Descriptor Data. Each ble_gattc_desc_t from the Descriptor Data is encoded in the following order:

Length Parameter Value
2 bytes Descriptor Handle see ble_gattc_desc_t::handle
2 bytes Descriptor UUID see ble_uuid_t::uuid
1 byte Descriptor UUID Type see ble_uuid_t::type
event_gattc_evt_desc_disc_rsp_desc_data.png
Figure 2: Encoding of Descriptor data.


0x34 - BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP packet.

Event ID = 0x34 for BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Read multiple Response event, the ble_gattc_evt_char_val_by_uuid_read_rsp_t is encoded after the GATTC Event header as seen in Figure 1.

The order of the encoding is:

Length Parameter Value
2 byte Connection Handle see ble_gattc_evt_t::conn_handle
2 byte GATT Status see ble_gattc_evt_t::gatt_status
2 byte Error Handle see ble_gattc_evt_t::error_handle
2 byte Number of Handle-Value pair see ble_gattc_evt_char_val_by_uuid_read_rsp_t::count
2 byte Length of Value pair see ble_gattc_evt_char_val_by_uuid_read_rsp_t::value_len
0..n byte(s) Handle-Value pairs see ble_gattc_handle_value_t


Encoding of BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event

event_gattc_evt_char_val_by_uuid_read_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_CHAR_VAL_BY_UUID_READ_RSP event.


ble_gattc_handle_value_t is encoded in the following order (also shown on Figure 2):

Length Parameter Value
2 byte Handle see ble_gattc_handle_value_t::handle
0..byte(s) Value see ble_gattc_handle_value_t::p_value


ble_gattc_handle_value.png
Figure 2: Encoding of ble_gattc_handle_value_t


0x35 - BLE_GATTC_EVT_READ_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_READ_RSP packet.

Event ID = 0x35 for BLE_GATTC_EVT_READ_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Read Response event, the ble_gattc_evt_read_rsp_t is encoded after the GATTC Event header as seen in Figure 1.

The order of the encoding is:

Length Parameter Value
2 bytes Connection Handle see ble_gattc_evt_t::conn_handle
2 bytes GATT Status see ble_gattc_evt_t::gatt_status
2 bytes Error Handle see ble_gattc_evt_t::error_handle
2 bytes Attribute Handle see ble_gattc_evt_read_rsp_t::handle
2 bytes Attribute Offset see ble_gattc_evt_read_rsp_t::offset
2 bytes Attribute Data Length see ble_gattc_evt_read_rsp_t::len
0..n byte(s) Attribute Data, variable length see ble_gattc_evt_read_rsp_t::data


Encoding of BLE_GATTC_EVT_READ_RSP event

event_gattc_evt_read_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_READ_RSP event.


0x36 - BLE_GATTC_EVT_CHAR_VALS_READ_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_CHAR_VALS_READ_RSP packet.

Event ID = 0x36 for BLE_GATTC_EVT_CHAR_VALS_READ_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Read multiple Response event, the ble_gattc_evt_char_vals_read_rsp_t is encoded after the GATTC Event header as seen in Figure 1.

The order of the encoding is:

Length Parameter Value
2 byte Connection Handle see ble_gattc_evt_t::conn_handle
2 byte GATT Status see ble_gattc_evt_t::gatt_status
2 byte Error Handle see ble_gattc_evt_t::error_handle
2 byte Concatenated Attribute Values Length see ble_gattc_evt_char_vals_read_rsp_t::len
0..n byte(s) Attribute Values see ble_gattc_evt_char_vals_read_rsp_t::values


Encoding of BLE_GATTC_EVT_CHAR_VALS_READ_RSP event

event_gattc_evt_char_vals_read_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_CHAR_VALS_READ_RSP event.


0x37 - BLE_GATTC_EVT_WRITE_RSP

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_WRITE_RSP packet.

Event ID = 0x37 for BLE_GATTC_EVT_WRITE_RSP

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC Write Response event, the ble_gattc_evt_write_rsp_t is encoded after the GATTC Event header as seen in Figure 1.

The order of the encoding is:

Length Parameter Value
2 bytes Connection Handle ee ble_gattc_evt_t::conn_handle
2 bytes GATT Status see ble_gattc_evt_t::gatt_status
2 bytes Error Handle see ble_gattc_evt_t::error_handle
2 bytes Attribute Handle see ble_gattc_evt_write_rsp_t::handle
2 bytes Write Operation see ble_gattc_evt_write_rsp_t::write_op
2 bytes Attribute Offset see ble_gattc_evt_write_rsp_t::offset
2 bytes Attribute Data Length see ble_gattc_evt_write_rsp_t::len
0..n byte(s) Attribute Data, variable length see ble_gattc_evt_write_rsp_t::data


Encoding of BLE_GATTC_EVT_WRITE_RSP event

event_gattc_evt_write_rsp.png
Figure 1: Encoding of BLE_GATTC_EVT_WRITE_RSP event.


0x38 - BLE_GATTC_EVT_HVX

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_HVX packet.

Event ID = 0x38 for BLE_GATTC_EVT_HVX

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 GATTC event contains a GATTC Event header (connection handle, GATT Status and error handle) and for the BLE GATTC HVX event, the ble_gattc_evt_hvx_t is encoded after the GATTC Event header as seen in Figure 1.

The order of the encoding is:

Length Parameter Value
2 bytes Connection Handle see ble_gattc_evt_t::conn_handle
2 bytes GATT Status see ble_gattc_evt_t::gatt_status
2 bytes Error Handle see ble_gattc_evt_t::error_handle
2 bytes Attribute Handle see ble_gattc_evt_hvx_t::handle
1 byte Type (Indication or Notification)see ble_gattc_evt_hvx_t::type
2 bytes Attribute Data Length see ble_gattc_evt_hvx_t::len
0..n byte(s) Attribute Data, variable length see ble_gattc_evt_hvx_t::data


Encoding of BLE_GATTC_EVT_HVX event

event_gattc_evt_hvx.png
Figure 1: Encoding of BLE_GATTC_EVT_HVX event.


0x39 - BLE_GATTC_EVT_TIMEOUT

Event packet encoding

Frame format encoding of the BLE_GATTC_EVT_TIMEOUT packet.

Event ID = 0x39 for BLE_GATTC_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 GATTC event contains a connection handle, and for the BLE GATTC Timeout event, the ble_gattc_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_gattc_evt_t::conn_handle
1 byte Timeout Source see ble_gattc_evt_timeout_t::src


Encoding of BLE GATTC Timeout event

gattc_event_timeout.png
Figure 1: Encoding of BLE GATTC Timeout event.