Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
Gap< Impl, EventHandler > Struct Template Reference
Adaptation interface for the GAP layer. More...
#include <PalGap.h>
Public Member Functions | |
ble_error_t | initialize () |
Initialisation of the instance. | |
ble_error_t | terminate () |
Termination of the instance. | |
address_t | get_device_address () |
Return the public device address. | |
address_t | get_random_address () |
Return the current random address. | |
ble_error_t | set_random_address (const address_t &address) |
Set the random address which will used be during scan, connection or advertising process if the own address type selected is random. | |
ble_error_t | set_advertising_set_random_address (advertising_handle_t advertising_handle, const address_t &address) |
Set the random device address used by an advertising set. | |
ble_error_t | set_advertising_parameters (uint16_t advertising_interval_min, uint16_t advertising_interval_max, advertising_type_t advertising_type, own_address_type_t own_address_type, advertising_peer_address_type_t peer_address_type, const address_t &peer_address, advertising_channel_map_t advertising_channel_map, advertising_filter_policy_t advertising_filter_policy) |
Set the advertising parameters which will be used during the advertising process. | |
ble_error_t | set_extended_advertising_parameters (advertising_handle_t advertising_handle, advertising_event_properties_t event_properties, advertising_interval_t primary_advertising_interval_min, advertising_interval_t primary_advertising_interval_max, advertising_channel_map_t primary_advertising_channel_map, own_address_type_t own_address_type, advertising_peer_address_type_t peer_address_type, const address_t &peer_address, advertising_filter_policy_t advertising_filter_policy, advertising_power_t advertising_power, phy_t primary_advertising_phy, uint8_t secondary_advertising_max_skip, phy_t secondary_phy, uint8_t advertising_sid, bool scan_request_notification) |
Define the advertising parameters of an advertising set. | |
ble_error_t | set_periodic_advertising_parameters (advertising_handle_t advertising_handle, periodic_advertising_interval_t periodic_advertising_min, periodic_advertising_interval_t periodic_advertising_max, bool advertise_power) |
Configure periodic advertising parameters of an advertising set. | |
ble_error_t | set_advertising_data (uint8_t advertising_data_length, const advertising_data_t &advertising_data) |
Set the data sends in advertising packet. | |
ble_error_t | set_extended_advertising_data (advertising_handle_t advertising_handle, advertising_fragment_description_t operation, bool minimize_fragmentation, uint8_t advertising_data_size, const uint8_t *advertising_data) |
Set data in advertising PDUs. | |
ble_error_t | set_periodic_advertising_data (advertising_handle_t advertising_handle, advertising_fragment_description_t fragment_description, uint8_t advertising_data_size, const uint8_t *advertising_data) |
Set the data used in periodic advertising PDUs. | |
ble_error_t | set_scan_response_data (uint8_t scan_response_data_length, const advertising_data_t &scan_response_data) |
Set the data sends in scan response packets. | |
ble_error_t | set_extended_scan_response_data (advertising_handle_t advertising_handle, advertising_fragment_description_t operation, bool minimize_fragmentation, uint8_t scan_response_data_size, const uint8_t *scan_response_data) |
Set the data sends in extended scan response packets. | |
ble_error_t | advertising_enable (bool enable) |
Start or stop advertising. | |
ble_error_t | extended_advertising_enable (bool enable, uint8_t number_of_sets, const advertising_handle_t *handles, const uint16_t *durations, const uint8_t *max_extended_advertising_events) |
Start of stop advertising of extended advertising sets. | |
ble_error_t | periodic_advertising_enable (bool enable, advertising_handle_t advertising_handle) |
Enable or disable periodic advertising of an advertising set. | |
uint16_t | get_maximum_advertising_data_length () |
Query the maximum data length the controller supports in an advertising set. | |
uint16_t | get_maximum_connectable_advertising_data_length () |
Query the maximum data length the controller supports in an advertising set using connectable advertising. | |
uint8_t | get_maximum_hci_advertising_data_length () |
Query the maximum payload length for a single HCI packet carrying partial (or complete if it fits) data for advertising set. | |
uint8_t | get_max_number_of_advertising_sets () |
Query the maximum number of concurrent advertising sets that is supported by the controller. | |
ble_error_t | remove_advertising_set (advertising_handle_t advertising_handle) |
Remove an advertising set from the controller. | |
ble_error_t | clear_advertising_sets () |
Remove all advertising sets maintained by the controller. | |
ble_error_t | set_scan_parameters (bool active_scanning, uint16_t scan_interval, uint16_t scan_window, own_address_type_t own_address_type, scanning_filter_policy_t filter_policy) |
Set the parameter of the scan process. | |
ble_error_t | set_extended_scan_parameters (own_address_type_t own_address_type, scanning_filter_policy_t filter_policy, phy_set_t scanning_phys, const bool *active_scanning, const uint16_t *scan_interval, const uint16_t *scan_window) |
Set extended scan parameters to be used on advertising channels. | |
ble_error_t | scan_enable (bool enable, bool filter_duplicates) |
Start/stop scanning process. | |
ble_error_t | extended_scan_enable (bool enable, duplicates_filter_t filter_duplicates, uint16_t duration, uint16_t period) |
Enable or disable extended scanning. | |
ble_error_t | periodic_advertising_create_sync (bool use_periodic_advertiser_list, uint8_t advertising_sid, peer_address_type_t peer_address_type, const address_t &peer_address, uint16_t allowed_skip, uint16_t sync_timeout) |
Synchronize an observer with a periodic advertising broadcaster. | |
ble_error_t | cancel_periodic_advertising_create_sync () |
Cancel the establishment of synchronization with a periodic advertising broadcaster. | |
ble_error_t | periodic_advertising_terminate_sync (sync_handle_t sync_handle) |
Stop reception of the periodic advertising identified by sync_handle . | |
ble_error_t | add_device_to_periodic_advertiser_list (advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid) |
Add a device to the periodic advertiser list stored in the controller. | |
ble_error_t | remove_device_from_periodic_advertiser_list (advertising_peer_address_type_t advertiser_address_type, const address_t &advertiser_address, uint8_t advertising_sid) |
Remove a device from the periodic advertiser list. | |
ble_error_t | clear_periodic_advertiser_list () |
Clear all devices from the list of periodic advertisers. | |
uint8_t | read_periodic_advertiser_list_size () |
Return the total number of entries that can be stored by the periodic advertiser list. | |
ble_error_t | create_connection (uint16_t scan_interval, uint16_t scan_window, initiator_policy_t initiator_policy, connection_peer_address_type_t peer_address_type, const address_t &peer_address, own_address_type_t own_address_type, uint16_t connection_interval_min, uint16_t connection_interval_max, uint16_t connection_latency, uint16_t supervision_timeout, uint16_t minimum_connection_event_length, uint16_t maximum_connection_event_length) |
Create a new le connection to a connectable advertiser. | |
ble_error_t | extended_create_connection (initiator_policy_t initiator_policy, own_address_type_t own_address_type, peer_address_type_t peer_address_type, const address_t &peer_address, phy_set_t initiating_phys, const uint16_t *scan_intervals, const uint16_t *scan_windows, const uint16_t *connection_intervals_min, const uint16_t *connection_intervals_max, const uint16_t *connection_latencies, const uint16_t *supervision_timeouts, const uint16_t *minimum_connection_event_lengths, const uint16_t *maximum_connection_event_lengths) |
Create a new le connection to a connectable advertiser. | |
ble_error_t | cancel_connection_creation () |
Cancel the ongoing connection creation process. | |
uint8_t | read_white_list_capacity () |
Return the number of total whitelist entries that can be stored in the le subsystem. | |
ble_error_t | clear_whitelist () |
Clear the whitelist stored in the LE subsystem. | |
ble_error_t | add_device_to_whitelist (whitelist_address_type_t address_type, address_t address) |
Add a device to the LE subsystem Whitelist. | |
ble_error_t | remove_device_from_whitelist (whitelist_address_type_t address_type, address_t address) |
Remove a device from the LE subsystem Whitelist. | |
ble_error_t | connection_parameters_update (connection_handle_t connection, uint16_t connection_interval_min, uint16_t connection_interval_max, uint16_t connection_latency, uint16_t supervision_timeout, uint16_t minimum_connection_event_length, uint16_t maximum_connection_event_length) |
Start a connection update procedure. | |
ble_error_t | accept_connection_parameter_request (connection_handle_t connection_handle, uint16_t interval_min, uint16_t interval_max, uint16_t latency, uint16_t supervision_timeout, uint16_t minimum_connection_event_length, uint16_t maximum_connection_event_length) |
Accept connection parameter request. | |
ble_error_t | reject_connection_parameter_request (connection_handle_t connection_handle, hci_error_code_t rejection_reason) |
Reject a connection parameter update request. | |
ble_error_t | disconnect (connection_handle_t connection, disconnection_reason_t disconnection_reason) |
Start a disconnection procedure. | |
bool | is_privacy_supported () |
Check if privacy feature is supported by implementation. | |
ble_error_t | set_address_resolution (bool enable) |
Enable or disable private addresses resolution. | |
bool | is_feature_supported (controller_supported_features_t feature) |
Checked support for a feature in the link controller. | |
ble_error_t | read_phy (connection_handle_t connection) |
ble_error_t | set_preferred_phys (const phy_set_t &tx_phys, const phy_set_t &rx_phys) |
ble_error_t | set_phy (connection_handle_t connection, const phy_set_t &tx_phys, const phy_set_t &rx_phys, coded_symbol_per_bit_t coded_symbol) |
void | when_gap_event_received (mbed::Callback< void(const GapEvent &)> cb) |
Register a callback which will handle Gap events. | |
void | set_event_handler (EventHandler *event_handler) |
Sets the event handler that us called by the PAL porters to notify the stack of events which will in turn be passed onto the user application when appropriate. | |
Static Public Member Functions | |
static uint8_t | create_all_phys_value (const phy_set_t &tx_phys, const phy_set_t &rx_phys) |
Create an ALL_PHYS parameter used in LE Set PHY Command and LE Set Default PHY Command. | |
Protected Member Functions | |
void | emit_gap_event (const GapEvent &gap_event) |
Implementation shall call this function whenever the LE subsystem generate a Gap event. |
Detailed Description
template<typename Impl, class EventHandler>
struct ble::pal::Gap< Impl, EventHandler >
Adaptation interface for the GAP layer.
Define the primitive necessary to realize GAP operations. the API and event follow closely the definition of the HCI commands and events used by that layer.
Definition at line 344 of file PalGap.h.
Member Function Documentation
ble_error_t accept_connection_parameter_request | ( | connection_handle_t | connection_handle, |
uint16_t | interval_min, | ||
uint16_t | interval_max, | ||
uint16_t | latency, | ||
uint16_t | supervision_timeout, | ||
uint16_t | minimum_connection_event_length, | ||
uint16_t | maximum_connection_event_length | ||
) |
Accept connection parameter request.
This command sends a positive response to a connection parameter request from a peer.
- Parameters:
-
connection Handle of the connection. connection_interval_min Minimum interval between two connection events allowed for the connection. It shall be less than or equal to connection_interval_max. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_interval_max Maximum interval between two connection events allowed for the connection. It shall be greater than or equal to connection_interval_min. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_latency Number of connection events the slave can drop if it has nothing to communicate to the master. This value shall be in the range [0x0000 : 0x01F3]. supervision_timeout Link supervision timeout for the connection. It shall be larger than: (1 + connection_latency) * connection_interval_max * 2 Note: connection_interval_max is in ms in this formulae. Everytime the master or the slave receive a valid packet from the peer, the supervision timer is reset. If the supervision timer reaches supervision_timeout then the connection is considered lost and a disconnect event shall be emmited. This value shall be in the range [0x000A : 0x0C80] and is in unit of 10 ms. minimum_connection_event_length Informative parameter of the minimum length a connection event. It shall be less than or equal to maximum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms. maximum_connection_event_length Informative parameter of the maximum length a connection event. It shall be more than or equal to minimum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms.
- Note:
- Usually parameters of this function match the connection parameters received in the connection parameter request event.
- Attention:
- : Once the new connection parameters are in used a Connection Update Complete event shall be emmited.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.31 LE remote connection parameter request reply command.
ble_error_t add_device_to_periodic_advertiser_list | ( | advertising_peer_address_type_t | advertiser_address_type, |
const address_t & | advertiser_address, | ||
uint8_t | advertising_sid | ||
) |
Add a device to the periodic advertiser list stored in the controller.
This list may be used to create a periodic advertiser sync.
- Precondition:
- The device should not be in the periodic advertiser list.
- Create sync operation should not be pending
- The periodic advertising list of the controller should not be full.
- Parameters:
-
advertiser_address_type The address type of the device to add. advertiser_address The address value of the device to add. advertising_sid The SID field used to identify periodic advertising from the device.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.70 LE add device to periodic advertising list command.
ble_error_t add_device_to_whitelist | ( | whitelist_address_type_t | address_type, |
address_t | address | ||
) |
Add a device to the LE subsystem Whitelist.
- Parameters:
-
address_type address_type Type of the address to add in the whitelist. address Address of the device.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Attention:
- This command shall not be issued if the whitelist is being used by the advertising, scanning or connection creation procedure.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.16 LE add device to white list command.
ble_error_t advertising_enable | ( | bool | enable ) |
Start or stop advertising.
The process use advertising and scan response data set with set_advertising_data and set_scan_response_data while the parameters used are the one set by set_advertising_parameters.
The advertising shall continue until:
- The advertising is manually disabled (advertising_enable(false)).
- A connection is created.
- Time out in case of high duty cycle directed advertising.
If the random address has not been set and the advertising parameter own_address_type is set to 0x01 then the procedure shall fail.
If the random address has not been set and the advertising parameter own_address_type is set to RESOLVABLE_PRIVATE_ADDRESS_RANDOM_FALLBACK and the peer address is not in the resolving list then the procedure shall fail.
- Parameters:
-
enable If true start the advertising process, if the process was already runing and own_address_type is equal to 0x02 or 0x03, the subsystem can change the random address. If false and the advertising is running then the process should be stoped.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.9 LE set advertising enable command.
- If the advertising type is ADV_DIRECT_IND and the connection is not created during the time allowed to the procedure then a ConnectionComplete event shall be emmited with its error code set to ADVERTISING_TIMEOUT.
- Successfull connection shall emit a ConnectionComplete event. It also means advertising is disabled.
ble_error_t cancel_connection_creation | ( | ) |
ble_error_t cancel_periodic_advertising_create_sync | ( | ) |
Cancel the establishment of synchronization with a periodic advertising broadcaster.
- Precondition:
- There should be an ongoing sync establishment operation.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.68 LE periodic advertising create sync cancel command.
ble_error_t clear_advertising_sets | ( | ) |
Remove all advertising sets maintained by the controller.
- Precondition:
- Advertising of all advertising sets must be disabled.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.60 LE clear advertising sets command.
ble_error_t clear_periodic_advertiser_list | ( | ) |
Clear all devices from the list of periodic advertisers.
- Precondition:
- Create sync operation should not be pending
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.72 LE clear periodic advertising list command.
ble_error_t clear_whitelist | ( | ) |
Clear the whitelist stored in the LE subsystem.
- Attention:
- This command shall not be issued if the whitelist is being used by the advertising, scanning or connection creation procedure.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.15 LE clear white list command.
ble_error_t connection_parameters_update | ( | connection_handle_t | connection, |
uint16_t | connection_interval_min, | ||
uint16_t | connection_interval_max, | ||
uint16_t | connection_latency, | ||
uint16_t | supervision_timeout, | ||
uint16_t | minimum_connection_event_length, | ||
uint16_t | maximum_connection_event_length | ||
) |
Start a connection update procedure.
This procedure change the parameter used for a connection it can be master or slave initiated.
The peer will received a connection parameters request and will either accept or reject the new parameters for the connection.
Once the peer response has been received, the procedure ends and a Connection update complete event is emmited.
- Parameters:
-
connection Handle of the connection. connection_interval_min Minimum interval between two connection events allowed for the connection. It shall be less than or equal to connection_interval_max. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_interval_max Maximum interval between two connection events allowed for the connection. It shall be greater than or equal to connection_interval_min. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_latency Number of connection events the slave can drop if it has nothing to communicate to the master. This value shall be in the range [0x0000 : 0x01F3]. supervision_timeout Link supervision timeout for the connection. It shall be larger than: (1 + connection_latency) * connection_interval_max * 2 Note: connection_interval_max is in ms in this formulae. Everytime the master or the slave receive a valid packet from the peer, the supervision timer is reset. If the supervision timer reaches supervision_timeout then the connection is considered lost and a disconnect event shall be emmited. This value shall be in the range [0x000A : 0x0C80] and is in unit of 10 ms. minimum_connection_event_length Informative parameter of the minimum length a connection event. It shall be less than or equal to maximum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms. maximum_connection_event_length Informative parameter of the maximum length a connection event. It shall be more than or equal to minimum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.18 LE Connection update command.
ble_error_t create_connection | ( | uint16_t | scan_interval, |
uint16_t | scan_window, | ||
initiator_policy_t | initiator_policy, | ||
connection_peer_address_type_t | peer_address_type, | ||
const address_t & | peer_address, | ||
own_address_type_t | own_address_type, | ||
uint16_t | connection_interval_min, | ||
uint16_t | connection_interval_max, | ||
uint16_t | connection_latency, | ||
uint16_t | supervision_timeout, | ||
uint16_t | minimum_connection_event_length, | ||
uint16_t | maximum_connection_event_length | ||
) |
Create a new le connection to a connectable advertiser.
- Parameters:
-
scan_interval Hint to the le subsystem indicating how frequently it should scan for the peer address. It represent the time interval between two subsequent scan for the peer. It shall be in the range [0x0004 : 0x4000] and the time is in unit of 0.625ms. scan_window Hint to the le subsystem indicating for how long it should scan during a scan interval. The value shall be smaller or equal to scan_interval. If it is equal to scan_interval then scanning should run continuously. It shall be in the range [0x0004 : 0x4000] and the time is in unit of 0.625ms. initiator_policy Used to determine if the whitelist is used to determine the address to connect to. If the whitelist is not used, the connection shall be made against an advertiser matching the peer_address and the peer_address_type parameters. Otherwise those parameters are ignored. peer_address_type Type of address used by the advertiser. Not used if initiator_policy use the whitelist. Address used by the advertiser in its advertising packets. Not used if initiator_policy use the whitelist. own_address_type Type of address used in the connection request packet. connection_interval_min Minimum interval between two connection events allowed for the connection. It shall be less than or equal to connection_interval_max. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_interval_max Maximum interval between two connection events allowed for the connection. It shall be greater than or equal to connection_interval_min. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_latency Number of connection events the slave can drop if it has nothing to communicate to the master. This value shall be in the range [0x0000 : 0x01F3]. supervision_timeout Link supervision timeout for the connection. It shall be larger than: (1 + connection_latency) * connection_interval_max * 2 Note: connection_interval_max is in ms in this formulae. Everytime the master or the slave receive a valid packet from the peer, the supervision timer is reset. If the supervision timer reaches supervision_timeout then the connection is considered lost and a disconnect event shall be emmited. This value shall be in the range [0x000A : 0x0C80] and is in unit of 10 ms. minimum_connection_event_length Informative parameter of the minimum length a connection event. It shall be less than or equal to maximum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms. maximum_connection_event_length Informative parameter of the maximum length a connection event. It shall be more than or equal to minimum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.12 LE create connection command.
ble_error_t disconnect | ( | connection_handle_t | connection, |
disconnection_reason_t | disconnection_reason | ||
) |
Start a disconnection procedure.
Once the procedure is complete it should emit a disconnection complete event.
- Parameters:
-
connection Handle of the connection to terminate. disconnection_reason Indicates the reason for ending the connection.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.1.6 disconenct command.
void emit_gap_event | ( | const GapEvent & | gap_event ) | [protected] |
ble_error_t extended_advertising_enable | ( | bool | enable, |
uint8_t | number_of_sets, | ||
const advertising_handle_t * | handles, | ||
const uint16_t * | durations, | ||
const uint8_t * | max_extended_advertising_events | ||
) |
Start of stop advertising of extended advertising sets.
- Precondition:
- advertising handles present in
handles
must exist. -
advertising or scan response data must be complete for advertising handles in
handles
.
- Note:
- Disabling the advertising set identified by
handle
[i] does not disable any periodic advertising associated with that set.
- Parameters:
-
enable If true, start advertising of the advertising sets pointed by handles
. If false stop advertising for the advertising sets pointed byhandles
.number_of_sets Number of advertising sets concerned by the operation. handles
,durations
andmax_extended_advertising_events
should containnumber_of_sets
elements.handles Handle of advertising sets to start or stop. durations Advertising duration for handle
. The unit is 10ms and the special value 0x000 disable advertising timeout.max_extended_advertising_events Maximum number of extended advertising events the controller must attempt to send prior to terminating the extended advertising. The special value 0 indicate that there is no maximum.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.56 LE extended advertising enable command.
ble_error_t extended_create_connection | ( | initiator_policy_t | initiator_policy, |
own_address_type_t | own_address_type, | ||
peer_address_type_t | peer_address_type, | ||
const address_t & | peer_address, | ||
phy_set_t | initiating_phys, | ||
const uint16_t * | scan_intervals, | ||
const uint16_t * | scan_windows, | ||
const uint16_t * | connection_intervals_min, | ||
const uint16_t * | connection_intervals_max, | ||
const uint16_t * | connection_latencies, | ||
const uint16_t * | supervision_timeouts, | ||
const uint16_t * | minimum_connection_event_lengths, | ||
const uint16_t * | maximum_connection_event_lengths | ||
) |
Create a new le connection to a connectable advertiser.
- Parameters:
-
initiator_policy Used to determine if the whitelist is used to determine the address to connect to. If the whitelist is not used, the connection shall be made against an advertiser matching the peer_address and the peer_address_type parameters. Otherwise those parameters are ignored. own_address_type Type of address used in the connection request packet. peer_address_type Type of address used by the advertiser. Not used if initiator_policy use the whitelist. peer_address Address used by the advertiser in its advertising packets. Not used if initiator_policy use the whitelist. initiating_phys Indicates the advertising PHYs and the controller may use find the target and establish the connection. Subsequent parameters are arrays of value associated with phys present in initiating_phys
. The order of phys is 1M, 2M, Coded.scan_intervals Hint to the le subsystem indicating how frequently it should scan for the peer address. It represent the time interval between two subsequent scan for the peer. It shall be in the range [0x0004 : 0x4000] and the time is in unit of 0.625ms. scan_windows Hint to the le subsystem indicating for how long it should scan during a scan interval. The value shall be smaller or equal to scan_interval. If it is equal to scan_interval then scanning should run continuously. It shall be in the range [0x0004 : 0x4000] and the time is in unit of 0.625ms. connection_intervals_min Minimum interval between two connection events allowed for the connection. It shall be less than or equal to connection_interval_max. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_intervals_max Maximum interval between two connection events allowed for the connection. It shall be greater than or equal to connection_interval_min. This value shall be in range [0x0006 : 0x0C80] and is in unit of 1.25ms. connection_latencies Number of connection events the slave can drop if it has nothing to communicate to the master. This value shall be in the range [0x0000 : 0x01F3]. supervision_timeouts Link supervision timeout for the connection. It shall be larger than: (1 + connection_latency) * connection_interval_max * 2 Note: connection_interval_max is in ms in this formulae. Everytime the master or the slave receive a valid packet from the peer, the supervision timer is reset. If the supervision timer reaches supervision_timeout then the connection is considered lost and a disconnect event shall be emmited. This value shall be in the range [0x000A : 0x0C80] and is in unit of 10 ms. minimum_connection_event_lengths Informative parameter of the minimum length a connection event. It shall be less than or equal to maximum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms. maximum_connection_event_lengths Informative parameter of the maximum length a connection event. It shall be more than or equal to minimum_connection_event_length. It shall be in the range [0x0000 : 0xFFFF]. It should also be less than the expected connection interval. The unit is 0.625ms.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.66 LE extended create connection command.
ble_error_t extended_scan_enable | ( | bool | enable, |
duplicates_filter_t | filter_duplicates, | ||
uint16_t | duration, | ||
uint16_t | period | ||
) |
Enable or disable extended scanning.
- Parameters:
-
enable If true enable scanning and disable it otherwise. filter_duplicates If true filter out duplicate scan reports. duration Duration of the scan operation. The unit is 10ms and the special value 0 indicate continuous scan until explicitly disabled. period Interval between two scan operations. The unit is 1.28s and the special value 0 can be used to disable periodic scanning. If filter_duplicates
is equal to duplicates_filter_t::PERIODIC_RESET then the duplicate cache is reset whenever a scan operation starts.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.65 LE set extended scan enable command.
address_t get_device_address | ( | ) |
uint8_t get_max_number_of_advertising_sets | ( | ) |
Query the maximum number of concurrent advertising sets that is supported by the controller.
- Returns:
- The number of concurrent advertising sets supported by the controller.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.58 LE number of supported advertising sets command.
uint16_t get_maximum_advertising_data_length | ( | ) |
uint16_t get_maximum_connectable_advertising_data_length | ( | ) |
uint8_t get_maximum_hci_advertising_data_length | ( | ) |
address_t get_random_address | ( | ) |
ble_error_t initialize | ( | ) |
Initialisation of the instance.
An implementation can use this function to initialise the subsystems needed to realize the operations of this interface.
This function has to be called before any other operations.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
bool is_feature_supported | ( | controller_supported_features_t | feature ) |
bool is_privacy_supported | ( | ) |
ble_error_t periodic_advertising_create_sync | ( | bool | use_periodic_advertiser_list, |
uint8_t | advertising_sid, | ||
peer_address_type_t | peer_address_type, | ||
const address_t & | peer_address, | ||
uint16_t | allowed_skip, | ||
uint16_t | sync_timeout | ||
) |
Synchronize an observer with a periodic advertising broadcaster.
One the synchronization is establish the function EventHandler::on_periodic_advertising_sync_established is called and for every periodic advertising received is reported via the function EventHandler::on_periodic_advertising_report .
- Parameters:
-
use_periodic_advertiser_list Determine if the periodic advertiser list is used or ignored. advertising_sid SID to sync with. peer_address_type,peer_address Address of the advertiser. If use_periodic_advertiser_list
is true then these parameters are ignored.allowed_skip Number of periodic advertisement that can be skipped after a successful receive by the local device. sync_timeout Specifies the maximum permitted time between two successful receives. If this time is exceeded then the synchronization is considered lost and EventHandler::on_periodic_advertising_loss is called.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.67 LE periodic advertising create sync command.
ble_error_t periodic_advertising_enable | ( | bool | enable, |
advertising_handle_t | advertising_handle | ||
) |
Enable or disable periodic advertising of an advertising set.
- Parameters:
-
enable If true enable periodic advertising of advertising_handle
otherwise disable it.advertising_handle Handle to the advertising set to enable or disable.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.63 LE periodic advertising enable command.
ble_error_t periodic_advertising_terminate_sync | ( | sync_handle_t | sync_handle ) |
Stop reception of the periodic advertising identified by sync_handle
.
- Parameters:
-
sync_handle The handle identifying the periodic advertiser. It is obtained when EventHandler::on_periodic_advertising_sync_established is called.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.69 LE periodic advertising terminate sync command.
uint8_t read_periodic_advertiser_list_size | ( | ) |
ble_error_t read_phy | ( | connection_handle_t | connection ) |
uint8_t read_white_list_capacity | ( | ) |
Return the number of total whitelist entries that can be stored in the le subsystem.
- Note:
- The value returned can change over time.
- Returns:
- The number of entries that can be stored in the LE subsystem. It range from 0x01 to 0xFF.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.14 LE read white list size command.
ble_error_t reject_connection_parameter_request | ( | connection_handle_t | connection_handle, |
hci_error_code_t | rejection_reason | ||
) |
Reject a connection parameter update request.
- Parameters:
-
connection_handle handle to the peer which has issued the connection parameter request. rejection_reason Indicate to the peer why the proposed connection parameters were rejected.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.32 LE Remote Connection Parameter Request Negative Reply Command.
ble_error_t remove_advertising_set | ( | advertising_handle_t | advertising_handle ) |
Remove an advertising set from the controller.
After this operation, configuration and data associated with advertising_handle
are lost.
- Precondition:
advertising_handle
must exist.-
Advertising of
advertising_handle
must be disabled.
- Parameters:
-
advertising_handle The advertising handle to destroy.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.59 LE remove advertising set command.
ble_error_t remove_device_from_periodic_advertiser_list | ( | advertising_peer_address_type_t | advertiser_address_type, |
const address_t & | advertiser_address, | ||
uint8_t | advertising_sid | ||
) |
Remove a device from the periodic advertiser list.
- Precondition:
- Create sync operation should not be pending
- Parameters:
-
advertiser_address_type The address type of the device to remove. advertiser_address The address value of the device to remove. advertising_sid The SID field used to identify periodic advertising from the device.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.71 LE remove device from periodic advertising list command.
ble_error_t remove_device_from_whitelist | ( | whitelist_address_type_t | address_type, |
address_t | address | ||
) |
Remove a device from the LE subsystem Whitelist.
- Parameters:
-
address_type address_type Type of the address of the device to remove from the whitelist. address Address of the device to remove from the whitelist
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Attention:
- This command shall not be issued if the whitelist is being used by the advertising, scanning or connection creation procedure.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.17 LE remove device from white list command.
ble_error_t scan_enable | ( | bool | enable, |
bool | filter_duplicates | ||
) |
Start/stop scanning process.
Parameters of the scanning process shall be set before the scan launch by using the function set_scan_parameters.
enable Start the scanning process if true and stop it if false. If the scan process is already started, enabling it again will only update the duplicate filtering; based on the new parameter.
filter_duplicates Enable duplicate filtering if true, otherwise disable it.
- Attention:
- advertising data or scan response data is not considered significant when determining duplicate advertising reports.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.11 LE set scan enable command.
ble_error_t set_address_resolution | ( | bool | enable ) |
Enable or disable private addresses resolution.
- Parameters:
-
enable whether to enable private addresses resolution
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.44 LE Set Address Resolution Enable command.
ble_error_t set_advertising_data | ( | uint8_t | advertising_data_length, |
const advertising_data_t & | advertising_data | ||
) |
Set the data sends in advertising packet.
If the advertising is currently enabled, the data shall be used when a new advertising packet is issued.
- Parameters:
-
advertising_data_length Number of significant bytes in the advertising data. advertising_data The data sends in advertising packets. Non significant bytes shall be equal to 0.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.5 LE set advertising data command.
ble_error_t set_advertising_parameters | ( | uint16_t | advertising_interval_min, |
uint16_t | advertising_interval_max, | ||
advertising_type_t | advertising_type, | ||
own_address_type_t | own_address_type, | ||
advertising_peer_address_type_t | peer_address_type, | ||
const address_t & | peer_address, | ||
advertising_channel_map_t | advertising_channel_map, | ||
advertising_filter_policy_t | advertising_filter_policy | ||
) |
Set the advertising parameters which will be used during the advertising process.
- Parameters:
-
advertising_interval_min,: Minimum advertising interval which can be used during undirected and low duty cycle directed advertising. This parameter shall be less than or equal to advertising_interval_max. This parameter shall be in the range [0x20 : 0x4000] where each unit is equal to 0.625ms. This parameter is not used by directed high duty cycle advertising. advertising_interval_max,: Maximum advertising interval which can be used during undirected and low duty cycle directed advertising. This parameter shall be more than or equal to advertising_interval_min. This parameter shall be in the range [0x20 : 0x4000] where each unit is equal to 0.625ms. This parameter is not used by directed high duty cycle advertising. advertising_type Packet type that is used during the advertising process. Direct advertising require valid peer addresses parameters and ignore the filter policy set. If the High duty cycle advertising is used then the advertising parameter intervals are ignored. own_address_type Own address type used during advertising. If own address type is equal to RESOLVABLE_PRIVATE_ADDRESS_PUBLIC_FALLBACK or RESOLVABLE_PRIVATE_ADDRESS_RANDOM_FALLBACK then the peer address parameters (type and address) will be used to find the local IRK. peer_address_type Address type of the peer. This parameter shall be valid if directed advertising is used ( ADV_DIRECT_IND or ADV_DIRECT_IND_LOW_DUTY_CYCLE). This parameter should be valid if the own address type is equal to 0x02 or 0x03. In other cases, this parameter is ignored. peer_address Public device address, Random device addres, Public identity address or Random static identity address of the device targeted by the advertising. This parameter shall be valid if directed advertising is used ( ADV_DIRECT_IND or ADV_DIRECT_IND_LOW_DUTY_CYCLE). This parameter should be valid if the own address type is equal to 0x02 or 0x03. In other cases, this parameter is ignored. advertising_channel_map Map of the channel used to send advertising data. advertising_filter_policy Filter policy applied during the advertising process. The subsystem should use the whitelist to apply the policy. This parameter is ignored if the advertising type is directed ( ADV_DIRECT_IND or ADV_DIRECT_IND_LOW_DUTY_CYCLE).
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.5 LE set advertising parameters command.
ble_error_t set_advertising_set_random_address | ( | advertising_handle_t | advertising_handle, |
const address_t & | address | ||
) |
Set the random device address used by an advertising set.
- Precondition:
- No connectable advertising set should be enabled.
- Postcondition:
- The new random address should be used when
advertising_set_handle
is enabled.
- Parameters:
-
advertising_handle Handle to the advertising set that will be advertised with the address address
.address The random address to use when advertising_set_handle
is in use.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- See Bluetooth 5 Vol 2, Part E: 7.8.52 LE Set Advertising Set Random Address Command
void set_event_handler | ( | EventHandler * | event_handler ) |
Sets the event handler that us called by the PAL porters to notify the stack of events which will in turn be passed onto the user application when appropriate.
- Parameters:
-
[in] event_handler the new event handler interface implementation. Memory owned by caller who is responsible for updating this pointer if interface changes.
ble_error_t set_extended_advertising_data | ( | advertising_handle_t | advertising_handle, |
advertising_fragment_description_t | operation, | ||
bool | minimize_fragmentation, | ||
uint8_t | advertising_data_size, | ||
const uint8_t * | advertising_data | ||
) |
Set data in advertising PDUs.
- Note:
- this command can be called at anytime, whether the advertising set is enabled or not.
- the extended scan response can be set in one or more command.
- Precondition:
advertising_handle
should exist. To create it call set_extended_scan_parameters.
- Postcondition:
- The data inserted is used for subsequent advertising events.
- Parameters:
-
advertising_handle The handle identifying the advertising set associated with the data. operation Description of the operation to apply to advertising_handle
data.minimize_fragmentation Hint for the controller to minimize fragmentation of data sent over the air. advertising_data_size,advertising_data The data to associate to advertising_handle
.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.54 LE set extended advertising data command.
ble_error_t set_extended_advertising_parameters | ( | advertising_handle_t | advertising_handle, |
advertising_event_properties_t | event_properties, | ||
advertising_interval_t | primary_advertising_interval_min, | ||
advertising_interval_t | primary_advertising_interval_max, | ||
advertising_channel_map_t | primary_advertising_channel_map, | ||
own_address_type_t | own_address_type, | ||
advertising_peer_address_type_t | peer_address_type, | ||
const address_t & | peer_address, | ||
advertising_filter_policy_t | advertising_filter_policy, | ||
advertising_power_t | advertising_power, | ||
phy_t | primary_advertising_phy, | ||
uint8_t | secondary_advertising_max_skip, | ||
phy_t | secondary_phy, | ||
uint8_t | advertising_sid, | ||
bool | scan_request_notification | ||
) |
Define the advertising parameters of an advertising set.
- Parameters:
-
advertising_handle Identify the advertising set being configured. event_properties Describe the type of advertising event and its properties. primary_advertising_interval_min,primary_advertising_interval_max Advertising interval range for undirected and low duty cycle advertising. This parameter is not considered if event_properties.high_duty_cycle
is set.primary_advertising_channel_map Map of the advertising channel to use while advertising. own_address_type The type of address being used by the local controller. If this parameter is a resolvable address then the peer address should be an identity address. peer_address_type,peer_address Address of the peer. This parameter is not evaluated if event_properties.directed
is not set.advertising_filter_policy Filter applied to scan and connection requests. It is ignored for directed advertising ( event_properties.directed
set).advertising_power Maximum power level used during advertising. The controller select a power level lower than or equal to this value. The special value 127 should be used if the host as no preference towards the transmit power used. primary_advertising_phy PHY used to transmit data on the primary advertising channel. Accepted values are: phy_t::LE_1M and phy_t::LE_CODED. secondary_advertising_max_skip Maximum number of advertising events that can be skipped before the AUX_ADV_IND can be sent. secondary_phy PHY used to transmit data on the secondary advertising channel. advertising_sid 4bit value identifying the advertising set over the air. It is not used by legacy advertising. scan_request_notification Indicate if the host wants to receive scan request notification events.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.53 LE Set Extended Advertising Parameters Command.
- If the advertising set does not exist on the controller, it is created.
- Precondition:
advertising_handle
should not be enabled when this command is issued.
ble_error_t set_extended_scan_parameters | ( | own_address_type_t | own_address_type, |
scanning_filter_policy_t | filter_policy, | ||
phy_set_t | scanning_phys, | ||
const bool * | active_scanning, | ||
const uint16_t * | scan_interval, | ||
const uint16_t * | scan_window | ||
) |
Set extended scan parameters to be used on advertising channels.
- Parameters:
-
own_address_type Type of the address used in scan requests. filter_policy Scanning filter policy. scanning_phys The phy affected by the parameter change. Just LE_1M and LE_CODED can be set. If two phys are set then active_scanning
,scan_interval
andscan_window
must contain two elements. The first being applied to LE_1M and the second being applied to LE_CODED.active_scanning If true, active scanning is used for the correcponding PHY. scan_interval Interval between two subsequent scan. This parameter shall be in the range [0x0004 : 0x4000] and is in unit of 0.625ms. scan_window Duration of the LE scan. It shall be less than or equal to scan_interval value. This parameter shall be in the range [0x0004 : 0x4000] and is in unit of 0.625ms.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.64 LE set extended scan parameters command.
ble_error_t set_extended_scan_response_data | ( | advertising_handle_t | advertising_handle, |
advertising_fragment_description_t | operation, | ||
bool | minimize_fragmentation, | ||
uint8_t | scan_response_data_size, | ||
const uint8_t * | scan_response_data | ||
) |
Set the data sends in extended scan response packets.
If the advertising is currently enabled, the data shall be used when a new extended scan response is issued.
- Note:
- the extended scan response can be set in one or more command.
- Parameters:
-
advertising_handle The advertising handle that owns the scan response data. operation Description of the operation to apply to advertising_handle
data.minimize_fragmentation Hint for the controller to minimize fragmentation of data sent over the air. scan_response_data_size,scan_response_data The data to associate to advertising_handle
.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.55 LE set extended scan response data command.
ble_error_t set_periodic_advertising_data | ( | advertising_handle_t | advertising_handle, |
advertising_fragment_description_t | fragment_description, | ||
uint8_t | advertising_data_size, | ||
const uint8_t * | advertising_data | ||
) |
Set the data used in periodic advertising PDUs.
- Note:
- the extended scan response can be set in one or more command.
- Precondition:
advertising_handle
must exist. See set_extended_advertising_parameters.-
advertising_handle
must be configured for periodic advertising. See set_periodic_advertising_parameters .
- Parameters:
-
advertising_handle The handle identifying the advertising set associated with the data. fragment_description Description of the operation to apply to advertising_handle
data.advertising_data_size,advertising_data The data to associate to advertising_handle
.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.62 LE set periodic advertising data command.
ble_error_t set_periodic_advertising_parameters | ( | advertising_handle_t | advertising_handle, |
periodic_advertising_interval_t | periodic_advertising_min, | ||
periodic_advertising_interval_t | periodic_advertising_max, | ||
bool | advertise_power | ||
) |
Configure periodic advertising parameters of an advertising set.
- Precondition:
- The advertising handle must exist on the controller
- See also:
- set_extended_advertising_parameters .
- Precondition:
- Periodic advertising of
advertising_handle
should not be enabled when this function is called. -
The advertising set identified by
advertising_handle
should not be configured as anonymous advertising.
- Parameters:
-
advertising_handle The advertising set being configured. periodic_advertising_min,periodic_advertising_max Advertising interval range for periodic advertising of this set. advertise_power If true, the transmission power should be included in the advertising PDU.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.61 LE Set Periodic Advertising Parameters Command
ble_error_t set_phy | ( | connection_handle_t | connection, |
const phy_set_t & | tx_phys, | ||
const phy_set_t & | rx_phys, | ||
coded_symbol_per_bit_t | coded_symbol | ||
) |
ble_error_t set_preferred_phys | ( | const phy_set_t & | tx_phys, |
const phy_set_t & | rx_phys | ||
) |
ble_error_t set_random_address | ( | const address_t & | address ) |
Set the random address which will used be during scan, connection or advertising process if the own address type selected is random.
Changing the address during scan, connection or advertising process is forbiden.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.4 LE set random address command.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
ble_error_t set_scan_parameters | ( | bool | active_scanning, |
uint16_t | scan_interval, | ||
uint16_t | scan_window, | ||
own_address_type_t | own_address_type, | ||
scanning_filter_policy_t | filter_policy | ||
) |
Set the parameter of the scan process.
This command shall not be effective when the scanning process is running.
- Parameters:
-
active_scanning If true the subsystem does active scanning and the bluetooth subsystem shall send scanning PDUs. It shall also listen to scan responses. If false no scanning PDUs are sent during the scan process. scan_interval The time interval between two subsequent LE scans in unit of 0.625ms. This parameter shall be in the range [0x0004 : 0x4000]. scan_window Duration of the LE scan. It shall be less than or equal to scan_interval value. This parameter shall be in the range [0x0004 : 0x4000] and is in unit of 0.625ms. own_address_type Own address type used in scan request packets. filter_policy Filter policy applied when scanning.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.10 LE set scan parameters command.
ble_error_t set_scan_response_data | ( | uint8_t | scan_response_data_length, |
const advertising_data_t & | scan_response_data | ||
) |
Set the data sends in scan response packets.
If the advertising is currently enabled, the data shall be used when a new scan response is issued.
- Parameters:
-
scan_response_data_length Number of significant bytes in the scan response data. scan_response_data The data sends in scan response packets. Non significant bytes shall be equal to 0.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
- Note:
- : See Bluetooth 5 Vol 2 PartE: 7.8.8 LE set scan response data command.
ble_error_t terminate | ( | ) |
Termination of the instance.
An implementation can use this function to release the subsystems initialised to realise the operations of this interface.
After a call to this function, initialise should be called again to allow use of the interface.
- Returns:
- BLE_ERROR_NONE if the request has been successfully sent or the appropriate error otherwise.
void when_gap_event_received | ( | mbed::Callback< void(const GapEvent &)> | cb ) |
Generated on Tue Jul 12 2022 13:55:41 by
