22 #include "ble/common/CallChainOfFunctionPointersWithContext.h"    24 #include "ble/common/BLERoles.h"    25 #include "ble/common/BLETypes.h"    26 #include "ble/gap/AdvertisingDataBuilder.h"    27 #include "ble/gap/AdvertisingDataParser.h"    28 #include "ble/gap/AdvertisingDataSimpleBuilder.h"    29 #include "ble/gap/AdvertisingDataTypes.h"    30 #include "ble/gap/AdvertisingParameters.h"    31 #include "ble/gap/ConnectionParameters.h"    32 #include "ble/gap/ScanParameters.h"    33 #include "ble/gap/Events.h"    34 #include "ble/gap/Types.h"    38 #if !defined(DOXYGEN_ONLY)    42 #endif // !defined(DOXYGEN_ONLY)   643 #if BLE_ROLE_BROADCASTER   652     uint8_t getMaxAdvertisingSetNumber();
   658     uint16_t getMaxAdvertisingDataLength();
   664     uint16_t getMaxConnectableAdvertisingDataLength();
   670     uint16_t getMaxActiveSetAdvertisingDataLength();
   672 #if BLE_FEATURE_EXTENDED_ADVERTISING   686         advertising_handle_t *handle,
   700     ble_error_t destroyAdvertisingSet(advertising_handle_t handle);
   701 #endif // BLE_FEATURE_EXTENDED_ADVERTISING   710         advertising_handle_t handle,
   728         advertising_handle_t handle,
   747         advertising_handle_t handle,
   767         advertising_handle_t handle,
   768         adv_duration_t maxDuration = adv_duration_t::forever(),
   769         uint8_t maxEvents = 0
   780     ble_error_t stopAdvertising(advertising_handle_t handle);
   787     bool isAdvertisingActive(advertising_handle_t handle);
   788 #endif // BLE_ROLE_BROADCASTER   790 #if BLE_ROLE_BROADCASTER   791 #if BLE_FEATURE_PERIODIC_ADVERTISING   803         advertising_handle_t handle,
   804         periodic_interval_t periodicAdvertisingIntervalMin,
   805         periodic_interval_t periodicAdvertisingIntervalMax,
   806         bool advertiseTxPower = 
