GAP#
GAP.
Enumerations#
enum | sl_bt_gap_address_type_t { sl_bt_gap_public_address = 0x0, sl_bt_gap_static_address = 0x1, sl_bt_gap_random_resolvable_address = 0x2, sl_bt_gap_random_nonresolvable_address = 0x3 } | These values define Bluetooth device address types.
enum | sl_bt_gap_phy_t { sl_bt_gap_phy_1m = 0x1, sl_bt_gap_phy_2m = 0x2, sl_bt_gap_phy_coded = 0x4, sl_bt_gap_phy_any = 0xff } | Types of PHYs.
enum | sl_bt_gap_phy_coding_t { sl_bt_gap_phy_coding_1m_uncoded = 0x1, sl_bt_gap_phy_coding_2m_uncoded = 0x2, sl_bt_gap_phy_coding_125k_coded = 0x4, sl_bt_gap_phy_coding_500k_coded = 0x8 } | PHY types with coding schemes.
Functions#
sl_status_t | sl_bt_gap_set_privacy_mode (uint8_t privacy, uint8_t interval)
sl_status_t | sl_bt_gap_set_data_channel_classification (size_t channel_map_len, const uint8_t *channel_map)
sl_status_t | sl_bt_gap_enable_whitelisting (uint8_t enable)
Detailed Description#
GAP.
The commands and events in this class are related to the Generic Access Profile (GAP) in Bluetooth.
Enumeration Type Documentation#
◆ sl_bt_gap_address_type_t#
enum sl_bt_gap_address_type_t#
These values define Bluetooth device address types.
Enumerator#
sl_bt_gap_public_address |
(0x0) Public device address
sl_bt_gap_static_address |
(0x1) Static device address
sl_bt_gap_random_resolvable_address |
(0x2) Resolvable private random address
sl_bt_gap_random_nonresolvable_address |
(0x3) Non-resolvable private random address
◆ sl_bt_gap_phy_t#
enum sl_bt_gap_phy_t#
Types of PHYs.
Enumerator#
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)
sl_bt_gap_phy_any |
(0xff) Any PHYs the device supports
◆ sl_bt_gap_phy_coding_t#
enum sl_bt_gap_phy_coding_t#
PHY types with coding schemes.
Enumerator#
sl_bt_gap_phy_coding_1m_uncoded |
(0x1) 1M PHY
sl_bt_gap_phy_coding_2m_uncoded |
(0x2) 2M PHY
sl_bt_gap_phy_coding_125k_coded |
(0x4) 125k Coded PHY (S=8)
sl_bt_gap_phy_coding_500k_coded |
(0x8) 500k Coded PHY (S=2)
Function Documentation#
◆ sl_bt_gap_set_privacy_mode()#
sl_status_t sl_bt_gap_set_privacy_mode | ( | uint8_t |
|
---|---|---|---|
uint8_t |
| ||
) |
Enable or disable the privacy feature on all GAP roles. New privacy mode will take effect for advertising next time advertising is enabled, for scanning next time scanning is enabled, and for initiating on the next open connection command.
When privacy is enabled and the device is advertising or scanning, the stack will maintain a periodic timer with the specified time interval as a timeout value. At each timeout, the stack will generate a new resolvable private address and use it in scanning requests. For advertisers, the stack will generate a new resolvable or non-resolvable private address and use it in advertising data packets for each advertising set if its address is not application-managed, i.e., the address was not set by the application (with the sl_bt_advertiser_set_random_address command). The application is fully responsible for application-managed advertiser addresses. For an application-managed resolvable private address, the application should schedule periodic address updates for enhancing the privacy. It is recommended to use different schedules for different advertising sets.
Disabling the privacy during active advertising or scanning is not allowed.
By default, privacy feature is disabled.
Parameters
[in]| `privacy`| Values:
0: Disable privacy
1: Enable privacy
---|---|---
[in]| interval
| The minimum time interval between a private address change.
This parameter is ignored if this command is issued to disable privacy mode.
Values:
0: Use default interval, 15 minutes
others: The time interval in minutes
Returns
SL_STATUS_OK if successful. Error code otherwise.
◆ sl_bt_gap_set_data_channel_classification()#
sl_status_t sl_bt_gap_set_data_channel_classification | ( | size_t |
channel_map_len,
---|---|---|---
| | const uint8_t * | channel_map
| ) | |
Specify a channel classification for data channels. This classification persists until overwritten with a subsequent command or until the system is reset.
Parameters
[in]| `channel_map_len`| Length of data in `channel_map`
---|---|---
[in]| channel_map
|
This parameter is 5 bytes and contains 37 1-bit fields. The nth field (in the range 0 to 36) contains the value for the link layer channel index n.
0: Channel n is bad.
1: Channel n is unknown.
The rest of most significant bits are reserved for future use and must be set to 0. At least two channels shall be marked as unknown.
Returns
SL_STATUS_OK if successful. Error code otherwise.
◆ sl_bt_gap_enable_whitelisting()#
sl_status_t sl_bt_gap_enable_whitelisting | ( | uint8_t | enable
| ) |
---|---|---|---|---|---
Enable or disable accept list filtering. The setting will be effective the next time that scanning is enabled. To add devices to the accept list, either bond with the device or add it manually with sl_bt_sm_add_to_whitelist.
Parameters
[in]| `enable`| 1 enable, 0 disable accept list filtering.
---|---|---
Returns
SL_STATUS_OK if successful. Error code otherwise.