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) 612 #if BLE_ROLE_BROADCASTER 621 uint8_t getMaxAdvertisingSetNumber();
627 uint16_t getMaxAdvertisingDataLength();
633 uint16_t getMaxConnectableAdvertisingDataLength();
639 uint16_t getMaxActiveSetAdvertisingDataLength();
641 #if BLE_FEATURE_EXTENDED_ADVERTISING 655 advertising_handle_t *handle,
669 ble_error_t destroyAdvertisingSet(advertising_handle_t handle);
670 #endif // BLE_FEATURE_EXTENDED_ADVERTISING 679 advertising_handle_t handle,
697 advertising_handle_t handle,
716 advertising_handle_t handle,
733 advertising_handle_t handle,
734 adv_duration_t maxDuration = adv_duration_t::forever(),
735 uint8_t maxEvents = 0
744 ble_error_t stopAdvertising(advertising_handle_t handle);
751 bool isAdvertisingActive(advertising_handle_t handle);
752 #endif // BLE_ROLE_BROADCASTER 754 #if BLE_ROLE_BROADCASTER 755 #if BLE_FEATURE_PERIODIC_ADVERTISING 767 advertising_handle_t handle,
768 periodic_interval_t periodicAdvertisingIntervalMin,
769 periodic_interval_t periodicAdvertisingIntervalMax,
770 bool advertiseTxPower =
true 789 advertising_handle_t handle,
801 ble_error_t startPeriodicAdvertising(advertising_handle_t handle);
810 ble_error_t stopPeriodicAdvertising(advertising_handle_t handle);
819 bool isPeriodicAdvertisingActive(advertising_handle_t handle);
820 #endif // BLE_ROLE_BROADCASTER 821 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 824 #if BLE_ROLE_OBSERVER 849 scan_duration_t duration = scan_duration_t::forever(),
850 duplicates_filter_t filtering = duplicates_filter_t::DISABLE,
851 scan_period_t period = scan_period_t(0)
862 #endif // BLE_ROLE_OBSERVER 864 #if BLE_ROLE_OBSERVER 865 #if BLE_FEATURE_PERIODIC_ADVERTISING 891 slave_latency_t maxPacketSkip,
892 sync_timeout_t timeout
914 slave_latency_t maxPacketSkip,
915 sync_timeout_t timeout
929 ble_error_t terminateSync(periodic_sync_handle_t handle);
941 advertising_sid_t sid
951 ble_error_t removeDeviceFromPeriodicAdvertiserList(
954 advertising_sid_t sid
966 uint8_t getMaxPeriodicAdvertiserListSize();
967 #endif // BLE_ROLE_OBSERVER 968 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 1004 #endif // BLE_ROLE_CENTRAL 1006 #if BLE_FEATURE_CONNECTABLE 1035 conn_interval_t minConnectionInterval,
1036 conn_interval_t maxConnectionInterval,
1037 slave_latency_t slaveLatency,
1038 supervision_timeout_t supervision_timeout,
1039 conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
1040 conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
1063 ble_error_t manageConnectionParametersUpdateRequest(
1064 bool userManageConnectionUpdateRequest
1098 conn_interval_t minConnectionInterval,
1099 conn_interval_t maxConnectionInterval,
1100 slave_latency_t slaveLatency,
1101 supervision_timeout_t supervision_timeout,
1102 conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
1103 conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
1144 local_disconnection_reason_t reason
1146 #endif // BLE_FEATURE_CONNECTABLE 1147 #if BLE_FEATURE_PHY_MANAGEMENT 1216 #endif // BLE_FEATURE_PHY_MANAGEMENT 1218 #if BLE_FEATURE_PRIVACY 1254 #if BLE_ROLE_BROADCASTER 1263 const peripheral_privacy_configuration_t *configuration
1275 peripheral_privacy_configuration_t *configuration
1277 #endif // BLE_ROLE_BROADCASTER 1279 #if BLE_ROLE_OBSERVER 1288 const central_privacy_configuration_t *configuration
1300 central_privacy_configuration_t *configuration
1302 #endif // BLE_ROLE_OBSERVER 1303 #endif // BLE_FEATURE_PRIVACY 1305 #if BLE_FEATURE_WHITELIST 1311 uint8_t getMaxWhitelistSize()
const;
1344 #endif // BLE_FEATURE_WHITELIST 1358 own_address_type_t &typeP,
1409 void onShutdown(
const GapShutdownCallback_t &
callback);
1417 template<
typename T>
1419 onShutdown(GapShutdownCallback_t(objPtr, memberPtr));
1433 #if !defined(DOXYGEN_ONLY) 1437 Gap(impl::Gap* impl) : impl(impl) {}
1442 Gap(
const Gap&) =
delete;
1443 Gap& operator=(
const Gap&) =
delete;
1451 #endif // !defined(DOXYGEN_ONLY) 1467 #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 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 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.
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.