19 #ifndef BLE_GAP_EVENTS_H 20 #define BLE_GAP_EVENTS_H 22 #include "ble/common/blecommon.h" 23 #include "ble/common/BLETypes.h" 41 #if !defined(DOXYGEN_ONLY) 59 const advertising_event_t &type,
62 const phy_t &primaryPhy,
63 const phy_t &secondaryPhy,
64 advertising_sid_t SID,
65 advertising_power_t txPower,
67 uint16_t periodicInterval,
73 peerAddressType(peerAddressType),
74 peerAddress(peerAddress),
75 primaryPhy(primaryPhy),
76 secondaryPhy(secondaryPhy),
80 periodicInterval(periodicInterval),
81 directAddressType(directAddressType),
82 directAddress(directAddress),
83 advertisingData(advertisingData)
90 const advertising_event_t &
getType()
const 98 return peerAddressType;
139 return periodicInterval != 0;
145 return periodic_interval_t(periodicInterval);
151 return directAddressType;
157 return directAddress;
163 return advertisingData;
167 advertising_event_t type;
172 advertising_sid_t SID;
173 advertising_power_t txPower;
175 uint16_t periodicInterval;
187 #if !defined(DOXYGEN_ONLY) 206 connection_role_t ownRole,
209 const address_t &localResolvablePrivateAddress,
210 const address_t &peerResolvablePrivateAddress,
211 conn_interval_t connectionInterval,
212 slave_latency_t connectionLatency,
213 supervision_timeout_t supervisionTimeout,
214 uint16_t masterClockAccuracy
217 connectionHandle(connectionHandle),
219 peerAddressType(peerAddressType),
220 peerAddress(peerAddress),
221 localResolvablePrivateAddress(localResolvablePrivateAddress),
222 peerResolvablePrivateAddress(peerResolvablePrivateAddress),
223 connectionInterval(connectionInterval),
224 connectionLatency(connectionLatency),
225 supervisionTimeout(supervisionTimeout),
226 masterClockAccuracy(masterClockAccuracy)
241 return connectionHandle;
253 return peerAddressType;
265 return localResolvablePrivateAddress;
271 return peerResolvablePrivateAddress;
277 return connectionInterval;
283 return connectionLatency;
289 return supervisionTimeout;
295 return masterClockAccuracy;
301 connection_role_t ownRole;
304 const address_t &localResolvablePrivateAddress;
305 const address_t &peerResolvablePrivateAddress;
306 conn_interval_t connectionInterval;
307 slave_latency_t connectionLatency;
308 supervision_timeout_t supervisionTimeout;
309 uint16_t masterClockAccuracy;
318 #if !defined(DOXYGEN_ONLY) 333 periodic_sync_handle_t syncHandle,
334 advertising_sid_t sid,
337 const phy_t &peerPhy,
338 uint16_t advertisingInterval,
339 const clock_accuracy_t &peerClockAccuracy
342 syncHandle(syncHandle),
344 peerAddressType(peerAddressType),
345 peerAddress(peerAddress),
347 advertisingInterval(advertisingInterval),
348 peerClockAccuracy(peerClockAccuracy)
375 return peerAddressType;
393 return advertisingInterval;
399 return peerClockAccuracy;
404 periodic_sync_handle_t syncHandle;
405 advertising_sid_t sid;
409 uint16_t advertisingInterval;
410 clock_accuracy_t peerClockAccuracy;
419 #if !defined(DOXYGEN_ONLY) 430 periodic_sync_handle_t syncHandle,
431 advertising_power_t txPower,
433 advertising_data_status_t dataStatus,
436 syncHandle(syncHandle),
439 dataStatus(dataStatus),
477 periodic_sync_handle_t syncHandle;
478 advertising_power_t txPower;
480 advertising_data_status_t dataStatus;
490 #if !defined(DOXYGEN_ONLY) 497 periodic_sync_handle_t syncHandle
499 syncHandle(syncHandle)
512 periodic_sync_handle_t syncHandle;
528 #if !defined(DOXYGEN_ONLY) 538 advertising_handle_t advHandle,
540 uint8_t completed_events,
543 advHandle(advHandle),
544 connection(connection),
545 completed_events(completed_events),
567 return completed_events;
577 advertising_handle_t advHandle;
579 uint8_t completed_events;
589 #if !defined(DOXYGEN_ONLY) 598 advertising_handle_t advHandle,
602 advHandle(advHandle),
603 peerAddressType(peerAddressType),
604 peerAddress(peerAddress)
619 return peerAddressType;
629 advertising_handle_t advHandle;
640 #if !defined(DOXYGEN_ONLY) 644 const disconnection_reason_t &reason
646 connectionHandle(connectionHandle), reason(reason)
657 return connectionHandle;
670 ble::disconnection_reason_t reason;
679 #if !defined(DOXYGEN_ONLY) 683 const conn_interval_t &minConnectionInterval,
684 const conn_interval_t &maxConnectionInterval,
685 const slave_latency_t &slaveLatency,
686 const supervision_timeout_t &supervision_timeout
688 connectionHandle(connectionHandle),
689 minConnectionInterval(minConnectionInterval),
690 maxConnectionInterval(maxConnectionInterval),
691 slaveLatency(slaveLatency),
692 supervisionTimeout(supervision_timeout)
703 return connectionHandle;
711 return minConnectionInterval;
719 return maxConnectionInterval;
735 return supervisionTimeout;
740 ble::conn_interval_t minConnectionInterval;
741 ble::conn_interval_t maxConnectionInterval;
742 ble::slave_latency_t slaveLatency;
743 ble::supervision_timeout_t supervisionTimeout;
752 #if !defined(DOXYGEN_ONLY) 757 const conn_interval_t &connectionInterval,
758 const slave_latency_t &slaveLatency,
759 const supervision_timeout_t &supervisionTimeout
762 connectionHandle(connectionHandle),
763 connectionInterval(connectionInterval),
764 slaveLatency(slaveLatency),
765 supervisionTimeout(supervisionTimeout)
785 return connectionHandle;
793 return connectionInterval;
809 return supervisionTimeout;
815 ble::conn_interval_t connectionInterval;
816 ble::slave_latency_t slaveLatency;
817 ble::supervision_timeout_t supervisionTimeout;
828 #endif //BLE_GAP_EVENTS_H const disconnection_reason_t & getReason() const
Get the reason of the disconnection.
Event generated when a connection initiation ends (successfully or not).
uint16_t getMasterClockAccuracy() const
Get clock accuracy in parts per million.
rssi_t getRssi() const
Get received signal strength.
periodic_sync_handle_t getSyncHandle() const
Get periodic advertising sync handle.
Event produced when advertising ends.
const clock_accuracy_t & getPeerClockAccuracy() const
Get clock accuracy in parts per million.
Event received when connection parameters have been updated.
ble_error_t getStatus() const
Get connection complete event status.
Event generated when periodic advertising sync is lost.
advertising_handle_t getAdvHandle() const
Get advertising handle.
uintptr_t connection_handle_t
Opaque reference to a connection.
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
uint8_t getCompleted_events() const
Get how many events advertising created.
const address_t & getPeerResolvablePrivateAddress() const
Get peer resolvable private address if privacy is used.
advertising_power_t getTxPower() const
Get TX power.
Event generated when an advertising packet is seen during passive scanning or a scan response is rece...
connection_handle_t getConnectionHandle() const
Get the connection handle.
const conn_interval_t & getMinConnectionInterval() const
Get the minimum connection interval requested.
bool isPeriodicIntervalPresent() const
Indicate if periodic interval is valid.
const slave_latency_t & getSlaveLatency() const
Get the new slave latency.
uint16_t getAdvertisingInterval() const
Get interval.
const conn_interval_t & getMaxConnectionInterval() const
Get the maximum connection interval requested.
rssi_t getRssi() const
Get received signal strength.
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
const advertising_data_status_t & getDataStatus() const
Get data completeness status.
connection_handle_t getConnectionHandle() const
Get the handle of the connection that has been updated.
const address_t & getPeerAddress() const
Get peer address.
const conn_interval_t & getConnectionInterval() const
Get the new connection interval.
connection_role_t getOwnRole() const
Get own role.
const supervision_timeout_t & getSupervisionTimeout() const
Get the new supervision timeout.
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
connection_handle_t getConnectionHandle() const
Get connection handle (valid only when successful).
ble_error_t getStatus() const
Get sync establishment status.
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
ble_error_t getStatus() const
Get the status of the operation.
advertising_sid_t getSID() const
Get advertising set identifier.
advertising_handle_t getAdvHandle() const
Get advertising handle.
const address_t & getDirectAddress() const
Get target address in directed advertising.
Type that describes a bluetooth PHY(sical) transport.
const supervision_timeout_t & getSupervisionTimeout() const
Get the supervision timeout requested.
const mbed::Span< const uint8_t > & getPayload() const
Get payload.
Event generated when you first receive a periodic advertisement.
const mbed::Span< const uint8_t > & getPayload() const
Get payload.
periodic_interval_t getPeriodicInterval() const
Get interval.
const phy_t & getSecondaryPhy() const
Get secondary PHY.
const phy_t & getPeerPhy() const
Get PHY used.
Type that describes a peer device address type.
Event generated when scan times out.
Event produced when a disconnection is complete.
const address_t & getPeerAddress() const
Get peer address.
const peer_address_type_t & getDirectAddressType() const
Get target address type in directed advertising.
advertising_power_t getTxPower() const
Get TX power as reported by the advertising packet.
Event generated when periodic advertising packet is received.
bool isConnected() const
Has the advertising ended with a connection.
periodic_sync_handle_t getSyncHandle() const
Get periodic advertising sync handle.
Event received when a peer wants to change the connection parameters.
connection_handle_t getConnectionHandle() const
Get the handle of the connection that has expired.
slave_latency_t getConnectionLatency() const
Get connection latency.
const phy_t & getPrimaryPhy() const
Get primary PHY.
periodic_sync_handle_t getSyncHandle() const
Get periodic sync handle.
connection_handle_t getConnection() const
Get connection handle (valid only if connected successfully).
const address_t & getPeerAddress() const
Get peer address.
conn_interval_t getConnectionInterval() const
Get connection interval.
Entry namespace for all BLE API definitions.
const slave_latency_t & getSlaveLatency() const
Get the slave latency requested.
const advertising_event_t & getType() const
Get event type.
const address_t & getPeerAddress() const
Get peer address.
Event produced when a peer requests a scan response from the advertiser.
const address_t & getLocalResolvablePrivateAddress() const
Get get local resolvable random address if privacy is used.
supervision_timeout_t getSupervisionTimeout() const
Get supervision timeout.
advertising_sid_t getSid() const
Get advertising set identifier.
ble_error_t
Error codes for the BLE API.