nRF51 SDK: BLE S110 Events

| nRF51 SDK

- Home
- Related Pages
- API Reference
- Data Structures

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
BLE S110 Events

# 0x10 - BLE_GAP_EVT_CONNECTED

## Event packet encoding

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)

## Encoding of BLE GAP Event - Connected

Figure 1: Encoding of BLE GAP Connected event.

## Encoding of Peer Address

Figure 2: Encoding of peer address inside the BLE GAP Connected event.

## Encoding of IRK byte

Figure 3: Encoding of IRK byte inside BLE GAP Connected event.

## Encoding of GAP Connection Parameters

Figure 4: Encoding of GAP Connection Parameters inside the BLE GAP Connected event.

# 0x11 - BLE_GAP_EVT_DISCONNECTED

## Event packet 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

## Encoding of BLE GAP Disconnected event

Figure 1: Encoding of BLE GAP Disconnected event.

# 0x19 - BLE_GAP_EVT_TIMEOUT

## Event packet encoding

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

## Encoding of BLE GAP Timeout event

Figure 1: Encoding of BLE GAP Timeout event.

# 0x12 - BLE_GAP_EVT_CONN_PARAM_UPDATE

## Event packet encoding

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)

## Encoding of GAP Connection Parameter Update event

Figure 1: Encoding of GAP Connection Parameter Update event.

# 0x13 - BLE_GAP_EVT_SEC_PARAMS_REQUEST

## Event packet 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

## Encoding of GAP Security Parameters Request event

Figure 1: Encoding of GAP Security Parameters Request event.

## Encoding of Bond, MITM, IO Caps and OOB

Figure 2: Encoding of Bond, MITM, IO Caps and OOB inside a GAP Security Parameters Request event.

# 0x14 - BLE_GAP_EVT_SEC_INFO_REQUEST

## Event packet encoding

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

## Encoding of GAP Connection Security Updated event

Figure 1: Encoding of GAP Security Info Request event.

## Encoding of Security mode and Level

Figure 2: Encoding of Encryption info, Identity info, and Signing info inside a GAP Security Info Request event.

# 0x52 - BLE_GATTS_EVT_SYS_ATTR_MISSING

## Event packet encoding

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

## Encoding of GATTS System Attributes Missing event

Figure 1: Encoding of GATTS System Attributes Missing event.

# 0x18 - BLE_GAP_EVT_CONN_SEC_UPDATE

## Event packet encoding

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

## Encoding of GAP Connection Security Updated event

Figure 1: Encoding of GAP Connection Security Updated event.

## Encoding of Security mode and Level

Figure 2: Encoding of Security mode and Level inside a GAP Connection Security Updated event.

# 0x50 - BLE_GATTS_EVT_WRITE

## Event packet encoding

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

## Encoding of GATTS Write event

Figure 1: Encoding of GATTS Write event.

## Encoding of Context

Figure 2: Encoding of Context inside a GATTS Write event.

# 0x17 - BLE_GAP_EVT_AUTH_STATUS

## Event packet encoding

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)

## Encoding of GAP Connection Security Updated event

Figure 1: Encoding of GAP Authentication Status event.