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) 604 advertising_handle_t advHandle;
616 #if !defined(DOXYGEN_ONLY) 626 advertising_handle_t advHandle,
628 uint8_t completed_events,
631 advHandle(advHandle),
632 connection(connection),
633 completed_events(completed_events),
634 connected(connected),
667 return completed_events;
687 advertising_handle_t advHandle;
689 uint8_t completed_events;
700 #if !defined(DOXYGEN_ONLY) 709 advertising_handle_t advHandle,
713 advHandle(advHandle),
714 peerAddressType(peerAddressType),
715 peerAddress(peerAddress)
730 return peerAddressType;
740 advertising_handle_t advHandle;
751 #if !defined(DOXYGEN_ONLY) 755 const disconnection_reason_t &reason
757 connectionHandle(connectionHandle), reason(reason)
768 return connectionHandle;
781 ble::disconnection_reason_t reason;
790 #if !defined(DOXYGEN_ONLY) 794 const conn_interval_t &minConnectionInterval,
795 const conn_interval_t &maxConnectionInterval,
796 const slave_latency_t &slaveLatency,
797 const supervision_timeout_t &supervision_timeout
799 connectionHandle(connectionHandle),
800 minConnectionInterval(minConnectionInterval),
801 maxConnectionInterval(maxConnectionInterval),
802 slaveLatency(slaveLatency),
803 supervisionTimeout(supervision_timeout)
814 return connectionHandle;
822 return minConnectionInterval;
830 return maxConnectionInterval;
846 return supervisionTimeout;
851 ble::conn_interval_t minConnectionInterval;
852 ble::conn_interval_t maxConnectionInterval;
853 ble::slave_latency_t slaveLatency;
854 ble::supervision_timeout_t supervisionTimeout;
863 #if !defined(DOXYGEN_ONLY) 868 const conn_interval_t &connectionInterval,
869 const slave_latency_t &slaveLatency,
870 const supervision_timeout_t &supervisionTimeout
873 connectionHandle(connectionHandle),
874 connectionInterval(connectionInterval),
875 slaveLatency(slaveLatency),
876 supervisionTimeout(supervisionTimeout)
896 return connectionHandle;
904 return connectionInterval;
920 return supervisionTimeout;
926 ble::conn_interval_t connectionInterval;
927 ble::slave_latency_t slaveLatency;
928 ble::supervision_timeout_t supervisionTimeout;
939 #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.
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.
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.