Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Gap< Impl, EventHandler > Struct Template Reference

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:
connectionHandle of the connection.
connection_interval_minMinimum 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_maxMaximum 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_latencyNumber 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_timeoutLink 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_lengthInformative 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_lengthInformative 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.

Definition at line 1821 of file PalGap.h.

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_typeThe address type of the device to add.
advertiser_addressThe address value of the device to add.
advertising_sidThe 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.

Definition at line 1310 of file PalGap.h.

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_typeaddress_type Type of the address to add in the whitelist.
addressAddress 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.

Definition at line 1650 of file PalGap.h.

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:
enableIf 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.

Definition at line 887 of file PalGap.h.

ble_error_t cancel_connection_creation (  )

Cancel the ongoing connection creation process.

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.13 LE create connection cancel command.

Definition at line 1598 of file PalGap.h.

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.

Definition at line 1264 of file PalGap.h.

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.

Definition at line 1048 of file PalGap.h.

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.

Definition at line 1363 of file PalGap.h.

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.

Definition at line 1629 of file PalGap.h.

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:
connectionHandle of the connection.
connection_interval_minMinimum 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_maxMaximum 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_latencyNumber 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_timeoutLink 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_lengthInformative 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_lengthInformative 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.

Definition at line 1744 of file PalGap.h.

static uint8_t create_all_phys_value ( const phy_set_t tx_phys,
const phy_set_t rx_phys 
) [static]

Create an ALL_PHYS parameter used in LE Set PHY Command and LE Set Default PHY Command.

See also:
BLUETOOTH SPECIFICATION Version 5.0 | Vol 2, Part E - 7.8.49

Definition at line 2021 of file PalGap.h.

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_intervalHint 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_windowHint 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_policyUsed 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_typeType of address used by the advertiser. Not used if initiator_policy use the whitelist.
Addressused by the advertiser in its advertising packets. Not used if initiator_policy use the whitelist.
own_address_typeType of address used in the connection request packet.
connection_interval_minMinimum 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_maxMaximum 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_latencyNumber 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_timeoutLink 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_lengthInformative 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_lengthInformative 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.

Definition at line 1450 of file PalGap.h.

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:
connectionHandle of the connection to terminate.
disconnection_reasonIndicates 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.

Definition at line 1882 of file PalGap.h.

void emit_gap_event ( const GapEvent gap_event ) [protected]

Implementation shall call this function whenever the LE subsystem generate a Gap event.

Parameters:
gap_eventThe event to emit to higher layer.

Definition at line 2008 of file PalGap.h.

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:
enableIf true, start advertising of the advertising sets pointed by handles. If false stop advertising for the advertising sets pointed by handles.
number_of_setsNumber of advertising sets concerned by the operation. handles, durations and max_extended_advertising_events should contain number_of_sets elements.
handlesHandle of advertising sets to start or stop.
durationsAdvertising duration for handle. The unit is 10ms and the special value 0x000 disable advertising timeout.
max_extended_advertising_eventsMaximum 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.

Definition at line 926 of file PalGap.h.

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_policyUsed 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_typeType of address used in the connection request packet.
peer_address_typeType of address used by the advertiser. Not used if initiator_policy use the whitelist.
peer_addressAddress used by the advertiser in its advertising packets. Not used if initiator_policy use the whitelist.
initiating_physIndicates 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_intervalsHint 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_windowsHint 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_minMinimum 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_maxMaximum 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_latenciesNumber 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_timeoutsLink 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_lengthsInformative 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_lengthsInformative 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.

Definition at line 1557 of file PalGap.h.

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:
enableIf true enable scanning and disable it otherwise.
filter_duplicatesIf true filter out duplicate scan reports.
durationDuration of the scan operation. The unit is 10ms and the special value 0 indicate continuous scan until explicitly disabled.
periodInterval 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.

Definition at line 1191 of file PalGap.h.

address_t get_device_address (  )

Return the public device address.

Note:
The public device address is usually acquired at initialization and stored in the instance.
Returns:
the public device address.

