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#

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)
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)
sl_status_t

Macros#

#define
sl_bt_cmd_connection_analyzer_start_id 0x00480020
#define
sl_bt_cmd_connection_analyzer_process_llcp_event_id 0x02480020
#define
sl_bt_cmd_connection_analyzer_stop_id 0x01480020
#define
sl_bt_rsp_connection_analyzer_start_id 0x00480020
#define
sl_bt_rsp_connection_analyzer_process_llcp_event_id 0x02480020
#define
sl_bt_rsp_connection_analyzer_stop_id 0x01480020

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)
Parameters
TypeDirectionArgument NameDescription
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:

  • sl_bt_gap_phy_1m (0x1): 1M PHY

  • sl_bt_gap_phy_2m (0x2): 2M PHY

  • sl_bt_gap_phy_coded (0x4): Coded PHY, 125k (S=8) or 500k (S=2)

uint8_t[in]peripheral_phy

Enum sl_bt_gap_phy_t. The PHY that the Peripheral device is transmitting on. Values:

  • sl_bt_gap_phy_1m (0x1): 1M PHY

  • sl_bt_gap_phy_2m (0x2): 2M PHY

  • sl_bt_gap_phy_coded (0x4): Coded PHY, 125k (S=8) or 500k (S=2)

uint8_t[in]channel_selection_algorithm

Enum sl_bt_gap_channel_selection_algorithm_t. The channel selection algorithm. Values:

  • sl_bt_gap_channel_selection_algorithm_1 (0x0): Channel selection algorithm #1

  • sl_bt_gap_channel_selection_algorithm_2 (0x1): Channel selection algorithm #2

uint8_t[in]hop

The hop increment when the channel selection algorithm #1 is used on the connection. Ignored if channel_selection_algorithm indicates that the connection uses channel selection algorithm #2.

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 flags:

  • When the flag is set, the value is a time relative to the current time. A negative value means that the start time was in the past.

  • When the flag is not set, the value is an absolute time converted from the PROTIMER tick.

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_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)
Parameters
TypeDirectionArgument NameDescription
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 llcp_event_info

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)
Parameters
TypeDirectionArgument NameDescription
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.