nRF51 SDK - S120 SoftDevice
|
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) |
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 |
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) |
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 |
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) |
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 |
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) |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |