Synchronization#
Synchronization.
Modules |
---|
Indicates that a periodic advertising synchronization has been opened. |
Reports a received periodic advertisement packet. |
Indicates that periodic advertising synchronization was lost or a synchronization establishment procedure was canceled. |
Enumerations | |
---|---|
enum | sl_bt_sync_advertiser_clock_accuracy_t { sl_bt_sync_clock_accuracy_500 = 0x1f4, sl_bt_sync_clock_accuracy_250 = 0xfa,sl_bt_sync_clock_accuracy_150 = 0x96,sl_bt_sync_clock_accuracy_100 = 0x64,sl_bt_sync_clock_accuracy_75 = 0x4b,sl_bt_sync_clock_accuracy_50 = 0x32,sl_bt_sync_clock_accuracy_30 = 0x1e,sl_bt_sync_clock_accuracy_20 = 0x14} |
Advertiser Clock Accuracy. |
Functions | |
---|---|
sl_status_t | sl_bt_sync_set_parameters (uint16_t skip, uint16_t timeout, uint32_t flags) |
sl_status_t | sl_bt_sync_open (bd_addr address, uint8_t address_type, uint8_t adv_sid, uint16_t *sync) |
sl_status_t | sl_bt_sync_close (uint16_t sync) |
Detailed Description#
Synchronization.
Provides periodic advertising synchronization feature.
Data Structure Documentation#
sl_bt_sync_advertiser_clock_accuracy_t#
Advertiser Clock Accuracy.
Enumerator | |
---|---|
sl_bt_sync_clock_accuracy_500 | (0x1f4) Clock accuracy 500 ppm |
sl_bt_sync_clock_accuracy_250 | (0xfa) Clock accuracy 250 ppm |
sl_bt_sync_clock_accuracy_150 | (0x96) Clock accuracy 150 ppm |
sl_bt_sync_clock_accuracy_100 | (0x64) Clock accuracy 100 ppm |
sl_bt_sync_clock_accuracy_75 | (0x4b) Clock accuracy 75 ppm |
sl_bt_sync_clock_accuracy_50 | (0x32) Clock accuracy 50 ppm |
sl_bt_sync_clock_accuracy_30 | (0x1e) Clock accuracy 30 ppm |
sl_bt_sync_clock_accuracy_20 | (0x14) Clock accuracy 20 ppm |
Function Documentation#
sl_bt_sync_set_parameters()#
sl_status_t sl_bt_sync_set_parameters | ( | uint16_t |
|
uint16_t |
| ||
uint32_t |
| ||
) |
Configure periodic advertiser synchronization parameters. The specified parameters take effect immediately for all advertisers that have not already established synchronization.
The application should determine skip and timeout values based on the periodic advertising interval provided by the advertiser. If skip
and timeout
are used, select appropriate values so that they allow a few receiving attempts. Periodic advertising intervals are reported in event sl_bt_evt_scanner_scan_report.
Parameters
[in] |
| The maximum number of periodic advertising packets that can be skipped after a successful receive
|
[in] |
| The maximum permitted time between successful receives. If this time is exceeded, synchronization is lost. Unit: 10 ms
|
[in] |
| No flags defined currently |
Returns
SL_STATUS_OK if successful. Error code otherwise.
sl_bt_sync_open()#
sl_status_t sl_bt_sync_open | ( |
| |
uint8_t |
| ||
uint8_t |
| ||
uint16_t * |
| ||
) |
Start establishing synchronization with the specified periodic advertiser in parallel with other advertisers given in previous invocations of this command. The stack will internally enable scanning when needed so that synchronizations can occur. The scanning responses from the internal scanning are not passed to the application unless the application has also enabled scanning.
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.
Parameters
[in] |
| Address of the advertiser |
[in] |
| Advertiser address type. Values:
|
[in] |
| Advertising set identifier |
[out] |
| 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. |
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
sl_bt_evt_sync_opened - Triggered after the synchronization is established.
sl_bt_evt_sync_data - Indicates that a periodic advertisement packet is received.
sl_bt_evt_sync_closed - Triggered after periodic advertising synchronization was lost or explicitly closed, or a synchronization establishment procedure was canceled.
sl_bt_sync_close()#
sl_status_t sl_bt_sync_close ( uint16_t
sync
)
Closes a periodic advertising synchronization or cancels an ongoing attempt of establishing a synchronization.
Parameters
[in] |
| Periodic advertising synchronization handle |
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
sl_bt_evt_sync_closed - Triggered after a periodic advertising synchronization has been closed or canceled.