Mistake on this page?
Report an issue in GitHub or email us
Events.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2006-2020 ARM Limited
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef BLE_GAP_EVENTS_H
20 #define BLE_GAP_EVENTS_H
21 
22 #include "ble/common/blecommon.h"
23 #include "ble/common/BLETypes.h"
24 
25 namespace ble {
26 
27 /**
28  * @addtogroup ble
29  * @{
30  * @addtogroup gap
31  * @{
32  */
33 
34 /**
35  * Event generated when an advertising packet is seen during passive scanning
36  * or a scan response is received during active scanning.
37  *
38  * @see ble::Gap::EventHandler::onPeriodicAdvertisingReport()
39  */
41 #if !defined(DOXYGEN_ONLY)
42 
43  /** Create an advertising report event.
44  *
45  * @param type Type of advertising used.
46  * @param peerAddressType Peer address type of advertiser.
47  * @param peerAddress Peer address of advertiser.
48  * @param primaryPhy PHY used on the primary channels.
49  * @param secondaryPhy PHY used on secondary channels.
50  * @param SID Set identification number.
51  * @param txPower Transmission power reported by the packet.
52  * @param rssi Measured signal strength.
53  * @param periodicInterval Interval of periodic advertising.
54  * @param directAddressType Directed advertising target address type.
55  * @param directAddress Directed advertising target address.
56  * @param advertisingData Advertising payload.
57  */
59  const advertising_event_t &type,
60  const peer_address_type_t &peerAddressType,
61  const address_t &peerAddress,
62  const phy_t &primaryPhy,
63  const phy_t &secondaryPhy,
64  advertising_sid_t SID,
65  advertising_power_t txPower,
66  rssi_t rssi,
67  uint16_t periodicInterval,
68  const peer_address_type_t &directAddressType,
69  const address_t &directAddress,
70  const mbed::Span<const uint8_t> &advertisingData
71  ) :
72  peerAddress(peerAddress),
73  type(type),
74  peerAddressType(peerAddressType),
75  primaryPhy(primaryPhy),
76  secondaryPhy(secondaryPhy),
77  SID(SID),
78  txPower(txPower),
79  periodicInterval(periodicInterval),
80  rssi(rssi),
81  directAddressType(directAddressType),
82  directAddress(directAddress),
83  advertisingData(advertisingData)
84  {
85  }
86 
87 #endif
88  /** Get event type. */
89  const advertising_event_t &getType() const
90  {
91  return type;
92  }
93 
94  /** Get peer address type. */
96  {
97  return peerAddressType;
98  }
99 
100  /** Get peer address. */
101  const address_t &getPeerAddress() const
102  {
103  return peerAddress;
104  }
105 
106  /** Get primary PHY. */
107  const phy_t &getPrimaryPhy() const
108  {
109  return primaryPhy;
110  }
111 
112  /** Get secondary PHY. */
113  const phy_t &getSecondaryPhy() const
114  {
115  return secondaryPhy;
116  }
117 
118  /** Get advertising set identifier. */
119  advertising_sid_t getSID() const
120  {
121  return SID;
122  }
123 
124  /** Get TX power. */
125  advertising_power_t getTxPower() const
126  {
127  return txPower;
128  }
129 
130  /** Get received signal strength. */
131  rssi_t getRssi() const
132  {
133  return rssi;
134  }
135 
136  /** Indicate if periodic interval is valid */
138  return periodicInterval != 0;
139  }
140 
141  /** Get interval. */
142  periodic_interval_t getPeriodicInterval() const
143  {
144  return periodic_interval_t(periodicInterval);
145  }
146 
147  /** Get target address type in directed advertising. */
149  {
150  return directAddressType;
151  }
152 
153  /** Get target address in directed advertising. */
155  {
156  return directAddress;
157  }
158 
159  /** Get payload. */
161  {
162  return advertisingData;
163  }
164 
165  /** Set peer address. */
167  const address_t &newPeerAddress
168  )
169  {
170  peerAddress = newPeerAddress;
171  }
172 
173 
174  /** Set peer address type. */
176  const peer_address_type_t &newPeerAddressType
177  )
178  {
179  peerAddressType = newPeerAddressType;
180  }
181 
182  /** Set new advertising payload. */
184  const mbed::Span<const uint8_t> &newAdvertisingData
185  )
186  {
187  advertisingData = newAdvertisingData;
188  }
189 
190 private:
191  address_t peerAddress;
192  advertising_event_t type;
193  peer_address_type_t peerAddressType;
194  phy_t primaryPhy;
195  phy_t secondaryPhy;
196  advertising_sid_t SID;
197  advertising_power_t txPower;
198  uint16_t periodicInterval;
199  rssi_t rssi;
200  peer_address_type_t directAddressType;
201  address_t directAddress;
202  ble_error_t status;
203  mbed::Span<const uint8_t> advertisingData;
204 };
205 
206 /**
207  * Event generated when a connection initiation ends (successfully or not).
208  *
209  * @see ble::Gap::EventHandler::onConnectionComplete().
210  */
212 #if !defined(DOXYGEN_ONLY)
213 
214  /** Create a connection complete event.
215  *
216  * @param success BLE_ERROR_NONE if connection succeeded.
217  * @param connectionHandle Connection handle if successful.
218  * @param ownRole Role of the local device.
219  * @param peerAddressType Peer address type.
220  * @param peerAddress Peer address.
221  * @param localResolvablePrivateAddress Local address type if privacy enabled.
222  * @param peerResolvablePrivateAddress Peer address type if privacy enabled.
223  * @param connectionInterval Connection interval.
224  * @param connectionLatency Connection latency in events.
225  * @param supervisionTimeout Supervision timeout.
226  * @param masterClockAccuracy Peer clock accuracy in parts per million.
227  */
229  ble_error_t status,
230  connection_handle_t connectionHandle,
231  connection_role_t ownRole,
232  const peer_address_type_t &peerAddressType,
233  const address_t &peerAddress,
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
240  ) :
241  status(status),
242  connectionHandle(connectionHandle),
243  peerAddress(peerAddress),
244  ownRole(ownRole),
245  peerAddressType(peerAddressType),
246  localResolvablePrivateAddress(localResolvablePrivateAddress),
247  connectionInterval(connectionInterval),
248  peerResolvablePrivateAddress(peerResolvablePrivateAddress),
249  connectionLatency(connectionLatency),
250  supervisionTimeout(supervisionTimeout),
251  masterClockAccuracy(masterClockAccuracy)
252  {
253  }
254 
255 #endif
256 
257  /** Get connection complete event status. */
259  {
260  return status;
261  }
262 
263  /** Get connection handle (valid only when successful). */
265  {
266  return connectionHandle;
267  }
268 
269  /** Get own role. */
270  connection_role_t getOwnRole() const
271  {
272  return ownRole;
273  }
274 
275  /** Get peer address type. */
277  {
278  return peerAddressType;
279  }
280 
281  /** Get peer address. */
282  const address_t &getPeerAddress() const
283  {
284  return peerAddress;
285  }
286 
287  /** Get get local resolvable random address if privacy is used. */
289  {
290  return localResolvablePrivateAddress;
291  }
292 
293  /** Get peer resolvable private address if privacy is used. */
295  {
296  return peerResolvablePrivateAddress;
297  }
298 
299  /** Get connection interval. */
300  conn_interval_t getConnectionInterval() const
301  {
302  return connectionInterval;
303  }
304 
305  /** Get connection latency. */
306  slave_latency_t getConnectionLatency() const
307  {
308  return connectionLatency;
309  }
310 
311  /** Get supervision timeout. */
312  supervision_timeout_t getSupervisionTimeout() const
313  {
314  return supervisionTimeout;
315  }
316 
317  /** Get clock accuracy in parts per million. */
318  uint16_t getMasterClockAccuracy() const
319  {
320  return masterClockAccuracy;
321  }
322 
323 
324  /** Set connection complete event status. */
325  void setStatus(ble_error_t new_status)
326  {
327  status = new_status;
328  }
329 
330  /** Set peer address type. */
331  void setPeerAddressType(const peer_address_type_t& address_type)
332  {
333  peerAddressType = address_type;
334  }
335 
336  /** Set peer address. */
337  void setPeerAddress(const address_t &address)
338  {
339  peerAddress = address;
340  }
341 
342  /** Set get local resolvable random address if privacy is used. */
344  {
345  localResolvablePrivateAddress = address;
346  }
347 
348  /** Set peer resolvable private address if privacy is used. */
350  {
351  peerResolvablePrivateAddress = address;
352  }
353 
354 private:
355  ble_error_t status;
356  connection_handle_t connectionHandle;
357  address_t peerAddress;
358  connection_role_t ownRole;
359  peer_address_type_t peerAddressType;
360  address_t localResolvablePrivateAddress;
361  conn_interval_t connectionInterval;
362  address_t peerResolvablePrivateAddress;
363  slave_latency_t connectionLatency;
364  supervision_timeout_t supervisionTimeout;
365  uint16_t masterClockAccuracy;
366 };
367 
368 /**
369  * Event generated when you first receive a periodic advertisement.
370  *
371  * @see ble::Gap::EventHandler::onPeriodicAdvertisingSyncEstablished().
372  */
374 #if !defined(DOXYGEN_ONLY)
375 
376  /** Create advertising sync event.
377  *
378  * @param success BLE_ERROR_NONE if synchronisation was achieved.
379  * @param syncHandle Advertising sync handle.
380  * @param sid Advertising set identifier.
381  * @param peerAddressType Peer address type.
382  * @param peerAddress Peer address.
383  * @param peerPhy PHY used for advertisements.
384  * @param advertisingInterval Periodic advertising interval.
385  * @param masterClockAccuracy Peer clock accuracy in parts per million.
386  */
388  ble_error_t status,
389  periodic_sync_handle_t syncHandle,
390  advertising_sid_t sid,
391  const peer_address_type_t &peerAddressType,
392  const address_t &peerAddress,
393  const phy_t &peerPhy,
394  uint16_t advertisingInterval,
395  const clock_accuracy_t &peerClockAccuracy
396  ) :
397  status(status),
398  syncHandle(syncHandle),
399  sid(sid),
400  peerAddressType(peerAddressType),
401  peerAddress(peerAddress),
402  peerPhy(peerPhy),
403  advertisingInterval(advertisingInterval),
404  peerClockAccuracy(peerClockAccuracy)
405  {
406  }
407 
408 #endif
409 
410  /** Get sync establishment status. */
412  {
413  return status;
414  }
415 
416  /** Get periodic advertising sync handle. */
417  periodic_sync_handle_t getSyncHandle() const
418  {
419  return syncHandle;
420  }
421 
422  /** Get advertising set identifier. */
423  advertising_sid_t getSid() const
424  {
425  return sid;
426  }
427 
428  /** Get peer address type. */
430  {
431  return peerAddressType;
432  }
433 
434  /** Get peer address. */
435  const address_t &getPeerAddress() const
436  {
437  return peerAddress;
438  }
439 
440  /** Get PHY used. */
441  const phy_t &getPeerPhy() const
442  {
443  return peerPhy;
444  }
445 
446  /** Get interval. */
447  uint16_t getAdvertisingInterval() const
448  {
449  return advertisingInterval;
450  }
451 
452  /** Get clock accuracy in parts per million. */
453  const clock_accuracy_t &getPeerClockAccuracy() const
454  {
455  return peerClockAccuracy;
456  }
457 
458 private:
459  ble_error_t status;
460  periodic_sync_handle_t syncHandle;
461  advertising_sid_t sid;
462  peer_address_type_t peerAddressType;
463  const address_t &peerAddress;
464  phy_t peerPhy;
465  uint16_t advertisingInterval;
466  clock_accuracy_t peerClockAccuracy;
467 };
468 
469 /**
470  * Event generated when periodic advertising packet is received.
471  *
472  * @see ble::Gap::EventHandler::onPeriodicAdvertisingReport().
473  */
475 #if !defined(DOXYGEN_ONLY)
476 
477  /** Create periodic advertising report event.
478  *
479  * @param syncHandle Periodic advertising sync handle
480  * @param txPower TX power.
481  * @param rssi Received signal strength.
482  * @param dataStatus Status to indicate the completeness of the payload.
483  * @param payload Periodic advertisement payload.
484  */
486  periodic_sync_handle_t syncHandle,
487  advertising_power_t txPower,
488  rssi_t rssi,
489  advertising_data_status_t dataStatus,
490  const mbed::Span<const uint8_t> &payload
491  ) :
492  syncHandle(syncHandle),
493  txPower(txPower),
494  rssi(rssi),
495  dataStatus(dataStatus),
496  payload(payload)
497  {
498  }
499 
500 #endif
501 
502  /** Get periodic advertising sync handle. */
503  periodic_sync_handle_t getSyncHandle() const
504  {
505  return syncHandle;
506  }
507 
508  /** Get TX power as reported by the advertising packet. */
509  advertising_power_t getTxPower() const
510  {
511  return txPower;
512  }
513 
514  /** Get received signal strength. */
515  rssi_t getRssi() const
516  {
517  return rssi;
518  }
519 
520  /** Get data completeness status. */
521  const advertising_data_status_t &getDataStatus() const
522  {
523  return dataStatus;
524  }
525 
526  /** Get payload. */
528  {
529  return payload;
530  }
531 
532 private:
533  periodic_sync_handle_t syncHandle;
534  advertising_power_t txPower;
535  rssi_t rssi;
536  advertising_data_status_t dataStatus;
538 };
539 
540 /**
541  * Event generated when periodic advertising sync is lost.
542  *
543  * @see ble::Gap::EventHandler::onPeriodicAdvertisingSyncLoss().
544  */
546 #if !defined(DOXYGEN_ONLY)
547 
548  /** Create periodic advertising sync loss event.
549  *
550  * @param syncHandle Periodic advertising sync handle.
551  */
553  periodic_sync_handle_t syncHandle
554  ) :
555  syncHandle(syncHandle)
556  {
557  }
558 
559 #endif
560 
561  /** Get periodic sync handle. */
562  periodic_sync_handle_t getSyncHandle() const
563  {
564  return syncHandle;
565  }
566 
567 private:
568  periodic_sync_handle_t syncHandle;
569 };
570 
571 /**
572  * Event generated when scan times out.
573  *
574  * @see ble::Gap::EventHandler::onScanTimeout().
575  */
576 struct ScanTimeoutEvent { };
577 
578 /**
579  * Event produced when advertising start.
580  *
581  * @see ble::Gap::EventHandler::onAdvertisingStart().
582  */
584 #if !defined(DOXYGEN_ONLY)
585 
586  /** Create an advertising start event.
587  *
588  * @param advHandle Advertising set handle.
589  */
590  AdvertisingStartEvent(advertising_handle_t advHandle) :
591  advHandle(advHandle)
592  {
593  }
594 
595 #endif
596 
597  /** Get advertising handle. */
598  advertising_handle_t getAdvHandle() const
599  {
600  return advHandle;
601  }
602 
603 private:
604  advertising_handle_t advHandle;
605 };
606 
607 /**
608  * Event produced when advertising ends.
609  *
610  * @see ble::Gap::EventHandler::onAdvertisingEnd().
611  *
612  * @note The connection handle, connected flag and completed_event fields are
613  * valid if the flag legacy is not set to true.
614  */
616 #if !defined(DOXYGEN_ONLY)
617 
618  /** Create an extended advertising end event.
619  *
620  * @param advHandle Advertising set handle.
621  * @param connection Connection handle.
622  * @param completed_events Number of events created during before advertising end.
623  * @param connected True if connection has been established.
624  */
626  advertising_handle_t advHandle,
627  connection_handle_t connection,
628  uint8_t completed_events,
629  bool connected
630  ) :
631  advHandle(advHandle),
632  connection(connection),
633  completed_events(completed_events),
634  connected(connected),
635  legacy(false)
636  {
637  }
638 
639  /** Create a legacy advertising end event.
640  */
642  advHandle(LEGACY_ADVERTISING_HANDLE),
643  connection(),
644  completed_events(0),
645  connected(false),
646  legacy(true)
647  {
648  }
649 
650 #endif
651 
652  /** Get advertising handle. */
653  advertising_handle_t getAdvHandle() const
654  {
655  return advHandle;
656  }
657 
658  /** Get connection handle (valid only if connected successfully). */
660  {
661  return connection;
662  }
663 
664  /** Get how many events advertising created. */
665  uint8_t getCompleted_events() const
666  {
667  return completed_events;
668  }
669 
670  /** Has the advertising ended with a connection. */
671  bool isConnected() const
672  {
673  return connected;
674  }
675 
676  /** Is the end of legacy advertising.
677  *
678  * If it is the return of getConnection() getCompleted_events() and isConnected()
679  * must be discarded
680  */
681  bool isLegacy() const
682  {
683  return legacy;
684  }
685 
686 private:
687  advertising_handle_t advHandle;
688  connection_handle_t connection;
689  uint8_t completed_events;
690  bool connected;
691  bool legacy;
692 };
693 
694 /**
695  * Event produced when a peer requests a scan response from the advertiser.
696  *
697  * @see ble::Gap::EventHandler::onScanRequestReceived().
698  */
700 #if !defined(DOXYGEN_ONLY)
701 
702  /** Create scan request event.
703  *
704  * @param advHandle Advertising handle.
705  * @param peerAddressType Peer address type.
706  * @param peerAddress Peer address.
707  */
709  advertising_handle_t advHandle,
710  const peer_address_type_t &peerAddressType,
711  const address_t &peerAddress
712  ) :
713  advHandle(advHandle),
714  peerAddressType(peerAddressType),
715  peerAddress(peerAddress)
716  {
717  }
718 
719 #endif
720 
721  /** Get advertising handle. */
722  advertising_handle_t getAdvHandle() const
723  {
724  return advHandle;
725  }
726 
727  /** Get peer address type. */
729  {
730  return peerAddressType;
731  }
732 
733  /** Get peer address. */
734  const address_t &getPeerAddress() const
735  {
736  return peerAddress;
737  }
738 
739 private:
740  advertising_handle_t advHandle;
741  peer_address_type_t peerAddressType;
742  const address_t &peerAddress;
743 };
744 
745 /**
746  * Event produced when a disconnection is complete.
747  *
748  * @see ble::Gap::EventHandler::onDisconnectionComplete().
749  */
751 #if !defined(DOXYGEN_ONLY)
752 
754  connection_handle_t connectionHandle,
755  const disconnection_reason_t &reason
756  ) :
757  connectionHandle(connectionHandle), reason(reason)
758  {
759  }
760 
761 #endif
762 
763  /**
764  * Get the handle of the connection that has expired.
765  */
767  {
768  return connectionHandle;
769  }
770 
771  /**
772  * Get the reason of the disconnection.
773  */
774  const disconnection_reason_t &getReason() const
775  {
776  return reason;
777  }
778 
779 private:
780  ble::connection_handle_t connectionHandle;
781  ble::disconnection_reason_t reason;
782 };
783 
784 /**
785  * Event received when a peer wants to change the connection parameters.
786  *
787  * @see ble::Gap::EventHandler::onUpdateConnectionParametersRequest().
788  */
790 #if !defined(DOXYGEN_ONLY)
791 
793  connection_handle_t connectionHandle,
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
798  ) :
799  connectionHandle(connectionHandle),
800  minConnectionInterval(minConnectionInterval),
801  maxConnectionInterval(maxConnectionInterval),
802  slaveLatency(slaveLatency),
803  supervisionTimeout(supervision_timeout)
804  {
805  }
806 
807 #endif
808 
809  /**
810  * Get the connection handle.
811  */
813  {
814  return connectionHandle;
815  }
816 
817  /**
818  * Get the minimum connection interval requested.
819  */
820  const conn_interval_t &getMinConnectionInterval() const
821  {
822  return minConnectionInterval;
823  }
824 
825  /**
826  * Get the maximum connection interval requested.
827  */
828  const conn_interval_t &getMaxConnectionInterval() const
829  {
830  return maxConnectionInterval;
831  }
832 
833  /**
834  * Get the slave latency requested.
835  */
836  const slave_latency_t &getSlaveLatency() const
837  {
838  return slaveLatency;
839  }
840 
841  /**
842  * Get the supervision timeout requested.
843  */
844  const supervision_timeout_t &getSupervisionTimeout() const
845  {
846  return supervisionTimeout;
847  }
848 
849 private:
850  ble::connection_handle_t connectionHandle;
851  ble::conn_interval_t minConnectionInterval;
852  ble::conn_interval_t maxConnectionInterval;
853  ble::slave_latency_t slaveLatency;
854  ble::supervision_timeout_t supervisionTimeout;
855 };
856 
857 /**
858  * Event received when connection parameters have been updated.
859  *
860  * @see ble::Gap::EventHandler::onConnectionParametersUpdateComplete().
861  */
863 #if !defined(DOXYGEN_ONLY)
864 
866  ble_error_t status,
867  connection_handle_t connectionHandle,
868  const conn_interval_t &connectionInterval,
869  const slave_latency_t &slaveLatency,
870  const supervision_timeout_t &supervisionTimeout
871  ) :
872  status(status),
873  connectionHandle(connectionHandle),
874  connectionInterval(connectionInterval),
875  slaveLatency(slaveLatency),
876  supervisionTimeout(supervisionTimeout)
877  {
878  }
879 
880 #endif
881 
882  /**
883  * Get the status of the operation. It is equal to BLE_ERROR_NONE in case of
884  * success.
885  */
887  {
888  return status;
889  }
890 
891  /**
892  * Get the handle of the connection that has been updated.
893  */
895  {
896  return connectionHandle;
897  }
898 
899  /**
900  * Get the new connection interval.
901  */
902  const conn_interval_t &getConnectionInterval() const
903  {
904  return connectionInterval;
905  }
906 
907  /**
908  * Get the new slave latency.
909  */
910  const slave_latency_t &getSlaveLatency() const
911  {
912  return slaveLatency;
913  }
914 
915  /**
916  * Get the new supervision timeout.
917  */
918  const supervision_timeout_t &getSupervisionTimeout() const
919  {
920  return supervisionTimeout;
921  }
922 
923 private:
924  ble_error_t status;
925  ble::connection_handle_t connectionHandle;
926  ble::conn_interval_t connectionInterval;
927  ble::slave_latency_t slaveLatency;
928  ble::supervision_timeout_t supervisionTimeout;
929 
930 };
931 
932 /**
933  * @}
934  * @}
935  */
936 
937 } // namespace ble
938 
939 #endif //BLE_GAP_EVENTS_H
const disconnection_reason_t & getReason() const
Get the reason of the disconnection.
Definition: Events.h:774
Event generated when a connection initiation ends (successfully or not).
Definition: Events.h:211
void setPeerAddress(const address_t &newPeerAddress)
Set peer address.
Definition: Events.h:166
uint16_t getMasterClockAccuracy() const
Get clock accuracy in parts per million.
Definition: Events.h:318
rssi_t getRssi() const
Get received signal strength.
Definition: Events.h:515
periodic_sync_handle_t getSyncHandle() const
Get periodic advertising sync handle.
Definition: Events.h:417
Event produced when advertising ends.
Definition: Events.h:615
const clock_accuracy_t & getPeerClockAccuracy() const
Get clock accuracy in parts per million.
Definition: Events.h:453
Event received when connection parameters have been updated.
Definition: Events.h:862
void setPeerAddressType(const peer_address_type_t &newPeerAddressType)
Set peer address type.
Definition: Events.h:175
ble_error_t getStatus() const
Get connection complete event status.
Definition: Events.h:258
Event generated when periodic advertising sync is lost.
Definition: Events.h:545
advertising_handle_t getAdvHandle() const
Get advertising handle.
Definition: Events.h:653
void setAdvertisingData(const mbed::Span< const uint8_t > &newAdvertisingData)
Set new advertising payload.
Definition: Events.h:183
uintptr_t connection_handle_t
Opaque reference to a connection.
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
Definition: Events.h:276
uint8_t getCompleted_events() const
Get how many events advertising created.
Definition: Events.h:665
const address_t & getPeerResolvablePrivateAddress() const
Get peer resolvable private address if privacy is used.
Definition: Events.h:294
Event produced when advertising start.
Definition: Events.h:583
advertising_power_t getTxPower() const
Get TX power.
Definition: Events.h:125
Event generated when an advertising packet is seen during passive scanning or a scan response is rece...
Definition: Events.h:40
connection_handle_t getConnectionHandle() const
Get the connection handle.
Definition: Events.h:812
const conn_interval_t & getMinConnectionInterval() const
Get the minimum connection interval requested.
Definition: Events.h:820
advertising_handle_t getAdvHandle() const
Get advertising handle.
Definition: Events.h:598
bool isPeriodicIntervalPresent() const
Indicate if periodic interval is valid.
Definition: Events.h:137
const slave_latency_t & getSlaveLatency() const
Get the new slave latency.
Definition: Events.h:910
uint16_t getAdvertisingInterval() const
Get interval.
Definition: Events.h:447
const conn_interval_t & getMaxConnectionInterval() const
Get the maximum connection interval requested.
Definition: Events.h:828
rssi_t getRssi() const
Get received signal strength.
Definition: Events.h:131
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
Definition: Events.h:95
const advertising_data_status_t & getDataStatus() const
Get data completeness status.
Definition: Events.h:521
connection_handle_t getConnectionHandle() const
Get the handle of the connection that has been updated.
Definition: Events.h:894
const address_t & getPeerAddress() const
Get peer address.
Definition: Events.h:734
const conn_interval_t & getConnectionInterval() const
Get the new connection interval.
Definition: Events.h:902
connection_role_t getOwnRole() const
Get own role.
Definition: Events.h:270
const supervision_timeout_t & getSupervisionTimeout() const
Get the new supervision timeout.
Definition: Events.h:918
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
Definition: Events.h:429
connection_handle_t getConnectionHandle() const
Get connection handle (valid only when successful).
Definition: Events.h:264
ble_error_t getStatus() const
Get sync establishment status.
Definition: Events.h:411
const peer_address_type_t & getPeerAddressType() const
Get peer address type.
Definition: Events.h:728
ble_error_t getStatus() const
Get the status of the operation.
Definition: Events.h:886
advertising_sid_t getSID() const
Get advertising set identifier.
Definition: Events.h:119
static const advertising_handle_t LEGACY_ADVERTISING_HANDLE
Special advertising set handle used for the legacy advertising set.
MAC address data type.
void setPeerResolvablePrivateAddress(const address_t &address)
Set peer resolvable private address if privacy is used.
Definition: Events.h:349
advertising_handle_t getAdvHandle() const
Get advertising handle.
Definition: Events.h:722
const address_t & getDirectAddress() const
Get target address in directed advertising.
Definition: Events.h:154
Type that describes a bluetooth PHY(sical) transport.
const supervision_timeout_t & getSupervisionTimeout() const
Get the supervision timeout requested.
Definition: Events.h:844
const mbed::Span< const uint8_t > & getPayload() const
Get payload.
Definition: Events.h:160
void setLocalResolvablePrivateAddress(const address_t &address)
Set get local resolvable random address if privacy is used.
Definition: Events.h:343
bool isLegacy() const
Is the end of legacy advertising.
Definition: Events.h:681
Event generated when you first receive a periodic advertisement.
Definition: Events.h:373
const mbed::Span< const uint8_t > & getPayload() const
Get payload.
Definition: Events.h:527
periodic_interval_t getPeriodicInterval() const
Get interval.
Definition: Events.h:142
const phy_t & getSecondaryPhy() const
Get secondary PHY.
Definition: Events.h:113
void setPeerAddressType(const peer_address_type_t &address_type)
Set peer address type.
Definition: Events.h:331
const phy_t & getPeerPhy() const
Get PHY used.
Definition: Events.h:441
Type that describes a peer device address type.
Event generated when scan times out.
Definition: Events.h:576
Event produced when a disconnection is complete.
Definition: Events.h:750
const address_t & getPeerAddress() const
Get peer address.
Definition: Events.h:101
const peer_address_type_t & getDirectAddressType() const
Get target address type in directed advertising.
Definition: Events.h:148
void setStatus(ble_error_t new_status)
Set connection complete event status.
Definition: Events.h:325
advertising_power_t getTxPower() const
Get TX power as reported by the advertising packet.
Definition: Events.h:509
Event generated when periodic advertising packet is received.
Definition: Events.h:474
bool isConnected() const
Has the advertising ended with a connection.
Definition: Events.h:671
periodic_sync_handle_t getSyncHandle() const
Get periodic advertising sync handle.
Definition: Events.h:503
Event received when a peer wants to change the connection parameters.
Definition: Events.h:789
connection_handle_t getConnectionHandle() const
Get the handle of the connection that has expired.
Definition: Events.h:766
slave_latency_t getConnectionLatency() const
Get connection latency.
Definition: Events.h:306
const phy_t & getPrimaryPhy() const
Get primary PHY.
Definition: Events.h:107
periodic_sync_handle_t getSyncHandle() const
Get periodic sync handle.
Definition: Events.h:562
connection_handle_t getConnection() const
Get connection handle (valid only if connected successfully).
Definition: Events.h:659
const address_t & getPeerAddress() const
Get peer address.
Definition: Events.h:282
conn_interval_t getConnectionInterval() const
Get connection interval.
Definition: Events.h:300
Entry namespace for all BLE API definitions.
const slave_latency_t & getSlaveLatency() const
Get the slave latency requested.
Definition: Events.h:836
const advertising_event_t & getType() const
Get event type.
Definition: Events.h:89
const address_t & getPeerAddress() const
Get peer address.
Definition: Events.h:435
Event produced when a peer requests a scan response from the advertiser.
Definition: Events.h:699
const address_t & getLocalResolvablePrivateAddress() const
Get get local resolvable random address if privacy is used.
Definition: Events.h:288
supervision_timeout_t getSupervisionTimeout() const
Get supervision timeout.
Definition: Events.h:312
void setPeerAddress(const address_t &address)
Set peer address.
Definition: Events.h:337
advertising_sid_t getSid() const
Get advertising set identifier.
Definition: Events.h:423
ble_error_t
Error codes for the BLE API.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.