Modules#

Periodic Advertising Configuration Flags

Periodic Advertiser#

Periodic Advertiser.

Provides support for advertising with periodic advertising trains that do not have subevents or response slots.

Functions#

sl_status_t
sl_bt_periodic_advertiser_set_data(uint8_t advertising_set, size_t data_len, const uint8_t *data)
sl_status_t
sl_status_t
sl_bt_periodic_advertiser_start(uint8_t advertising_set, uint16_t interval_min, uint16_t interval_max, uint32_t flags)
sl_status_t
sl_bt_periodic_advertiser_stop(uint8_t advertising_set)

Function Documentation#

sl_bt_periodic_advertiser_set_data#

sl_status_t sl_bt_periodic_advertiser_set_data (uint8_t advertising_set, size_t data_len, const uint8_t * data)
Parameters
[in]advertising_set

Advertising set handle

[in]data_len

Length of data in data

[in]data

Data to be set

Set the data for periodic advertising on an advertising set. Maximum 254 bytes of data can be set with this command. For setting longer advertising data, use command sl_bt_periodic_advertiser_set_long_data.

If the periodic advertising is currently enabled, the new advertising data will be used immediately. Periodic advertising can be enabled using the command sl_bt_periodic_advertiser_start.

The invalid parameter error will be returned if the data is too long to fit into the advertisement.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 3386 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_periodic_advertiser_set_long_data#

sl_status_t sl_bt_periodic_advertiser_set_long_data (uint8_t advertising_set)
Parameters
[in]advertising_set

Advertising set handle

Set data for periodic advertising on an advertising set. Data currently in the system data buffer will be extracted as the advertising data. The buffer will be emptied after this command regardless of the completion status.

Prior to calling this command, add data to the buffer with one or multiple calls to sl_bt_system_data_buffer_write.

Maximum 1650 bytes of data can be set for periodic advertising. Advertising parameters may limit the amount of data that can be sent.

See sl_bt_periodic_advertiser_set_data for more details.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 3409 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_periodic_advertiser_start#

sl_status_t sl_bt_periodic_advertiser_start (uint8_t advertising_set, uint16_t interval_min, uint16_t interval_max, uint32_t flags)
Parameters
[in]advertising_set

Advertising set handle

[in]interval_min

Minimum periodic advertising interval. Value in units of 1.25 ms

  • Range: 0x06 to 0xFFFF

  • Time range: 7.5 ms to 81.92 s

Default value: 100 ms

[in]interval_max

Maximum periodic advertising interval. Value in units of 1.25 ms

  • Range: 0x06 to 0xFFFF

  • Time range: 7.5 ms to 81.92 s

  • Note: interval_max should be bigger than interval_min

Default value: 200 ms

[in]flags

Additional periodic advertising options. Value: 0 or bitmask of Periodic Advertising Configuration Flags

Start periodic advertising on an advertising set.

According to the Bluetooth Core specification, periodic advertising PDUs cannot be transmitted until at least one extended advertising event has been completed. If the application needs exact control over the extended advertising data and parameters, use the Advertiser class to configure the parameters of the advertising set and the Extended Advertiser class to set or generate the desired extended advertising data payload. If the application does not configure the parameters or set the data, the default parameters and empty advertising data are used for the extended advertising.

If the application has not already started extended advertising and the flag SL_BT_PERIODIC_ADVERTISER_AUTO_START_EXTENDED_ADVERTISING is set in flags, the stack will automatically start extended advertising with the parameters and extended advertising data currently configured to the advertising set. The application may stop the automatically started extended advertising using the sl_bt_advertiser_stop command.

If the application has not already started extended advertising and the flag SL_BT_PERIODIC_ADVERTISER_AUTO_START_EXTENDED_ADVERTISING is not set in flags, the stack will momentarily start extended advertising with the parameters and extended advertising data currently configured to the advertising set. Unless the application starts extended advertising before the first extended advertising event has completed, the stack will automatically stop the momentary extended advertising after the first extended advertising event.

Periodic advertising PDUs are transmitted on the secondary PHY configured for the advertising set with the sl_bt_extended_advertiser_set_phy command.

Use sl_bt_periodic_advertiser_stop command to stop the periodic advertising.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 3469 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_periodic_advertiser_stop#

sl_status_t sl_bt_periodic_advertiser_stop (uint8_t advertising_set)
Parameters
[in]advertising_set

Advertising set handle

Stop the periodic advertising on an advertising set. Counterpart to sl_bt_periodic_advertiser_start.

This command does not affect the enable state of the legacy or extended advertising on the advertising set, i.e., the legacy or extended advertising is not stopped..

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 3488 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

Macro Definition Documentation#

sl_bt_cmd_periodic_advertiser_set_data_id#

#define sl_bt_cmd_periodic_advertiser_set_data_id
Value:
0x00580020

Definition at line 3312 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_cmd_periodic_advertiser_set_long_data_id#

#define sl_bt_cmd_periodic_advertiser_set_long_data_id
Value:
0x01580020

Definition at line 3313 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_cmd_periodic_advertiser_start_id#

#define sl_bt_cmd_periodic_advertiser_start_id
Value:
0x02580020

Definition at line 3314 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_cmd_periodic_advertiser_stop_id#

#define sl_bt_cmd_periodic_advertiser_stop_id
Value:
0x03580020

Definition at line 3315 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_periodic_advertiser_set_data_id#

#define sl_bt_rsp_periodic_advertiser_set_data_id
Value:
0x00580020

Definition at line 3316 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_periodic_advertiser_set_long_data_id#

#define sl_bt_rsp_periodic_advertiser_set_long_data_id
Value:
0x01580020

Definition at line 3317 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_periodic_advertiser_start_id#

#define sl_bt_rsp_periodic_advertiser_start_id
Value:
0x02580020

Definition at line 3318 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h

sl_bt_rsp_periodic_advertiser_stop_id#

#define sl_bt_rsp_periodic_advertiser_stop_id
Value:
0x03580020

Definition at line 3319 of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h