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) 637 #if BLE_ROLE_BROADCASTER 646 uint8_t getMaxAdvertisingSetNumber();
652 uint16_t getMaxAdvertisingDataLength();
658 uint16_t getMaxConnectableAdvertisingDataLength();
664 uint16_t getMaxActiveSetAdvertisingDataLength();
666 #if BLE_FEATURE_EXTENDED_ADVERTISING 680 advertising_handle_t *handle,
694 ble_error_t destroyAdvertisingSet(advertising_handle_t handle);
695 #endif // BLE_FEATURE_EXTENDED_ADVERTISING 704 advertising_handle_t handle,
722 advertising_handle_t handle,
741 advertising_handle_t handle,
759 advertising_handle_t handle,
760 adv_duration_t maxDuration = adv_duration_t::forever(),
761 uint8_t maxEvents = 0
770 ble_error_t stopAdvertising(advertising_handle_t handle);
777 bool isAdvertisingActive(advertising_handle_t handle);
778 #endif // BLE_ROLE_BROADCASTER 780 #if BLE_ROLE_BROADCASTER 781 #if BLE_FEATURE_PERIODIC_ADVERTISING 793 advertising_handle_t handle,
794 periodic_interval_t periodicAdvertisingIntervalMin,
795 periodic_interval_t periodicAdvertisingIntervalMax,
796 bool advertiseTxPower =
true 815 advertising_handle_t handle,
827 ble_error_t startPeriodicAdvertising(advertising_handle_t handle);
836 ble_error_t stopPeriodicAdvertising(advertising_handle_t handle);
845 bool isPeriodicAdvertisingActive(advertising_handle_t handle);
846 #endif // BLE_ROLE_BROADCASTER 847 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 850 #if BLE_ROLE_OBSERVER 875 scan_duration_t duration = scan_duration_t::forever(),
876 duplicates_filter_t filtering = duplicates_filter_t::DISABLE,
877 scan_period_t period = scan_period_t(0)
888 #endif // BLE_ROLE_OBSERVER 890 #if BLE_ROLE_OBSERVER 891 #if BLE_FEATURE_PERIODIC_ADVERTISING 917 slave_latency_t maxPacketSkip,
918 sync_timeout_t timeout
940 slave_latency_t maxPacketSkip,
941 sync_timeout_t timeout
955 ble_error_t terminateSync(periodic_sync_handle_t handle);
967 advertising_sid_t sid
977 ble_error_t removeDeviceFromPeriodicAdvertiserList(
980 advertising_sid_t sid
992 uint8_t getMaxPeriodicAdvertiserListSize();
993 #endif // BLE_ROLE_OBSERVER 994 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 1030 #endif // BLE_ROLE_CENTRAL 1032 #if BLE_FEATURE_CONNECTABLE 1061 conn_interval_t minConnectionInterval,
1062 conn_interval_t maxConnectionInterval,
1063 slave_latency_t slaveLatency,
1064 supervision_timeout_t supervision_timeout,
1065 conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
1066 conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
1089 ble_error_t manageConnectionParametersUpdateRequest(
1090 bool userManageConnectionUpdateRequest
1124 conn_interval_t minConnectionInterval,
1125 conn_interval_t maxConnectionInterval,
1126 slave_latency_t slaveLatency,
1127 supervision_timeout_t supervision_timeout,
1128 conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
1129 conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
1170 local_disconnection_reason_t reason
1172 #endif // BLE_FEATURE_CONNECTABLE 1173 #if BLE_FEATURE_PHY_MANAGEMENT 1242 #endif // BLE_FEATURE_PHY_MANAGEMENT 1244 #if BLE_FEATURE_PRIVACY 1288 #if BLE_ROLE_BROADCASTER 1297 const peripheral_privacy_configuration_t *configuration
1309 peripheral_privacy_configuration_t *configuration
1311 #endif // BLE_ROLE_BROADCASTER 1313 #if BLE_ROLE_OBSERVER 1322 const central_privacy_configuration_t *configuration
1334 central_privacy_configuration_t *configuration
1336 #endif // BLE_ROLE_OBSERVER 1337 #endif // BLE_FEATURE_PRIVACY 1339 #if BLE_FEATURE_WHITELIST 1345 uint8_t getMaxWhitelistSize()
const;
1378 #endif // BLE_FEATURE_WHITELIST 1392 own_address_type_t &typeP,
1443 void onShutdown(
const GapShutdownCallback_t &
callback);
1451 template<
typename T>
1453 onShutdown(GapShutdownCallback_t(objPtr, memberPtr));
1467 #if !defined(DOXYGEN_ONLY) 1471 Gap(impl::Gap* impl) : impl(impl) {}
1476 Gap(
const Gap&) =
delete;
1477 Gap& operator=(
const Gap&) =
delete;
1487 #endif // !defined(DOXYGEN_ONLY) 1503 #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 response.
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 or an advertising device has been connected.
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.