Definition at line 390 of file PalGap.h.

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.

Definition at line 1009 of file PalGap.h.

uint16_t get_maximum_advertising_data_length (  )

Query the maximum data length the controller supports in an advertising set.

Returns:
The length in byte the controller can support in an advertising set.
Note:
: See Bluetooth 5 Vol 2 PartE: 7.8.57 LE read maximum advertising data length command.

Definition at line 974 of file PalGap.h.

uint16_t get_maximum_connectable_advertising_data_length (  )

Query the maximum data length the controller supports in an advertising set using connectable advertising.

Returns:
The length in byte the controller can support in an advertising set for connectable advertising.

Definition at line 985 of file PalGap.h.

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.

Returns:
Max size of the HCI packet transporting the data.

Definition at line 995 of file PalGap.h.

address_t get_random_address (  )

Return the current random address.

Note:
The random address is usually acquired at initialization and stored in the instance.
Returns:
the random device address.

Definition at line 402 of file PalGap.h.

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.

Definition at line 363 of file PalGap.h.

bool is_feature_supported ( controller_supported_features_t  feature )

Checked support for a feature in the link controller.

Parameters:
featurefeature to be checked.
Returns:
TRUE if feature is supported.

Definition at line 1920 of file PalGap.h.

bool is_privacy_supported (  )

Check if privacy feature is supported by implementation.

Returns:
true if privacy is supported, false otherwise.
Note:
: See Bluetooth 5 Vol 3 Part C: 10.7 Privacy feature.

Definition at line 1895 of file PalGap.h.

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_listDetermine if the periodic advertiser list is used or ignored.
advertising_sidSID to sync with.
peer_address_type,peer_addressAddress of the advertiser. If use_periodic_advertiser_list is true then these parameters are ignored.
allowed_skipNumber of periodic advertisement that can be skipped after a successful receive by the local device.
sync_timeoutSpecifies 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.

Definition at line 1234 of file PalGap.h.

ble_error_t periodic_advertising_enable ( bool  enable,
advertising_handle_t  advertising_handle 
)

Enable or disable periodic advertising of an advertising set.

Parameters:
enableIf true enable periodic advertising of advertising_handle otherwise disable it.
advertising_handleHandle 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.

Definition at line 957 of file PalGap.h.

ble_error_t periodic_advertising_terminate_sync ( sync_handle_t  sync_handle )

Stop reception of the periodic advertising identified by sync_handle.

Parameters:
sync_handleThe 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.

Definition at line 1281 of file PalGap.h.

uint8_t read_periodic_advertiser_list_size (  )

Return the total number of entries that can be stored by the periodic advertiser list.

Returns:
The capacity of the periodic advertiser list.
Note:
We (wrongfully) assume that value doesn't change over time.

Definition at line 1375 of file PalGap.h.

ble_error_t read_phy ( connection_handle_t  connection )
See also:
Gap::readPhy

Definition at line 1929 of file PalGap.h.

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.

Definition at line 1614 of file PalGap.h.

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_handlehandle to the peer which has issued the connection parameter request.
rejection_reasonIndicate 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.

Definition at line 1856 of file PalGap.h.

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_handleThe 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.

Definition at line 1031 of file PalGap.h.

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_typeThe address type of the device to remove.
advertiser_addressThe address value of the device to remove.
advertising_sidThe 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.

Definition at line 1340 of file PalGap.h.

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_typeaddress_type Type of the address of the device to remove from the whitelist.
addressAddress 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.

Definition at line 1677 of file PalGap.h.

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.

Definition at line 1163 of file PalGap.h.

ble_error_t set_address_resolution ( bool  enable )

Enable or disable private addresses resolution.

Parameters:
enablewhether 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.

Definition at line 1908 of file PalGap.h.

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_lengthNumber of significant bytes in the advertising data.
advertising_dataThe 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.

Definition at line 683 of file PalGap.h.

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_typePacket 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_typeOwn 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_typeAddress 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_addressPublic 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_mapMap of the channel used to send advertising data.
advertising_filter_policyFilter 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.

