nRF51 SDK - S120 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
BLE S120 Events

0x01 - BLE_EVT_TX_COMPLETE

Event encoding

Frame format encoding of the BLE_EVT_TX_COMPLETE packet.

Event ID = 0x01 for BLE_EVT_TX_COMPLETE

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 event contains a connection handle. For the BLE TX complete, the ble_evt_tx_complete_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_common_evt_t::conn_handle
1 byte Count See ble_evt_tx_complete_t


Packet layout

event_tx_complete.png
Figure 1: Encoding of BLE_EVT_TX_COMPLETE event.


0x02 - BLE_EVT_USER_MEM_REQUEST

Event encoding

Frame format encoding of the BLE_EVT_USER_MEM_REQUEST packet.

Event ID = 0x02 for BLE_EVT_USER_MEM_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, because the size of the event could differ depending on the decoder architecture.

The event contains a connection handle. For the BLE USER MEM request, the ble_evt_user_mem_request_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_common_evt_t::conn_handle
1 byte Type User Memory Type, see ble_evt_user_mem_request_t::type


Packet layout

event_user_mem_request.png
Figure 1: Encoding of BLE_EVT_USER_MEM_REQUEST event.


0x03 - BLE_EVT_USER_MEM_RELEASE

Event encoding

Frame format encoding of the BLE_EVT_USER_MEM_RELEASE packet.

Event ID = 0x03 for BLE_EVT_USER_MEM_RELEASE

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 event contains a connection handle. For the BLE USER MEM release, the ble_evt_user_mem_release_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_common_evt_t::conn_handle
1 byte Type User Memory Type, see ble_evt_user_mem_release_t::type
2 bytes Length User Memory Block Length, see ble_user_mem_block_t::len
1 byte Memory Block Present0x00 - not present, 0x01 - present


Packet layout

event_user_mem_release.png
Figure 1: Encoding of BLE_EVT_USER_MEM_RELEASE event.


Note
When BLE_EVT_USER_MEM_RELEASE is received from the SoftDevice, the User Memory Context is no longer needed. It is released using the app_ble_user_mem_context_destroy and conn_ble_user_mem_context_destroy functions.