true   825         advertising_handle_t handle,
   837     ble_error_t startPeriodicAdvertising(advertising_handle_t handle);
   846     ble_error_t stopPeriodicAdvertising(advertising_handle_t handle);
   855     bool isPeriodicAdvertisingActive(advertising_handle_t handle);
   856 #endif // BLE_ROLE_BROADCASTER   857 #endif // BLE_FEATURE_PERIODIC_ADVERTISING   860 #if BLE_ROLE_OBSERVER   885         scan_duration_t duration = scan_duration_t::forever(),
   886         duplicates_filter_t filtering = duplicates_filter_t::DISABLE,
   887         scan_period_t period = scan_period_t(0)
   898 #endif // BLE_ROLE_OBSERVER   900 #if BLE_ROLE_OBSERVER   901 #if BLE_FEATURE_PERIODIC_ADVERTISING   927         slave_latency_t maxPacketSkip,
   928         sync_timeout_t timeout
   950         slave_latency_t maxPacketSkip,
   951         sync_timeout_t timeout
   965     ble_error_t terminateSync(periodic_sync_handle_t handle);
   977         advertising_sid_t sid
   987     ble_error_t removeDeviceFromPeriodicAdvertiserList(
   990         advertising_sid_t sid
  1002     uint8_t getMaxPeriodicAdvertiserListSize();
  1003 #endif // BLE_ROLE_OBSERVER  1004 #endif // BLE_FEATURE_PERIODIC_ADVERTISING  1006 #if BLE_ROLE_CENTRAL  1040 #endif // BLE_ROLE_CENTRAL  1042 #if BLE_FEATURE_CONNECTABLE  1071         conn_interval_t minConnectionInterval,
  1072         conn_interval_t maxConnectionInterval,
  1073         slave_latency_t slaveLatency,
  1074         supervision_timeout_t supervision_timeout,
  1075         conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
  1076         conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
  1100     ble_error_t manageConnectionParametersUpdateRequest(
  1101         bool userManageConnectionUpdateRequest
  1135         conn_interval_t minConnectionInterval,
  1136         conn_interval_t maxConnectionInterval,
  1137         slave_latency_t slaveLatency,
  1138         supervision_timeout_t supervision_timeout,
  1139         conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
  1140         conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
  1181         local_disconnection_reason_t reason
  1183 #endif // BLE_FEATURE_CONNECTABLE  1184 #if BLE_FEATURE_PHY_MANAGEMENT  1253 #endif // BLE_FEATURE_PHY_MANAGEMENT  1255 #if BLE_FEATURE_PRIVACY  1301 #if BLE_ROLE_BROADCASTER  1310         const peripheral_privacy_configuration_t *configuration
  1322         peripheral_privacy_configuration_t *configuration
  1324 #endif // BLE_ROLE_BROADCASTER  1326 #if BLE_ROLE_OBSERVER  1335         const central_privacy_configuration_t *configuration
  1347         central_privacy_configuration_t *configuration
  1349 #endif // BLE_ROLE_OBSERVER  1350 #endif // BLE_FEATURE_PRIVACY  1352 #if BLE_FEATURE_WHITELIST  1358     uint8_t getMaxWhitelistSize() 
const;
  1391 #endif // BLE_FEATURE_WHITELIST  1405         own_address_type_t &typeP,
  1456     void onShutdown(
const GapShutdownCallback_t &
callback);
  1464     template<
typename T>
  1466         onShutdown(GapShutdownCallback_t(objPtr, memberPtr));
  1480 #if !defined(DOXYGEN_ONLY)  1484     Gap(impl::Gap* impl) : impl(impl) {}
  1489     Gap(
const Gap&) = 
delete;
  1490     Gap& operator=(
const Gap&) = 
delete;
  1500 #endif // !defined(DOXYGEN_ONLY)  1516 #endif // BLE_GAP_GAP_H Event generated when a connection initiation ends (successfully or not). 
Function like object adapter over freestanding and member functions. 
Event produced when advertising ends. 
virtual void onPrivacyEnabled()
Function invoked when the privacy subsystem has been enabled and is ready to be used. 
virtual void onScanRequestReceived(const ScanRequestEvent &event)
Called when an advertising device receive a scan request. 
Define device discovery, connection and link management procedures. 
Event received when connection parameters have been updated. 
Event generated when periodic advertising sync is lost. 
uintptr_t connection_handle_t
Opaque reference to a connection. 
virtual void onReadPhy(ble_error_t status, connection_handle_t connectionHandle, phy_t txPhy, phy_t rxPhy)
Function invoked when the current transmitter and receiver PHY have been read for a given connection...
Event produced when advertising start. 
Event generated when an advertising packet is seen during passive scanning or a scan response is rece...
virtual void onUpdateConnectionParametersRequest(const UpdateConnectionParametersRequestEvent &event)
Called when the peer request connection parameters updates. 
Type that describes a random device address type. 
Type describing the number of symbols per bit in le coded PHY. 
virtual void onConnectionComplete(const ConnectionCompleteEvent &event)
Called when connection attempt ends. 
virtual void onDataLengthChange(connection_handle_t connectionHandle, uint16_t txSize, uint16_t rxSize)
Function invoked when the connections changes the maximum number of octets that can be sent or receiv...
Representation of a whitelist of addresses. 
virtual void onAdvertisingStart(const AdvertisingStartEvent &event)
Called when advertising starts. 
Parameters defining the scan process. 
Type that describes a bluetooth PHY(sical) transport. 
uint16_t maxConnectionInterval
Maximum interval between two connection events allowed for a connection. 
Parameters defining the connection initiation process. 
virtual void onAdvertisingEnd(const AdvertisingEndEvent &event)
Called when advertising ends. 
CallChainOfFunctionPointersWithContext< const Gap * > GapShutdownCallbackChain_t
Callchain of gap shutdown event handler. 
virtual void onScanTimeout(const ScanTimeoutEvent &event)
Called when scan times out. 
virtual void onConnectionParametersUpdateComplete(const ConnectionParametersUpdateCompleteEvent &event)
Called when connection parameters have been updated. 
uint16_t slaveLatency
Number of connection events the slave can drop if it has nothing to communicate to the master...
Event generated when you first receive a periodic advertisement. 
Preferred connection parameter display in Generic Access Service. 
FunctionPointerWithContext< const Gap * > GapShutdownCallback_t
Gap shutdown event handler. 
uint16_t connectionSupervisionTimeout
Link supervision timeout for the connection. 
Type that describes a peer device address type. 
Event generated when scan times out. 
Event produced when a disconnection is complete. 
uint16_t minConnectionInterval
Minimum interval between two connection events allowed for a connection. 
Type that describe a set of PHY(sical) transports. 
Parameters defining the advertising process. 
Definition of the general handler of Gap related events. 
virtual void onDisconnectionComplete(const DisconnectionCompleteEvent &event)
Called when a connection has been disconnected. 
Function like object hosting a list of FunctionPointerWithContext. 
Event generated when periodic advertising packet is received. 
void onShutdown(T *objPtr, void(T::*memberPtr)(const Gap *))
Register a Gap shutdown event handler. 
Event received when a peer wants to change the connection parameters. 
virtual void onPeriodicAdvertisingSyncLoss(const PeriodicAdvertisingSyncLoss &event)
Called when a periodic advertising sync has been lost. 
virtual void onPeriodicAdvertisingReport(const PeriodicAdvertisingReportEvent &event)
Called when a periodic advertising packet is received. 
virtual void onAdvertisingReport(const AdvertisingReportEvent &event)
Called when a scanner receives an advertising or a scan response packet. 
virtual void onPhyUpdateComplete(ble_error_t status, connection_handle_t connectionHandle, phy_t txPhy, phy_t rxPhy)
Function invoked when the update process of the PHY has been completed. 
Entry namespace for all BLE API definitions. 
Features supported by the controller. 
Event produced when a peer requests a scan response from the advertiser. 
virtual void onPeriodicAdvertisingSyncEstablished(const PeriodicAdvertisingSyncEstablishedEvent &event)
Called when first advertising packet in periodic advertising is received. 
ble_error_t
Error codes for the BLE API.