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