nRF51 SDK
|
Frame format encoding of the BLE_GAP_EVT_CONNECTED packet.
Event ID = 0x10 for BLE_GAP_EVT_CONNECTED.
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 GAP Connected event, the ble_gap_evt_connected_t is encoded after connection handle as seen in Figure 1.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 7 bytes: | ble_gap_addr_t | Peer Address (See Figure 3 for details on encoding) |
- 7 bits: | IRK Index | |
- 1 bit: | IRK Match | |
IRK Match & Index are encoded together in 1 byte. | ||
- 8 bytes: | ble_gap_conn_params_t : | GAP Connection Parameters (See Figure 4 for details on encoding) |
Frame format encoding of the BLE_GAP_EVT_DISCONNECTED packet.
Event ID = 0x11 for BLE_GAP_EVT_DISCONNECTED.
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 GAP Disconnected event, the ble_gap_evt_disconnected_t is encoded after connection handle as seen in Figure 1.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 1 byte: | Reason, BLE_HCI_STATUS_CODES |
Frame format encoding of the BLE_GAP_EVT_TIMEOUT packet.
Event ID = 0x19 for BLE_GAP_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 GAP event contains a connection handle, and for the BLE GAP Timeout event, the ble_gap_evt_timeout_t is encoded after connection handle as seen in Figure 1.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 1 byte : | Timeout Source, BLE_GAP_TIMEOUT_SOURCES |
Frame format encoding of the BLE_GAP_EVT_CONN_PARAM_UPDATE packet.
Event ID = 0x12 for BLE_GAP_EVT_CONN_PARAM_UPDATE
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 GAP Connect Parameter Update event, the ble_gap_evt_conn_param_update_t is encoded after connection handle as seen in Figure 1.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 8 bytes: | ble_gap_conn_params_t | GAP Connection Parameters (See Figure 1 for details on encoding) |
Frame format encoding of the BLE_GAP_EVT_SEC_PARAMS_REQUEST packet.
Event ID = 0x13 for BLE_GAP_EVT_SEC_PARAMS_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 GAP Security Parameters Request event, the ble_gap_evt_sec_params_request_t is encoded after connection handle as seen in Figure 1.
The Bond, MITM, IO Capabilities and OOB fields are all bitfields inside 1 byte as seen in Figure 2.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 2 bytes: | Timeout | |
- 1 byte: | (See Figure 2) | |
- 1 bit: | Bond | |
- 1 bit: | MITM | |
- 3 bits: | IO Capabilities | |
- 1 bit: | OOB | |
- 1 byte: | Minimum keysize | |
- 1 byte: | Maximum keysize |
Frame format encoding of the BLE_GAP_EVT_SEC_INFO_REQUEST packet.
Event ID = 0x14 for BLE_GAP_EVT_SEC_PARAMS_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 GAP Security Info Request event, the ble_gap_evt_sec_info_request_t is encoded after connection handle as seen in Figure 1.
The "Encryption info present", "Identity info present", and "Signing info present" flags are all bitfields inside 1 byte as seen in Figure 2.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 1 byte: | Address Type | |
- 6 bytes: | Address | |
- 2 bytes: | Encryption Diversifier | |
- 1 byte: | (See Figure 2) | |
- 1 bit: | Encryption info | |
- 1 bit: | Identity info | |
- 1 bit: | Signing info |
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:
- 2 bytes: | Connection Handle | |
- 1 byte: | Hint |
Frame format encoding of the BLE_GAP_EVT_CONN_SEC_UPDATE packet.
Event ID = 0x18 for BLE_GAP_EVT_CONN_SEC_UPDATE
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 GAP Security Info Request event, the ble_gap_evt_conn_sec_update_t is encoded after connection handle as seen in Figure 1.
The security mode and level are both bitfields inside 1 byte as seen in Figure 2.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 1 byte: | (See Figure 2) | |
- 4 bits: | Security mode (sm) | |
- 4 bits: | Level (lv) | |
- 1 byte: | Encryption key size |
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:
- 2 bytes: | Connection Handle | |
- 2 bytes: | Attribute Handle | |
- 1 byte: | Write Operation | |
- 2 bytes: | Service UUID | |
- 1 byte: | Service UUID Type | |
- 2 bytes: | Char UUID | |
- 1 byte: | Char UUID Type | |
- 2 bytes: | Desc UUID | |
- 1 byte: | Desc UUID Type | |
- 2 bytes: | Service Handle | |
- 2 bytes: | Value Handle | |
- 1 byte: | Attribute Type | |
- 2 bytes: | Offset | |
- 2 bytes: | Data Length | |
- 0...'Data Length' bytes: | Data |
Frame format encoding of the BLE_GAP_EVT_AUTH_STATUS packet.
Event ID = 0x17 for BLE_GAP_EVT_AUTH_STATUS
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 GAP Authentication Status event, the ble_evt_gap_auth_status_t is encoded after connection handle as seen in Figure 1.
The security mode levels 1 and 2 are both bitfields inside 1 byte as seen in Figure 1. The same goes for The long term authentication and length.
The order of the encoding is:
- 2 bytes: | Connection Handle | |
- 1 byte | Authentication Status | |
- 1 byte: | Error Source | |
- 1 byte: | Security Mode levels | |
- 3 bits: | sm2 | |
- 3 bits: | sm1 | |
- 1 bytes | Peripheral Key Exchange | |
- 1 bytes | Central Key Exchange | |
- 2 bytes | Encryption Diversifier | |
- 16 bytes | Long Term Key | |
- 1 byte | Long Term Key Length and Auth | |
- 1 bit: | Authentication | |
- 5 bits: | Length | |
- 16 bytes | Identify Resolution Key | |
- 1 bytes | Address Type | |
- 6 bytes | Address (LSB) |