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,
761 advertising_handle_t handle,
762 adv_duration_t maxDuration = adv_duration_t::forever(),
763 uint8_t maxEvents = 0
774 ble_error_t stopAdvertising(advertising_handle_t handle);
781 bool isAdvertisingActive(advertising_handle_t handle);
782 #endif // BLE_ROLE_BROADCASTER 784 #if BLE_ROLE_BROADCASTER 785 #if BLE_FEATURE_PERIODIC_ADVERTISING 797 advertising_handle_t handle,
798 periodic_interval_t periodicAdvertisingIntervalMin,
799 periodic_interval_t periodicAdvertisingIntervalMax,
800 bool advertiseTxPower =
true 819 advertising_handle_t handle,
831 ble_error_t startPeriodicAdvertising(advertising_handle_t handle);
840 ble_error_t stopPeriodicAdvertising(advertising_handle_t handle);
849 bool isPeriodicAdvertisingActive(advertising_handle_t handle);
850 #endif // BLE_ROLE_BROADCASTER 851 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 854 #if BLE_ROLE_OBSERVER 879 scan_duration_t duration = scan_duration_t::forever(),
880 duplicates_filter_t filtering = duplicates_filter_t::DISABLE,
881 scan_period_t period = scan_period_t(0)
892 #endif // BLE_ROLE_OBSERVER 894 #if BLE_ROLE_OBSERVER 895 #if BLE_FEATURE_PERIODIC_ADVERTISING 921 slave_latency_t maxPacketSkip,
922 sync_timeout_t timeout
944 slave_latency_t maxPacketSkip,
945 sync_timeout_t timeout
959 ble_error_t terminateSync(periodic_sync_handle_t handle);
971 advertising_sid_t sid
981 ble_error_t removeDeviceFromPeriodicAdvertiserList(
984 advertising_sid_t sid
996 uint8_t getMaxPeriodicAdvertiserListSize();
997 #endif // BLE_ROLE_OBSERVER 998 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 1000 #if BLE_ROLE_CENTRAL 1034 #endif // BLE_ROLE_CENTRAL 1036 #if BLE_FEATURE_CONNECTABLE 1065 conn_interval_t minConnectionInterval,
1066 conn_interval_t maxConnectionInterval,
1067 slave_latency_t slaveLatency,
1068 supervision_timeout_t supervision_timeout,
1069 conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
1070 conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
1093 ble_error_t manageConnectionParametersUpdateRequest(
1094 bool userManageConnectionUpdateRequest
1128 conn_interval_t minConnectionInterval,
1129 conn_interval_t maxConnectionInterval,
1130 slave_latency_t slaveLatency,
1131 supervision_timeout_t supervision_timeout,
1132 conn_event_length_t minConnectionEventLength = conn_event_length_t(0),
1133 conn_event_length_t maxConnectionEventLength = conn_event_length_t(0)
1174 local_disconnection_reason_t reason
1176 #endif // BLE_FEATURE_CONNECTABLE 1177 #if BLE_FEATURE_PHY_MANAGEMENT 1246 #endif // BLE_FEATURE_PHY_MANAGEMENT 1248 #if BLE_FEATURE_PRIVACY 1292 #if BLE_ROLE_BROADCASTER 1301 const peripheral_privacy_configuration_t *configuration
1313 peripheral_privacy_configuration_t *configuration
1315 #endif // BLE_ROLE_BROADCASTER 1317 #if BLE_ROLE_OBSERVER 1326 const central_privacy_configuration_t *configuration
1338 central_privacy_configuration_t *configuration
1340 #endif // BLE_ROLE_OBSERVER 1341 #endif // BLE_FEATURE_PRIVACY 1343 #if BLE_FEATURE_WHITELIST 1349 uint8_t getMaxWhitelistSize()
const;
1382 #endif // BLE_FEATURE_WHITELIST 1396 own_address_type_t &typeP,
1447 void onShutdown(
const GapShutdownCallback_t &
callback);
1455 template<
typename T>
1457 onShutdown(GapShutdownCallback_t(objPtr, memberPtr));
1471 #if !defined(DOXYGEN_ONLY) 1475 Gap(impl::Gap* impl) : impl(impl) {}
1480 Gap(
const Gap&) =
delete;
1481 Gap& operator=(
const Gap&) =
delete;
1491 #endif // !defined(DOXYGEN_ONLY) 1507 #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.