Definition at line 509 of file PalGap.h.

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_handleHandle to the advertising set that will be advertised with the address address.
addressThe 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

Definition at line 442 of file PalGap.h.

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_handlerthe new event handler interface implementation. Memory owned by caller who is responsible for updating this pointer if interface changes.

Definition at line 1980 of file PalGap.h.

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_handleThe handle identifying the advertising set associated with the data.
operationDescription of the operation to apply to advertising_handle data.
minimize_fragmentationHint for the controller to minimize fragmentation of data sent over the air.
advertising_data_size,advertising_dataThe 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.

Definition at line 724 of file PalGap.h.

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_handleIdentify the advertising set being configured.
event_propertiesDescribe the type of advertising event and its properties.
primary_advertising_interval_min,primary_advertising_interval_maxAdvertising 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_mapMap of the advertising channel to use while advertising.
own_address_typeThe 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_addressAddress of the peer. This parameter is not evaluated if event_properties.directed is not set.
advertising_filter_policyFilter applied to scan and connection requests. It is ignored for directed advertising (event_properties.directed set).
advertising_powerMaximum 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_phyPHY used to transmit data on the primary advertising channel. Accepted values are: phy_t::LE_1M and phy_t::LE_CODED.
secondary_advertising_max_skipMaximum number of advertising events that can be skipped before the AUX_ADV_IND can be sent.
secondary_phyPHY used to transmit data on the secondary advertising channel.
advertising_sid4bit value identifying the advertising set over the air. It is not used by legacy advertising.
scan_request_notificationIndicate 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.

Definition at line 590 of file PalGap.h.

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_typeType of the address used in scan requests.
filter_policyScanning filter policy.
scanning_physThe 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 and scan_window must contain two elements. The first being applied to LE_1M and the second being applied to LE_CODED.
active_scanningIf true, active scanning is used for the correcponding PHY.
scan_intervalInterval between two subsequent scan. This parameter shall be in the range [0x0004 : 0x4000] and is in unit of 0.625ms.
scan_windowDuration 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.

Definition at line 1124 of file PalGap.h.

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_handleThe advertising handle that owns the scan response data.
operationDescription of the operation to apply to advertising_handle data.
minimize_fragmentationHint for the controller to minimize fragmentation of data sent over the air.
scan_response_data_size,scan_response_dataThe 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.

Definition at line 831 of file PalGap.h.

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_handleThe handle identifying the advertising set associated with the data.
fragment_descriptionDescription of the operation to apply to advertising_handle data.
advertising_data_size,advertising_dataThe 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.

Definition at line 765 of file PalGap.h.

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_handleThe advertising set being configured.
periodic_advertising_min,periodic_advertising_maxAdvertising interval range for periodic advertising of this set.
advertise_powerIf 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

Definition at line 652 of file PalGap.h.

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 
)
See also:
Gap::setPhy

Definition at line 1946 of file PalGap.h.

ble_error_t set_preferred_phys ( const phy_set_t tx_phys,
const phy_set_t rx_phys 
)
See also:
Gap::setPreferredPhys

Definition at line 1936 of file PalGap.h.

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.

Definition at line 418 of file PalGap.h.

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_scanningIf 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_intervalThe time interval between two subsequent LE scans in unit of 0.625ms. This parameter shall be in the range [0x0004 : 0x4000].
scan_windowDuration 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_typeOwn address type used in scan request packets.
filter_policyFilter 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.

Definition at line 1080 of file PalGap.h.

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_lengthNumber of significant bytes in the scan response data.
scan_response_dataThe 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.

Definition at line 796 of file PalGap.h.

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.

Definition at line 378 of file PalGap.h.

void when_gap_event_received ( mbed::Callback< void(const GapEvent &)>  cb )

Register a callback which will handle Gap events.

Parameters:
cbThe callback object which will handle Gap events from the LE subsystem. It accept a single parameter in input: The event received.

Definition at line 1967 of file PalGap.h.