nRF51 SDK - S120 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
BLE S120 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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

The Service Count field defines the 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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

The Include Count field defines the 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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.


The Characteristic Count field defines the 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 Characteristic 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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

The Descriptor Count field defines the 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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 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_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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a GATTC Event header (connection handle, GATT status, and error handle). 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, because the size of the event could differ depending on the decoder architecture.

The BLE GATTC event contains a connection handle. For the BLE GATTC Timeout event, the ble_gattc_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_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.