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,
72 peerAddress(peerAddress),
74 peerAddressType(peerAddressType),
75 primaryPhy(primaryPhy),
76 secondaryPhy(secondaryPhy),
79 periodicInterval(periodicInterval),
81 directAddressType(directAddressType),
82 directAddress(directAddress),
83 advertisingData(advertisingData)
89 const advertising_event_t &
getType()
const 97 return peerAddressType;
138 return periodicInterval != 0;
144 return periodic_interval_t(periodicInterval);
150 return directAddressType;
156 return directAddress;
162 return advertisingData;
170 peerAddress = newPeerAddress;
179 peerAddressType = newPeerAddressType;
187 advertisingData = newAdvertisingData;
192 advertising_event_t type;
196 advertising_sid_t SID;
197 advertising_power_t txPower;
198 uint16_t periodicInterval;
212 #if !defined(DOXYGEN_ONLY) 231 connection_role_t ownRole,
234 const address_t &localResolvablePrivateAddress,
235 const address_t &peerResolvablePrivateAddress,
236 conn_interval_t connectionInterval,
237 slave_latency_t connectionLatency,
238 supervision_timeout_t supervisionTimeout,
239 uint16_t masterClockAccuracy
242 connectionHandle(connectionHandle),
243 peerAddress(peerAddress),
245 peerAddressType(peerAddressType),
246 localResolvablePrivateAddress(localResolvablePrivateAddress),
247 connectionInterval(connectionInterval),
248 peerResolvablePrivateAddress(peerResolvablePrivateAddress),
249 connectionLatency(connectionLatency),
250 supervisionTimeout(supervisionTimeout),
251 masterClockAccuracy(masterClockAccuracy)
266 return connectionHandle;
278 return peerAddressType;
290 return localResolvablePrivateAddress;
296 return peerResolvablePrivateAddress;
302 return connectionInterval;
308 return connectionLatency;
314 return supervisionTimeout;
320 return masterClockAccuracy;
333 peerAddressType = address_type;
339 peerAddress = address;
345 localResolvablePrivateAddress = address;
351 peerResolvablePrivateAddress = address;
358 connection_role_t ownRole;
361 conn_interval_t connectionInterval;
363 slave_latency_t connectionLatency;
364 supervision_timeout_t supervisionTimeout;
365 uint16_t masterClockAccuracy;
374 #if !defined(DOXYGEN_ONLY) 389 periodic_sync_handle_t syncHandle,
390 advertising_sid_t sid,
393 const phy_t &peerPhy,
394 uint16_t advertisingInterval,
395 const clock_accuracy_t &peerClockAccuracy
398 syncHandle(syncHandle),
400 peerAddressType(peerAddressType),
401 peerAddress(peerAddress),
403 advertisingInterval(advertisingInterval),
404 peerClockAccuracy(peerClockAccuracy)
431 return peerAddressType;
449 return advertisingInterval;
455 return peerClockAccuracy;
460 periodic_sync_handle_t syncHandle;
461 advertising_sid_t sid;
465 uint16_t advertisingInterval;
466 clock_accuracy_t peerClockAccuracy;
475 #if !defined(DOXYGEN_ONLY) 486 periodic_sync_handle_t syncHandle,
487 advertising_power_t txPower,
489 advertising_data_status_t dataStatus,
492 syncHandle(syncHandle),
495 dataStatus(dataStatus),
533 periodic_sync_handle_t syncHandle;
534 advertising_power_t txPower;
536 advertising_data_status_t dataStatus;
546 #if !defined(DOXYGEN_ONLY) 553 periodic_sync_handle_t syncHandle
555 syncHandle(syncHandle)
568 periodic_sync_handle_t syncHandle;
584 #if !defined(DOXYGEN_ONLY) 592 advHandle(advHandle), status(status)
611 advertising_handle_t advHandle;
625 #if !defined(DOXYGEN_ONLY) 641 advertising_handle_t advHandle,
643 uint8_t completed_events,
647 advHandle(advHandle),
648 connection(connection),
649 completed_events(completed_events),
650 connected(connected),
685 return completed_events;
712 advertising_handle_t advHandle;
714 uint8_t completed_events;
726 #if !defined(DOXYGEN_ONLY) 735 advertising_handle_t advHandle,
739 advHandle(advHandle),
740 peerAddressType(peerAddressType),
741 peerAddress(peerAddress)
756 return peerAddressType;
766 advertising_handle_t advHandle;
777 #if !defined(DOXYGEN_ONLY) 781 const disconnection_reason_t &reason
783 connectionHandle(connectionHandle), reason(reason)
794 return connectionHandle;
807 ble::disconnection_reason_t reason;
816 #if !defined(DOXYGEN_ONLY) 820 const conn_interval_t &minConnectionInterval,
821 const conn_interval_t &maxConnectionInterval,
822 const slave_latency_t &slaveLatency,
823 const supervision_timeout_t &supervision_timeout
825 connectionHandle(connectionHandle),
826 minConnectionInterval(minConnectionInterval),
827 maxConnectionInterval(maxConnectionInterval),
828 slaveLatency(slaveLatency),
829 supervisionTimeout(supervision_timeout)
840 return connectionHandle;
848 return minConnectionInterval;
856 return maxConnectionInterval;
872 return supervisionTimeout;
877 ble::conn_interval_t minConnectionInterval;
878 ble::conn_interval_t maxConnectionInterval;
879 ble::slave_latency_t slaveLatency;
880 ble::supervision_timeout_t supervisionTimeout;
889 #if !defined(DOXYGEN_ONLY) 894 const conn_interval_t &connectionInterval,
895 const slave_latency_t &slaveLatency,
896 const supervision_timeout_t &supervisionTimeout
899 connectionHandle(connectionHandle),
900 connectionInterval(connectionInterval),
901 slaveLatency(slaveLatency),
902 supervisionTimeout(supervisionTimeout)
922 return connectionHandle;
930 return connectionInterval;
946 return supervisionTimeout;
952 ble::conn_interval_t connectionInterval;
953 ble::slave_latency_t slaveLatency;
954 ble::supervision_timeout_t supervisionTimeout;
965 #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).
void setPeerAddress(const address_t &newPeerAddress)
Set peer address.
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.
void setPeerAddressType(const peer_address_type_t &newPeerAddressType)
Set peer address type.
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.
void setAdvertisingData(const mbed::Span< const uint8_t > &newAdvertisingData)
Set new advertising payload.
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.
ble_error_t getStatus() const
Get status of operation.
const address_t & getPeerResolvablePrivateAddress() const
Get peer resolvable private address if privacy is used.
Event produced when advertising start.
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.
advertising_handle_t getAdvHandle() const
Get advertising handle.
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.
static const advertising_handle_t LEGACY_ADVERTISING_HANDLE
Special advertising set handle used for the legacy advertising set.
void setPeerResolvablePrivateAddress(const address_t &address)
Set peer resolvable private address if privacy is used.
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.
void setLocalResolvablePrivateAddress(const address_t &address)
Set get local resolvable random address if privacy is used.
bool isLegacy() const
Is the end of legacy advertising.
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.
void setPeerAddressType(const peer_address_type_t &address_type)
Set peer address type.
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.
void setStatus(ble_error_t new_status)
Set connection complete event status.
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.
ble_error_t getStatus() const
Get the result of the stop advertising event.
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.
void setPeerAddress(const address_t &address)
Set peer address.
advertising_sid_t getSid() const
Get advertising set identifier.
ble_error_t
Error codes for the BLE API.