GAP#

GAP.

The commands and events in this class are related to the Generic Access Profile (GAP) in Bluetooth.

Enumerations#

enum
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
sl_bt_gap_public_address_resolved_from_rpa = 0x4
sl_bt_gap_static_address_resolved_from_rpa = 0x5
sl_bt_gap_anonymous_address = 0xff
}

These values define Bluetooth device address types. Commands and events that have Bluetooth device address parameters will specify which values are valid for that particular command or event.

enum
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_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_BGAPI_DEPRECATED sl_status_t
sl_status_t
sl_bt_gap_set_identity_address(bd_addr address, uint8_t addr_type)

Enumeration Documentation#

sl_bt_gap_address_type_t#

sl_bt_gap_address_type_t

These values define Bluetooth device address types. Commands and events that have Bluetooth device address parameters will specify which values are valid for that particular command or event.

If the application does not include the bluetooth_feature_use_accurate_api_address_types component, most Bluetooth commands and events use a coarse address type that only differentiates between a public address and any random address. When the application includes the bluetooth_feature_use_accurate_api_address_types component, Bluetooth commands and events that include an address type will systematically use values of this sl_bt_gap_address_type_t enumeration to indicate the accurate address type.

The values sl_bt_gap_public_address_resolved_from_rpa and sl_bt_gap_static_address_resolved_from_rpa are reported by the Bluetooth stack only when the application includes the bluetooth_feature_resolving_list component and the address was resolved in the Bluetooth controller. If the application uses these two types in input parameters, they are treated as synonyms of sl_bt_gap_public_address and sl_bt_gap_static_address, respectively.

Enumerator
sl_bt_gap_public_address
sl_bt_gap_static_address
sl_bt_gap_random_resolvable_address
sl_bt_gap_random_nonresolvable_address
sl_bt_gap_public_address_resolved_from_rpa
sl_bt_gap_static_address_resolved_from_rpa
sl_bt_gap_anonymous_address

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

sl_bt_gap_phy_t#

sl_bt_gap_phy_t

Types of PHYs.

Enumerator
sl_bt_gap_phy_1m
sl_bt_gap_phy_2m
sl_bt_gap_phy_coded
sl_bt_gap_phy_any

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

sl_bt_gap_phy_coding_t#

sl_bt_gap_phy_coding_t

PHY types with coding schemes.

Enumerator
sl_bt_gap_phy_coding_1m_uncoded
sl_bt_gap_phy_coding_2m_uncoded
sl_bt_gap_phy_coding_125k_coded
sl_bt_gap_phy_coding_500k_coded

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

Function Documentation#

sl_bt_gap_set_privacy_mode#

sl_status_t sl_bt_gap_set_privacy_mode (uint8_t privacy, uint8_t interval)
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

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 generates a new resolvable private address and uses it in scanning requests. For advertisers, the stack generates a new resolvable or non-resolvable private address and uses 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.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


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

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)
Parameters
[in]channel_map_len

Length of data in channel_map

[in]channel_map

5 byte bit field in little endian format. Only the first 37 bits are used. Bit 0 of the first byte is channel 0, bit 0 of the second byte is channel 8, etc. Bits 37-39 are reserved for future use and must be set to 0.

A channel is bad when its bit is 0. A channel is unknown when its bit is 1. At least two channels shall be marked as unknown.

Specify a channel classification for data channels. This classification persists until overwritten with a subsequent command or until the system is reset. The value length of channel_map must be 5 bytes.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


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

sl_bt_gap_enable_whitelisting#

SL_BGAPI_DEPRECATED sl_status_t sl_bt_gap_enable_whitelisting (uint8_t enable)
Parameters
[in]enable

1 enable, 0 disable accept list filtering.

Deprecated and replaced by functionality-specific settings provided by the bluetooth_feature_accept_list component. For advertising, use the command sl_bt_advertiser_configure and flags bits SL_BT_ADVERTISER_USE_FILTER_FOR_SCAN_REQUESTS and SL_BT_ADVERTISER_USE_FILTER_FOR_CONNECTION_REQUESTS to configure the advertising filter policy. For scanning, use the command sl_bt_scanner_set_parameters_and_filter to control the scanning filter policy.

Enable or disable accept list filtering. The setting will be effective the next time that scanning is enabled. Use command sl_bt_sm_add_to_whitelist to add devices to the accept list.

When the built-in bonding database (bluetooth_feature_builtin_bonding_database) is used, bonded devices are added into the accept list automatically by the stack. Note that the Bluetooth stack uses the built-in bonding database by default.

When the application specifically uses the external bonding database (bluetooth_feature_external_bonding_database), the application is fully responsible for managing the accept list using sl_bt_sm_add_to_whitelist and sl_bt_sm_delete_bondings commands.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


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

sl_bt_gap_set_identity_address#

sl_status_t sl_bt_gap_set_identity_address (bd_addr address, uint8_t addr_type)
Parameters
[in]address

The address in little endian format

[in]addr_type

Enum sl_bt_gap_address_type_t. The address type. Values:

  • sl_bt_gap_public_address (0x0): Public device address

  • sl_bt_gap_static_address (0x1): Static device address

Set the device's Bluetooth identity address to be used in advertising, scanning, connection initiation, and identity address exchange in bonding. The address is stored in RAM only and does not change the identity address in persistent storage. The address can be a public device address or static device address. It will be effective immediately in the next advertising, scanning, connection initiation, and bonding. Error SL_STATUS_INVALID_PARAMETER is returned if the address does not conform to the Bluetooth specification.

Note that advertising sets that have own addresses set by sl_bt_advertiser_set_random_address are not affected by this command, i.e., they will continue to use their own user defined addresses.

Returns

  • SL_STATUS_OK if successful. Error code otherwise.


Definition at line 1789 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_gap_set_privacy_mode_id#

#define sl_bt_cmd_gap_set_privacy_mode_id
Value:
0x01020020

Definition at line 1597 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_gap_set_data_channel_classification_id#

#define sl_bt_cmd_gap_set_data_channel_classification_id
Value:
0x02020020

Definition at line 1598 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_gap_enable_whitelisting_id#

#define sl_bt_cmd_gap_enable_whitelisting_id
Value:
0x03020020

Definition at line 1599 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_gap_set_identity_address_id#

#define sl_bt_cmd_gap_set_identity_address_id
Value:
0x04020020

Definition at line 1600 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_gap_set_privacy_mode_id#

#define sl_bt_rsp_gap_set_privacy_mode_id
Value:
0x01020020

Definition at line 1601 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_gap_set_data_channel_classification_id#

#define sl_bt_rsp_gap_set_data_channel_classification_id
Value:
0x02020020

Definition at line 1602 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_gap_enable_whitelisting_id#

#define sl_bt_rsp_gap_enable_whitelisting_id
Value:
0x03020020

Definition at line 1603 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_gap_set_identity_address_id#

#define sl_bt_rsp_gap_set_identity_address_id
Value:
0x04020020

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