Modules#
Extended Advertising Configuration Flags
Extended Advertiser#
Extended Advertiser.
The commands and events in this class are related to extended advertising functionalities in GAP peripheral and broadcaster roles.
Enumerations#
These values define the available connection modes in extended advertising.
Functions#
Macros#
Enumeration Documentation#
sl_bt_extended_advertiser_connection_mode_t#
sl_bt_extended_advertiser_connection_mode_t
These values define the available connection modes in extended advertising.
Enumerator | |
---|---|
sl_bt_extended_advertiser_non_connectable | (0x0) Non-connectable and non-scannable extended advertising |
sl_bt_extended_advertiser_scannable | (0x3) Scannable extended advertising |
sl_bt_extended_advertiser_connectable | (0x4) Connectable extended advertising |
3021
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
Function Documentation#
sl_bt_extended_advertiser_set_phy#
sl_status_t sl_bt_extended_advertiser_set_phy (uint8_t advertising_set, uint8_t primary_phy, uint8_t secondary_phy)
[in] | advertising_set | Advertising set handle |
[in] | primary_phy | Enum sl_bt_gap_phy_t. The PHY on which the advertising packets are transmitted on the primary advertising channel. Values:
Default value: sl_bt_gap_phy_1m |
[in] | secondary_phy | Enum sl_bt_gap_phy_t. The PHY on which the advertising packets are transmitted on the secondary advertising channel. Values:
Default value: sl_bt_gap_phy_1m |
Set the primary and secondary advertising PHYs used for extended and periodic advertising on an advertising set. This setting will take effect next time extended or periodic advertising is enabled. When advertising on the LE Coded PHY, coding scheme S=8 is used. The SL_STATUS_INVALID_PARAMETER error is returned if a PHY value is invalid or the device does not support a given PHY.
Returns
SL_STATUS_OK if successful. Error code otherwise.
3079
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_extended_advertiser_set_data#
sl_status_t sl_bt_extended_advertiser_set_data (uint8_t advertising_set, size_t data_len, const uint8_t * data)
[in] | advertising_set | Advertising set handle |
[in] | data_len | Length of data in |
[in] | data | Data to be set |
Set user-defined data for extended advertising. This overwrites the existing advertising data packet and scan response packet on this advertising set regardless of whether the data was set for the legacy or extended advertising. Maximum 191 bytes of data can be set for connectable extended advertising. Maximum 253 bytes of data can be set for non-connectable extended advertising. For setting longer advertising data, use command sl_bt_extended_advertiser_set_long_data.
If advertising mode is currently enabled, the new advertising data will be used immediately. Advertising mode can be enabled using command sl_bt_extended_advertiser_start.
The invalid parameter error is returned if the data is too long to fit into a single advertisement.
Returns
SL_STATUS_OK if successful. Error code otherwise.
3107
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_extended_advertiser_set_long_data#
sl_status_t sl_bt_extended_advertiser_set_long_data (uint8_t advertising_set)
[in] | advertising_set | Advertising set handle |
Set long user-defined data for extended advertising. This overwrites the existing advertising data packet and scan response packet on this advertising set regardless of whether the data was set for the legacy or extended advertising.
Prior to calling this command, add data to the buffer with one or multiple calls to sl_bt_system_data_buffer_write. When this command is called, the data in the system data buffer is extracted as the advertising data. The buffer will be emptied after this command regardless of the completion status.
Maximum 191 bytes of data can be set for connectable extended advertising. Maximum 1650 bytes of data can be set for non-connectable extended advertising. Advertising parameters may limit the amount of data that can be sent in a single advertisement. See sl_bt_extended_advertiser_set_data for more details.
Returns
SL_STATUS_OK if successful. Error code otherwise.
3135
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_extended_advertiser_generate_data#
sl_status_t sl_bt_extended_advertiser_generate_data (uint8_t advertising_set, uint8_t discover)
[in] | advertising_set | Advertising set handle |
[in] | discover | Enum sl_bt_advertiser_discovery_mode_t. The discovery mode for the Flags data field in the packet. Values:
|
Ask the stack to generate the extended advertising data on an advertising set. Alternatively, user-defined advertising data can be set using the sl_bt_extended_advertiser_set_data command.
This overwrites the existing advertising data packet and scan response packet on this advertising set regardless of whether the data was set for the legacy or extended advertising.
If advertising mode is currently enabled, the new advertising data will be used immediately. To enable advertising mode, use command sl_bt_extended_advertiser_start.
See sl_bt_legacy_advertiser_generate_data for the advertising data generation logic.
Returns
SL_STATUS_OK if successful. Error code otherwise.
3166
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_extended_advertiser_start#
sl_status_t sl_bt_extended_advertiser_start (uint8_t advertising_set, uint8_t connect, uint32_t flags)
[in] | advertising_set | Advertising set handle |
[in] | connect | Enum sl_bt_extended_advertiser_connection_mode_t. Connection mode. Values:
|
[in] | flags | Additional extended advertising options. Value: 0 or bitmask of Extended Advertising Configuration Flags |
Start undirected extended advertising on an advertising set with the specified connection mode. Use sl_bt_advertiser_stop to stop the advertising.
Use the sl_bt_extended_advertiser_set_data or sl_bt_extended_advertiser_generate_data command to set the advertising data before calling this command. Advertising data is added into the scan response packet if the connection mode is scannable. Otherwise, data is in the advertising data packet.
The number of concurrent connectable advertisings is limited by the connection number configuration. See sl_bt_legacy_advertiser_start for more details.
This command fails with the invalid parameter error if the advertising uses a non-resolvable random address but the connection mode is sl_bt_extended_advertiser_connectable.
Event sl_bt_evt_connection_opened will be received when a remote device opens a connection to the advertiser on this advertising set. As a result, the advertising stops.
Event sl_bt_evt_advertiser_timeout will be received when the number of advertising events set by sl_bt_advertiser_set_timing command is done and the advertising has stopped.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
sl_bt_evt_advertiser_timeout - Triggered when the number of advertising events set by sl_bt_advertiser_set_timing command is done and advertising has stopped on an advertising set.
sl_bt_evt_connection_opened - Triggered when a remote device opens a connection to the advertiser and the advertising has stopped.
3219
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h
sl_bt_extended_advertiser_start_directed#
sl_status_t sl_bt_extended_advertiser_start_directed (uint8_t advertising_set, uint8_t connect, uint32_t flags, bd_addr peer_addr, uint8_t peer_addr_type)
[in] | advertising_set | Advertising set handle |
[in] | connect | Enum sl_bt_extended_advertiser_connection_mode_t. Connection mode. Values:
|
[in] | flags | Additional extended advertising options. Value: 0 or bitmask of Extended Advertising Configuration Flags |
[in] | peer_addr | Address of the peer target device the advertising is directed to |
[in] | peer_addr_type | Enum sl_bt_gap_address_type_t. Peer target device 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,
|
Start directed extended advertising on an advertising set with the specified peer target device and connection mode. Use sl_bt_advertiser_stop to stop the advertising.
The number of concurrent connectable advertisings is limited by the connection number configuration. See sl_bt_legacy_advertiser_start for more details.
This command fails with the invalid parameter error if the advertising uses a non-resolvable random address but the connection mode is sl_bt_extended_advertiser_connectable.
Event sl_bt_evt_connection_opened will be received when the target device opens a connection to the advertiser on this advertising set. As a result, the advertising stops.
Event sl_bt_evt_advertiser_timeout will be received when the advertising stops and no Bluetooth connection is opened to it.
Returns
SL_STATUS_OK if successful. Error code otherwise.
Events
sl_bt_evt_advertiser_timeout - Triggered when the number of advertising events set by sl_bt_advertiser_set_timing command is done and the advertising has stopped.
sl_bt_evt_connection_opened - Triggered when a remote device opens a connection to the advertiser and the advertising has stopped.
3293
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_extended_advertiser_set_phy_id#
#define sl_bt_cmd_extended_advertiser_set_phy_idValue:
0x00570020
3004
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_extended_advertiser_set_data_id#
#define sl_bt_cmd_extended_advertiser_set_data_idValue:
0x01570020
3005
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_extended_advertiser_set_long_data_id#
#define sl_bt_cmd_extended_advertiser_set_long_data_idValue:
0x02570020
3006
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_extended_advertiser_generate_data_id#
#define sl_bt_cmd_extended_advertiser_generate_data_idValue:
0x03570020
3007
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_extended_advertiser_start_id#
#define sl_bt_cmd_extended_advertiser_start_idValue:
0x04570020
3008
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_extended_advertiser_start_directed_id#
#define sl_bt_cmd_extended_advertiser_start_directed_idValue:
0x05570020
3009
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_extended_advertiser_set_phy_id#
#define sl_bt_rsp_extended_advertiser_set_phy_idValue:
0x00570020
3010
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_extended_advertiser_set_data_id#
#define sl_bt_rsp_extended_advertiser_set_data_idValue:
0x01570020
3011
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_extended_advertiser_set_long_data_id#
#define sl_bt_rsp_extended_advertiser_set_long_data_idValue:
0x02570020
3012
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_extended_advertiser_generate_data_id#
#define sl_bt_rsp_extended_advertiser_generate_data_idValue:
0x03570020
3013
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_extended_advertiser_start_id#
#define sl_bt_rsp_extended_advertiser_start_idValue:
0x04570020
3014
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_extended_advertiser_start_directed_id#
#define sl_bt_rsp_extended_advertiser_start_directed_idValue:
0x05570020
3015
of file /mnt/raid/workspaces/ws.SZ9MaSA5u/overlay/gsdk/protocol/bluetooth/build_debug/bt_api/sw/bgapi/inc/sl_bt_api.h