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  * @param status Advertising set start command status.
590  */
591  AdvertisingStartEvent(advertising_handle_t advHandle, ble_error_t status = BLE_ERROR_NONE) :
592  advHandle(advHandle), status(status)
593  {
594  }
595 
596 #endif
597 
598  /** Get advertising handle. */
599  advertising_handle_t getAdvHandle() const
600  {
601  return advHandle;
602  }
603 
604  /** Get status of operation. */
606  {
607  return status;
608  }
609 
610 private:
611  advertising_handle_t advHandle;
612  ble_error_t status;
613 };
614 
615 /**
616  * Event produced when advertising ends.
617  *
618  * @see ble::Gap::EventHandler::onAdvertisingEnd().
619  *
620  * @note The connection handle, connected flag and completed_event fields are
621  * valid if the flag legacy is not set to true. If status is different from BLE_ERROR_NONE
622  * the completed_events field is not valid and the set may still be active.
623  */
625 #if !defined(DOXYGEN_ONLY)
626 
627  /** Create an extended advertising end event.
628  *
629  * @param advHandle Advertising set handle.
630  * @param connection Connection handle - only valid if connected is True.
631  * @param completed_events Number of events created during before advertising end - only valid
632  * if advertising end has been caused by BLE_ERROR_LIMIT_REACHED, not the local user.
633  * Check getStatus().
634  * @param connected True if connection has been established.
635  * @param status Error code showing the reason for event. BLE_ERROR_LIMIT_REACHED if set number
636  * of events have been reached. BLE_ERROR_TIMEOUT if set time has elapsed.
637  * BLE_ERROR_SUCCESS if connection occurred or user ended the set. Check isConnected()
638  * to determine which.
639  */
641  advertising_handle_t advHandle,
642  connection_handle_t connection,
643  uint8_t completed_events,
644  bool connected,
645  ble_error_t status = BLE_ERROR_NONE
646  ) :
647  advHandle(advHandle),
648  connection(connection),
649  completed_events(completed_events),
650  connected(connected),
651  legacy(false),
652  status(status)
653  {
654  }
655 
656  /** Create a legacy advertising end event.
657  */
659  advHandle(LEGACY_ADVERTISING_HANDLE),
660  connection(),
661  completed_events(0),
662  connected(false),
663  legacy(true),
664  status(BLE_ERROR_NONE)
665  {
666  }
667 
668 #endif
669 
670  /** Get advertising handle. */
671  advertising_handle_t getAdvHandle() const
672  {
673  return advHandle;
674  }
675 
676  /** Get connection handle (valid only if connected successfully). */
678  {
679  return connection;
680  }
681 
682  /** Get how many events advertising created. */
683  uint8_t getCompleted_events() const
684  {
685  return completed_events;
686  }
687 
688  /** Has the advertising ended with a connection. */
689  bool isConnected() const
690  {
691  return connected;
692  }
693 
694  /** Is the end of legacy advertising.
695  *
696  * If it is the return of getConnection() getCompleted_events() and isConnected()
697  * must be discarded
698  */
699  bool isLegacy() const
700  {
701  return legacy;
702  }
703 
704  /** Get the result of the stop advertising event. If the status is not BLE_ERROR_NONE the set
705  * may still be active. */
707  {
708  return status;
709  }
710 
711 private:
712  advertising_handle_t advHandle;
713  connection_handle_t connection;
714  uint8_t completed_events;
715  bool connected;
716  bool legacy;
717  ble_error_t status;
718 };
719 
720 /**
721  * Event produced when a peer requests a scan response from the advertiser.
722  *
723  * @see ble::Gap::EventHandler::onScanRequestReceived().
724  */
726 #if !defined(DOXYGEN_ONLY)
727 
728  /** Create scan request event.
729  *
730  * @param advHandle Advertising handle.
731  * @param peerAddressType Peer address type.
732  * @param peerAddress Peer address.
733  */
735  advertising_handle_t advHandle,
736  const peer_address_type_t &peerAddressType,
737  const address_t &peerAddress
738  ) :
739  advHandle(advHandle),
740  peerAddressType(peerAddressType),
741  peerAddress(peerAddress)
742  {
743  }
744 
745 #endif
746 
747  /** Get advertising handle. */
748  advertising_handle_t getAdvHandle() const
749  {
750  return advHandle;
751  }
752 
753  /** Get peer address type. */
755  {
756  return peerAddressType;
757  }
758 
759  /** Get peer address. */
760  const address_t &getPeerAddress() const
761  {
762  return peerAddress;
763  }
764 
765 private:
766  advertising_handle_t advHandle;
767  peer_address_type_t peerAddressType;
768  const address_t &peerAddress;
769 };
770 
771 /**
772  * Event produced when a disconnection is complete.
773  *
774  * @see ble::Gap::EventHandler::onDisconnectionComplete().
775  */
777 #if !defined(DOXYGEN_ONLY)
778 
780  connection_handle_t connectionHandle,
781  const disconnection_reason_t &reason
782  ) :
783  connectionHandle(connectionHandle), reason(reason)
784  {
785  }
786 
787 #endif
788 
789  /**
790  * Get the handle of the connection that has expired.
791  */
793  {
794  return connectionHandle;
795  }
796 
797  /**
798  * Get the reason of the disconnection.
799  */
800  const disconnection_reason_t &getReason() const
801  {
802  return reason;
803  }
804 
805 private:
806  ble::connection_handle_t connectionHandle;
807  ble::disconnection_reason_t reason;
808 };
809 
810 /**
811  * Event received when a peer wants to change the connection parameters.
812  *
813  * @see ble::Gap::EventHandler::onUpdateConnectionParametersRequest().
814  */
816 #if !defined(DOXYGEN_ONLY)
817 
819  connection_handle_t connectionHandle,
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
824  ) :
825  connectionHandle(connectionHandle),
826  minConnectionInterval(minConnectionInterval),
827  maxConnectionInterval(maxConnectionInterval),
828  slaveLatency(slaveLatency),
829  supervisionTimeout(supervision_timeout)
830  {
831  }
832 
833 #endif
834 
835  /**
836  * Get the connection handle.
837  */
839  {
840  return connectionHandle;
841  }
842 
843  /**
844  * Get the minimum connection interval requested.
845  */
846  const conn_interval_t &getMinConnectionInterval() const
847  {
848  return minConnectionInterval;
849  }
850 
851  /**
852  * Get the maximum connection interval requested.
853  */
854  const conn_interval_t &getMaxConnectionInterval() const
855  {
856  return maxConnectionInterval;
857  }
858 
859  /**
860  * Get the slave latency requested.
861  */
862  const slave_latency_t &getSlaveLatency() const
863  {
864  return slaveLatency;
865  }
866 
867  /**
868  * Get the supervision timeout requested.
869  */
870  const supervision_timeout_t &getSupervisionTimeout() const
871  {
872  return supervisionTimeout;
873  }
874 
875 private:
876  ble::connection_handle_t connectionHandle;
877  ble::conn_interval_t minConnectionInterval;
878  ble::conn_interval_t maxConnectionInterval;
879  ble::slave_latency_t slaveLatency;
880  ble::supervision_timeout_t supervisionTimeout;
881 };
882 
883 /**
884  * Event received when connection parameters have been updated.
885  *
886  * @see ble::Gap::EventHandler::onConnectionParametersUpdateComplete().
887  */
889 #if !defined(DOXYGEN_ONLY)
890 
892  ble_error_t status,
893  connection_handle_t connectionHandle,
894  const conn_interval_t &connectionInterval,
895  const slave_latency_t &slaveLatency,
896  const supervision_timeout_t &supervisionTimeout
897  ) :
898  status(status),
899  connectionHandle(connectionHandle),
900  connectionInterval(connectionInterval),
901  slaveLatency(slaveLatency),
902  supervisionTimeout(supervisionTimeout)
903  {
904  }
905 
906 #endif
907 
908  /**
909  * Get the status of the operation. It is equal to BLE_ERROR_NONE in case of
910  * success.
911  */
913  {
914  return status;
915  }
916 
917  /**
918  * Get the handle of the connection that has been updated.
919  */
921  {
922  return connectionHandle;
923  }
924 
925  /**
926  * Get the new connection interval.
927  */
928  const conn_interval_t &getConnectionInterval() const
929  {
930  return connectionInterval;
931  }
932 
933  /**
934  * Get the new slave latency.
935  */
936  const slave_latency_t &getSlaveLatency() const
937  {
938  return slaveLatency;
939  }
940 
941  /**
942  * Get the new supervision timeout.
943  */
944  const supervision_timeout_t &getSupervisionTimeout() const
945  {
946  return supervisionTimeout;
947  }
948 
949 private:
950  ble_error_t status;
951  ble::connection_handle_t connectionHandle;
952  ble::conn_interval_t connectionInterval;
953  ble::slave_latency_t slaveLatency;
954  ble::supervision_timeout_t supervisionTimeout;
955 
956 };
957 
958 /**
959  * @}
960  * @}
961  */
962 
963 } // namespace ble
964 
965 #endif //BLE_GAP_EVENTS_H
const disconnection_reason_t & getReason() const
Get the reason of the disconnection.
Definition: Events.h:800
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:624
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:888
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:671
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:683
ble_error_t getStatus() const
Get status of operation.
Definition: Events.h:605
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:838
const conn_interval_t & getMinConnectionInterval() const
Get the minimum connection interval requested.
Definition: Events.h:846
advertising_handle_t getAdvHandle() const
Get advertising handle.
Definition: Events.h:599
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:936
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:854
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:920
const address_t & getPeerAddress() const
Get peer address.
Definition: Events.h:760
const conn_interval_t & getConnectionInterval() const
Get the new connection interval.
Definition: Events.h:928
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:944
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:754
ble_error_t getStatus() const
Get the status of the operation.
Definition: Events.h:912
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:748
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:870
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:699
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:776
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:689
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:815
connection_handle_t getConnectionHandle() const
Get the handle of the connection that has expired.
Definition: Events.h:792
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
ble_error_t getStatus() const
Get the result of the stop advertising event.
Definition: Events.h:706
connection_handle_t getConnection() const
Get connection handle (valid only if connected successfully).
Definition: Events.h:677
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:862
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:725
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.