Bluetooth Low Energy Link Layer Metrics
A user application can enable link metrics counters through the following API:
uint8_t BLE_Link_Metrics(uint8_t en, uint8_t actidx, struct ble_link_metrics *metricsPtr)
In an application, this funciton can be brought in at any time by setting en to 0x1 and then calling the API. The API is disabled by calling it with en set to zero.
The user application also needs to set the activity index associated with the desired Bluetooth Low Energy link, and to provide a pointer to the area of memory where the Bluetooth Low Energy stack holds the counter values so that the application can read them at any time.
We recommend that the API be activated at link establishment when GAPC_CONNECTION_REQ_IND is received, and disabled at disconnection when
GAPC_DISCONNECT_IND is received.
BLE_Link_Metrics
uint8_t BLE_Link_Metrics(uint8_t en, uint8_t actidx, struct ble_link_metrics *metricsPtr)
Location: lld_con.c: 3643
This function enables/disables Bluetooth low energy metrics counters.
Returns:
Return value from this function indicates if the requested action (enable/disable) done successfully by the application.
|
Example code for BLE_Link_Metrics: BLE_Link_Metrics(1, activityIndex, &metricsPtr); |
Parameters:
|
Direction |
Name |
Description |
|
in |
en |
Enable value (1=enable, 0=disable) |
|
in |
actidx |
Bluetooth Low Energy link Activity identifier |
|
in |
metricsPtr |
Pointer to ble_link_metrics to hold counter values |
|
out |
Return value |
Return status and indicates if requested action (enable/disable) done successfully by the application
|