21 #include "ble/common/StaticInterface.h" 22 #include "ble/BLETypes.h" 23 #include "ble/BLEProtocol.h" 24 #include "ble/gap/AdvertisingDataBuilder.h" 25 #include "ble/gap/AdvertisingDataSimpleBuilder.h" 26 #include "ble/gap/ConnectionParameters.h" 27 #include "ble/gap/ScanParameters.h" 28 #include "ble/gap/AdvertisingParameters.h" 29 #include "ble/gap/Events.h" 32 #if !defined(DOXYGEN_ONLY) 274 #if defined(DOXYGEN_ONLY) 543 _eventHandler = handler;
554 #if BLE_ROLE_BROADCASTER 563 uint8_t getMaxAdvertisingSetNumber();
569 uint16_t getMaxAdvertisingDataLength();
575 uint16_t getMaxConnectableAdvertisingDataLength();
581 uint16_t getMaxActiveSetAdvertisingDataLength();
583 #if BLE_FEATURE_EXTENDED_ADVERTISING 612 #endif // BLE_FEATURE_EXTENDED_ADVERTISING 677 uint8_t maxEvents = 0
694 #endif // BLE_ROLE_BROADCASTER 696 #if BLE_ROLE_BROADCASTER 697 #if BLE_FEATURE_PERIODIC_ADVERTISING 712 bool advertiseTxPower =
true 762 #endif // BLE_ROLE_BROADCASTER 763 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 766 #if BLE_ROLE_OBSERVER 804 #endif // BLE_ROLE_OBSERVER 806 #if BLE_ROLE_OBSERVER 807 #if BLE_FEATURE_PERIODIC_ADVERTISING 893 ble_error_t removeDeviceFromPeriodicAdvertiserList(
908 uint8_t getMaxPeriodicAdvertiserListSize();
909 #endif // BLE_ROLE_OBSERVER 910 #endif // BLE_FEATURE_PERIODIC_ADVERTISING 945 #endif // BLE_ROLE_CENTRAL 947 #if BLE_FEATURE_CONNECTABLE 1004 ble_error_t manageConnectionParametersUpdateRequest(
1005 bool userManageConnectionUpdateRequest
1087 #endif // BLE_FEATURE_CONNECTABLE 1088 #if BLE_FEATURE_PHY_MANAGEMENT 1157 #endif // BLE_FEATURE_PHY_MANAGEMENT 1172 #if BLE_FEATURE_PRIVACY 1208 #if BLE_ROLE_BROADCASTER 1231 #endif // BLE_ROLE_BROADCASTER 1233 #if BLE_ROLE_OBSERVER 1256 #endif // BLE_ROLE_OBSERVER 1257 #endif // BLE_FEATURE_PRIVACY 1259 #if !defined(DOXYGEN_ONLY) 1264 void useVersionOneAPI()
const;
1269 void useVersionTwoAPI()
const;
1279 uint8_t getMaxAdvertisingSetNumber_();
1280 uint16_t getMaxAdvertisingDataLength_();
1281 uint16_t getMaxConnectableAdvertisingDataLength_();
1282 uint16_t getMaxActiveSetAdvertisingDataLength_();
1311 bool advertiseTxPower
1345 ble_error_t removeDeviceFromPeriodicAdvertiserList_(
1351 uint8_t getMaxPeriodicAdvertiserListSize_();
1367 ble_error_t manageConnectionParametersUpdateRequest_(
1368 bool userManageConnectionUpdateRequest
1410 void useVersionOneAPI_()
const;
1411 void useVersionTwoAPI_()
const;
1419 #endif // !defined(DOXYGEN_ONLY) 1427 #if !defined(DOXYGEN_ONLY) 1432 #endif //BLE_GAP_GAP_H Event generated when a connection initiation ends (successfully or not).
Disable duplicate filtering.
static Duration forever()
Return the Duration value meaning forever.
static const central_privay_configuration_t default_central_privacy_configuration
Default peripheral privacy configuration.
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...
Static Interface helper class.
void setEventHandler(EventHandler *handler)
Assign the event handler implementation that will be used by the gap module to signal events back to ...
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.
uint16_t periodic_sync_handle_t
Handle of a sync representing a periodic advertiser.
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.
Duration< uint16_t, 625, Range< 0, 0xFFFF > > conn_event_length_t
Duration of a connection event.
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...
uint8_t advertising_sid_t
Identify an advertising SID.
Parameters defining the scan process.
Type that describes a bluetooth PHY(sical) transport.
~EventHandler()
Prevent polymorphic deletion and avoid unnecessary virtual destructor as the Gap class will never del...
Duration< uint16_t, 1280000, Range< 0x00, 0xFFFF > > scan_period_t
Time interval between two scan processes.
Enumeration of disconnection reasons that should be transmited to the peer.
Parameters defining the connection initiation process.
virtual void onAdvertisingEnd(const AdvertisingEndEvent &event)
Called when advertising ends.
uint8_t advertising_handle_t
Handle of an advertising set.
virtual void onScanTimeout(const ScanTimeoutEvent &event)
Called when scan times out.
virtual void onConnectionParametersUpdateComplete(const ConnectionParametersUpdateCompleteEvent &event)
Called when connection parameters have been updated.
Event generated when you first receive a periodic advertisement.
static const peripheral_privacy_configuration_t default_peripheral_privacy_configuration
Default peripheral privacy configuration.
Scanning policy filter mode.
Type that describes a peer device address type.
Event generated when scan times out.
Event produced when a disconnection is complete.
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.
Event generated when periodic advertising packet is received.
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.
Privacy configuration of the central role.
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.
Privacy Configuration of the peripheral role.
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.