Connection Analyzer#
Connection Analyzer.
Analyze Bluetooth packets that are transmitted on the connections of external devices. Include component bluetooth_feature_connection_analyzer to use the commands and events in this class.
Modules#
Connection Analyzer Configuration flags
sl_bt_evt_connection_analyzer_report
sl_bt_evt_connection_analyzer_completed
Functions#
Macros#
Function Documentation#
sl_bt_connection_analyzer_start#
sl_status_t sl_bt_connection_analyzer_start (uint32_t access_address, uint32_t crc_init, uint16_t interval, uint16_t supervision_timeout, uint8_t central_clock_accuracy, uint8_t central_phy, uint8_t peripheral_phy, uint8_t channel_selection_algorithm, uint8_t hop, const sl_bt_connection_channel_map_t * channel_map, uint8_t channel, uint16_t event_counter, int32_t start_time_us, uint32_t flags, uint8_t * analyzer)
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint32_t | [in] | access_address | Access address of the connection |
| uint32_t | [in] | crc_init | The CRC initialization value |
| uint16_t | [in] | interval | The connection interval. Time = Value x 1.25 ms |
| uint16_t | [in] | supervision_timeout | The connection supervision time. Time = Value x 10 ms |
| uint8_t | [in] | central_clock_accuracy | The central device's clock accuracy index value |
| uint8_t | [in] | central_phy | Enum sl_bt_gap_phy_t. The PHY that the Central device is transmitting on. Values:
|
| uint8_t | [in] | peripheral_phy | Enum sl_bt_gap_phy_t. The PHY that the Peripheral device is transmitting on. Values:
|
| uint8_t | [in] | channel_selection_algorithm | Enum sl_bt_gap_channel_selection_algorithm_t. The channel selection algorithm. Values:
|
| uint8_t | [in] | hop | The hop increment when the channel selection algorithm #1 is used on the connection. Ignored if |
| const sl_bt_connection_channel_map_t * | [in] | channel_map | 5 byte bit field in little endian format. Only the first 37 bits are used. Bit 0 of the first byte is channel 0, bit 0 of the second byte is channel 8, etc. Ignore bits 37-39 that are reserved for future use. A channel is unused when its bit is 0. A channel is used when its bit is 1. |
| uint8_t | [in] | channel | The data channel number that transmissions will use in the next connection event |
| uint16_t | [in] | event_counter | The event counter of the next connection event |
| int32_t | [in] | start_time_us | The start time of the given connection event in microseconds. The semantics depend on whether the configuration flag SL_BT_CONNECTION_ANALYZER_RELATIVE_TIME is set in parameter
|
| uint32_t | [in] | flags | Configuration flags. This value is a bitmask of Connection Analyzer Configuration flags. |
| uint8_t * | [out] | analyzer | A handle that is assigned to the connection analyzer. This handle is valid only if the result code of this command is SL_STATUS_OK. |
Start to analyze another device's connection and report the RSSI measurements. The parameters in this command provide necessary information to identify the connection and schedule operations to follow its transmissions.
The analyzer generates a report at every connection interval. When a central or peripheral packet could not be observed, the RSSI for the role is reported as unavailable (127).
If the other device uses Silabs' Bluetooth stack, the information of the connection could be retrieved with command sl_bt_connection_get_scheduling_details. The method of passing the information to this device is application layer logic.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
sl_bt_evt_connection_analyzer_report - Triggered at every connection interval.
sl_bt_evt_connection_analyzer_completed - Triggered when analyzing a connection is completed in the Link Layer for some reason.
sl_bt_connection_analyzer_process_llcp_event#
sl_status_t sl_bt_connection_analyzer_process_llcp_event (uint8_t analyzer, size_t llcp_event_info_len, const uint8_t * llcp_event_info)
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint8_t | [in] | analyzer | The handle of the connection analyzer for the connection that had the LLCP event |
| size_t | [in] | llcp_event_info_len | Length of data in |
| const uint8_t * | [in] | llcp_event_info | The LLCP event information provided by the Central device for the connection being analyzed |
Process a Link Layer Control Protocol (LLCP) event from the Central device.
To maintain synchronization to the connection, an active connection analyzer needs to be informed of Link Layer Control Protocol (LLCP) events that impact the parameters of the connection. If the other device uses Silabs' Bluetooth stack, use the sl_bt_linklayer_event_info_reporting_enable command on the Central device to enable event information reporting for channel map and connection parameter updates triggered by the LLCP procedure on the connection being analyzed. See the documentation of the vendor-specific HCI command HCI_VS_Siliconlabs_Event_Info_Reporting_Enable for detailed documentation of the link layer feature.
When the event info reporting is enabled, the required LLCP event information is available in the event_info portion of the data provided in the sl_bt_evt_linklayer_event_info_report event. When the application receives the event on the Central device, pass the event_info to this device that is analyzing the connection. The method of passing the information to this device is application layer logic.
Returns
SL_STATUS_OK if successful. Error code otherwise.
sl_bt_connection_analyzer_stop#
sl_status_t sl_bt_connection_analyzer_stop (uint8_t analyzer)
| Type | Direction | Argument Name | Description |
|---|---|---|---|
| uint8_t | [in] | analyzer | The handle of the connection analyzer to stop |
Stop analyzing another device's Bluetooth connection. The operation is stopped when this command returns, and the stack does not send additional event.
Returns
SL_STATUS_OK if successful. Error code otherwise.