Periodic Advertising Sync Scanner#
Periodic Advertising Sync Scanner.
Synchronize to periodic advertising trains by scanning for extended advertisements that provide the synchronization information.
Functions#
Macros#
Function Documentation#
sl_bt_sync_scanner_set_sync_parameters#
sl_status_t sl_bt_sync_scanner_set_sync_parameters (uint16_t skip, uint16_t timeout, uint8_t reporting_mode)
[in] | skip | The maximum number of periodic advertising packets that can be skipped after a successful receive.
|
[in] | timeout | The maximum permitted time between successful receives. If this time is exceeded, synchronization is lost. Unit: 10 ms.
|
[in] | reporting_mode | Enum sl_bt_sync_reporting_mode_t. Specifies the initial mode for reporting data received in the periodic advertising train after it has achieved synchronization. Values:
Default: sl_bt_sync_report_all (Data received in periodic advertising trains is reported to the application) |
Configure synchronization parameters for synchronizing to periodic advertising trains. The specified parameters take effect immediately for all periodic advertising trains that have not already established synchronization.
The application should determine skip and timeout values based on the periodic advertising interval provided by the advertiser. Ensure that you use a long enough timeout to allow multiple receives. If skip
and timeout
are used, select appropriate values so that they allow a few receiving attempts. Periodic advertising intervals are reported in sl_bt_evt_scanner_scan_report or sl_bt_evt_scanner_extended_advertisement_report event.
Returns
SL_STATUS_OK if successful. Error code otherwise.
5000
of file /mnt/raid/workspaces/ws.vHmYkJajL/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_sync_scanner_open#
sl_status_t sl_bt_sync_scanner_open (bd_addr address, uint8_t address_type, uint8_t adv_sid, uint16_t * sync)
[in] | address | Address of the advertiser |
[in] | address_type | Enum sl_bt_gap_address_type_t. Advertiser address type. If the application does not include the bluetooth_feature_use_accurate_api_address_types component,
If the application includes the bluetooth_feature_use_accurate_api_address_types component,
|
[in] | adv_sid | Advertising set identifier |
[out] | sync | A handle that will be assigned to the periodic advertising synchronization after the synchronization is established. This handle is valid only if the result code of this response is SL_STATUS_OK. |
Start establishing synchronization with the specified periodic advertiser in parallel with other advertisers given in previous invocations of this command.
If the application has not already started scanning with the sl_bt_scanner_start command, the stack will internally enable scanning so that synchronizations can occur. The internal scanning uses the PHY that was most recently used with sl_bt_scanner_start and the parameters that have been configured with sl_bt_scanner_set_timing. The internal scanning is automatically stopped when all requested synchronizations have occurred.
The scanning responses from the internal scanning are not passed to the application unless the application starts scanning with the sl_bt_scanner_start command. If the application starts scanning while synchronizations are being established, the scanning PHY and settings set by the application take effect immediately and scanning for synchronizations continues with the new settings. When the application has started scanning with the sl_bt_scanner_start command, scanning continues until the application stops scanning with the sl_bt_scanner_stop command.
Advertisers that have not already synced before the invocation of this command will be synced using the skip
and timeout
values configured in the most recent invocation of command sl_bt_evt_scanner_scan_report.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
sl_bt_evt_periodic_sync_opened - Triggered after synchronization is established to a periodic advertising train that does not have subevents or response slots.
sl_bt_evt_pawr_sync_opened - Triggered after synchronization is established to a Periodic Advertising with Responses (PAwR) train.
sl_bt_evt_periodic_sync_report - Triggered when data for periodic advertising train that does not have subevents or response slots is received and accepted by the reporting mode currently set to the train.
sl_bt_evt_pawr_sync_subevent_report - Triggered when subevent data for Periodic Advertising with Responses (PAwR) train is received and accepted by the reporting mode currently set to the train.
sl_bt_evt_sync_closed - Triggered after periodic advertising synchronization was lost or explicitly closed, or a synchronization establishment procedure was canceled.
5080
of file /mnt/raid/workspaces/ws.vHmYkJajL/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
Macro Definition Documentation#
sl_bt_cmd_sync_scanner_set_sync_parameters_id#
#define sl_bt_cmd_sync_scanner_set_sync_parameters_idValue:
0x00500020
4954
of file /mnt/raid/workspaces/ws.vHmYkJajL/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_cmd_sync_scanner_open_id#
#define sl_bt_cmd_sync_scanner_open_idValue:
0x01500020
4955
of file /mnt/raid/workspaces/ws.vHmYkJajL/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_rsp_sync_scanner_set_sync_parameters_id#
#define sl_bt_rsp_sync_scanner_set_sync_parameters_idValue:
0x00500020
4956
of file /mnt/raid/workspaces/ws.vHmYkJajL/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_rsp_sync_scanner_open_id#
#define sl_bt_rsp_sync_scanner_open_idValue:
0x01500020
4957
of file /mnt/raid/workspaces/ws.vHmYkJajL/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h