Mistake on this page?
Report an issue in GitHub or email us
Types.h
1 /* mbed Microcontroller Library
2  * Copyright (c) 2018 ARM Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef BLE_GAP_TYPES_H
18 #define BLE_GAP_TYPES_H
19 
20 #include "ble/common/Duration.h"
21 #include "ble/common/Bounded.h"
22 #include "ble/SafeEnum.h"
23 
24 namespace ble {
25 
26 /**
27  * @addtogroup ble
28  * @{
29  * @addtogroup gap
30  * @{
31  */
32 
33 /* BLE units, using microseconds as the common denominator */
34 
35 /**
36  * Time interval between two advertisements.
37  *
38  * The duration is in unit of 625µs and ranges from 0x20 to 0xFFFFFF .
39  *
40  * @note before Bluetooth 5 range was 0x20 to 0xFFFF.
41  */
43 
44 /**
45  * Advertising process duration.
46  *
47  * The duration is in unit of 10ms and ranges from 0x0001 to 0xFFFF. The special
48  * value 0x0000 means the advertising process never ends; it is accessible with
49  * adv_duration_t::forever().
50  */
51 typedef Duration<uint16_t, 10000, Range<0x00, 0xFFFF>, /* forever */ Value<uint16_t, 0x0000> > adv_duration_t;
52 
53 /**
54  * Scan process duration.
55  *
56  * The duration is in unit of 10ms and ranges from 0x0001 to 0xFFFF. The special
57  * value 0x0000 means the scan process never ends; it is accessible with
58  * scan_duration_t::forever().
59  */
60 typedef Duration<uint16_t, 10000, Range<0x00, 0xFFFF>, /* forever */ Value<uint16_t, 0x0000> > scan_duration_t;
61 
62 /**
63  * Time interval between two scan processes.
64  *
65  * The duration is in unit of 1.28s and ranges from 0x0001 to 0xFFFF. The special
66  * value 0x0000 is used to indicate that scan_period_t is not used.
67  */
69 
70 /**
71  * Time interval between two scans.
72  *
73  * The duration is in unit of 625µs and ranges from 0x04 to 0xFFFF.
74  */
76 
77 /**
78  * Duration of a scan.
79  *
80  * The duration is in unit of 625µs and ranges from 0x04 to 0xFFFF.
81  */
83 
84 /**
85  * Time interval between two connection events.
86  *
87  * The interval is in unit of 1.250 milliseconds and ranges from 0x06 to 0xC80.
88  */
90 
91 /**
92  * Time after which a connection is loss of devices have not exchanged data.
93  *
94  * The duration is in unit of 10 milliseconds and ranges from 0x0A to 0xC80.
95  *
96  * @note this time should be no larger than (1 + ConnLatency) * ConnIntervalMax * 2
97  */
99 
100 /**
101  * Duration of a connection event.
102  *
103  * The duration is in unit of 625µs and ranges from 0x0 to 0xFFFF .
104  */
106 
107 /**
108  * Time after which a periodic sync link is considered lost if the receiver hasn't
109  * received anything from the advertiser.
110  *
111  * The duration is in unit of 10 milliseconds and ranges from 0x0A to 0x4000.
112  */
114 
115 /**
116  * Interval between two periodic advertising events.
117  *
118  * The duration is in unit of 1.250ms and ranges from 0x06 to 0xFFFF.
119  */
121 
122 /**
123  * Number of connection events that can be skipped by the slave.
124  *
125  * It ranges from 0 to 0x1F3.
126  */
128 
129 /**
130  * Handle of an advertising set.
131  *
132  * @note Range of valid handle is comprised between 0x00 and 0xEF.
133  */
134 typedef uint8_t advertising_handle_t;
135 
136 /**
137  * Handle of a sync representing a periodic advertiser.
138  *
139  * @note Range of valid handle is comprised between 0x0000 and 0xFFFF.
140  */
141 typedef uint16_t periodic_sync_handle_t;
142 
143 /**
144  * Encapsulates the peripheral advertising modes.
145  *
146  * It determines how the device appears to other scanner and peripheral
147  * devices in the scanning range.
148  */
149 struct advertising_type_t : SafeEnum<advertising_type_t, uint8_t> {
150  /// enumeration of advertising_type_t values
151  enum type {
152  /**
153  * Device is connectable, scannable and doesn't expect connection from a
154  * specific peer.
155  * @note Cannot carry extended advertising payload, only legacy PDUs.
156  * Use CONNECTABLE_NON_SCANNABLE_UNDIRECTED for non-legacy payload.
157  *
158  * @see Vol 3, Part C, Section 9.3.4 and Vol 6, Part B, Section 2.3.1.1.
159  */
161 
162  /**
163  * Device is connectable and expects connection from a specific peer.
164  * (3.75 ms or smaller Advertising Interval)
165  * @see Vol 3, Part C, Section 9.3.3 and Vol 6, Part B, Section 2.3.1.2.
166  */
168 
169  /**
170  * Device is scannable but not connectable.
171  *
172  * @see Vol 6, Part B, Section 2.3.1.4.
173  */
175 
176  /**
177  * Device is not connectable and not scannable.
178  *
179  * @see Vol 3, Part C, Section 9.3.2 and Vol 6, Part B, Section 2.3.1.3.
180  */
182 
183  /**
184  * Device is connectable and expects connection from a specific peer (sent at long user set intervals).
185  */
187 
188  /**
189  * Device is connectable, but not scannable and doesn't expect connection from a specific peer.
190  * @note Only for use with extended advertising payload, will not allow legacy PDUs
191  * (use CONNECTABLE_UNDIRECTED for legacy PDU).
192  */
194 
195 #if !defined(DOXYGEN_ONLY)
196  // used by the PAL; naming in line with the the spec.
197  ADV_IND = 0x00,
198  ADV_DIRECT_IND = 0x01,
199  ADV_SCAN_IND = 0x02,
200  ADV_NONCONN_IND = 0x03,
201  ADV_DIRECT_IND_LOW_DUTY_CYCLE = 0x04,
202  ADV_NONSCAN_IND = 0x05
203 #endif
204  };
205 
206  /**
207  * Construct a new advertising_type_t value.
208  *
209  * @param value The value of the advertising_type_t created.
210  */
212  {
213  }
214 };
215 
216 
217 /** Used to indicate if the packet is complete and if it's truncated.
218  */
219 struct advertising_data_status_t : SafeEnum<advertising_data_status_t, uint8_t> {
220  /// enumeration of advertising_data_status_t values
221  enum type {
222  COMPLETE = 0x00, /// Advertising payload complete.
223  INCOMPLETE_MORE_DATA = 0x01, /// Partial advertising payload, more to come.
224  INCOMPLETE_DATA_TRUNCATED = 0x02 /// Advertising payload incomplete, and no more is coming.
225  };
226 
227  /**
228  * Construct a new advertising_data_status_t value.
229  *
230  * @param value The value of the advertising_data_status_t created.
231  */
233  {
234  }
235 
236 #if !defined(DOXYGEN_ONLY)
237 
238  /**
239  * Explicit constructor from a raw value.
240  */
241  explicit advertising_data_status_t(uint8_t raw_value) :
242  SafeEnum(raw_value)
243  {
244  }
245 
246 #endif
247 
248 };
249 
250 /** Properties of an advertising event.
251  */
253 
254 private:
255  // Implementation note: The object is constructed from the field Event_Type
256  // of an LE Extended Advertising.
257  // Indexes and functions of bits are defined in BLUETOOTH SPECIFICATION
258  // Version 5.0 | Vol 2, Part E -
259  // Section 7.7.65.13 LE Extended Advertising report Event
260  enum {
261  CONNECTABLE_BIT = 0,
262  SCANNABLE_ADVERTISING_BIT = 1,
263  DIRECTED_ADVERTISING_BIT = 2,
264  SCAN_RESPONSE_BIT = 3,
265  LEGACY_PDU_BIT = 4,
266  DATA_STATUS_INDEX = 5,
267  DATA_STATUS_MASK = 0x03
268  };
269 
270 public:
271 
272 #if !defined(DOXYGEN_ONLY)
273 
274  /** Create based on a raw value.
275  *
276  * @param value
277  */
278  explicit advertising_event_t(uint8_t value) : value(value)
279  {
280  }
281 
282 #endif
283 
284  /** Is advertising connectable.
285  *
286  * @return True if connectable.
287  */
288  bool connectable() const
289  {
290  return static_cast<bool>(value & (1 << CONNECTABLE_BIT));
291  }
292 
293  /** Is advertising scannable.
294  *
295  * @return True if scannable
296  */
298  {
299  return static_cast<bool>(value & (1 << SCANNABLE_ADVERTISING_BIT));
300  }
301 
302  /** Is advertising directed.
303  *
304  * @return True if directed.
305  */
306  bool directed_advertising() const
307  {
308  return static_cast<bool>(value & (1 << DIRECTED_ADVERTISING_BIT));
309  }
310 
311  /** Is this a scan response.
312  *
313  * @return True if scan response.
314  */
315  bool scan_response() const
316  {
317  return static_cast<bool>(value & (1 << SCAN_RESPONSE_BIT));
318  }
319 
320  /** Is this legacy advertising.
321  *
322  * @return True if legacy.
323  */
324  bool legacy_advertising() const
325  {
326  return static_cast<bool>(value & (1 << LEGACY_PDU_BIT));
327  }
328 
329  /** Payload completeness status.
330  *
331  * @return @see advertising_data_status_t for details.
332  */
334  {
335  return static_cast<advertising_data_status_t::type>(
336  (value >> DATA_STATUS_INDEX) & DATA_STATUS_MASK
337  );
338  }
339 
340  /** Is payload complete.
341  *
342  * @return True if payload is coplete.
343  */
344  bool complete() const
345  {
346  return data_status() == advertising_data_status_t::COMPLETE;
347  }
348 
349  /** Is there more data coming.
350  *
351  * @return True if more data coming.
352  */
353  bool more_data_to_come() const
354  {
355  return data_status() == advertising_data_status_t::INCOMPLETE_MORE_DATA;
356  }
357 
358  /** Is the payload truncated.
359  *
360  * @return True if no more data coming.
361  */
362  bool truncated() const
363  {
365  }
366 
367 private:
368  uint8_t value;
369 };
370 
371 /**
372  * Identify an advertising SID. Range: [0x00, 0x0F]
373  */
374 typedef uint8_t advertising_sid_t;
375 
376 /** Received signal strength. Range <-127, 20>.
377  * @note Special value 127 means RSSI is not available. */
378 typedef int8_t rssi_t;
379 
380 /**
381  * Describe the advertising power.
382  *
383  * Values between -127 and +126 are considered power values in dBm while
384  * the special value 127 can be used as a wildcard to indicate that the host
385  * has no preference or if the power information is not available.
386  */
387 typedef int8_t advertising_power_t;
388 
389 /**
390  * Advertising policy filter modes.
391  *
392  * @see Bluetooth Core Specification 4.2 (Vol. 6), Part B, Section 4.3.2.
393  */
394 struct advertising_filter_policy_t : SafeEnum<advertising_filter_policy_t, uint8_t> {
395  /// enumeration of advertising_filter_policy_t values
396  enum type {
397  /**
398  * Process connection and scan requests from all devices. The whitelist is
399  * not used.
400  */
401  NO_FILTER = 0x00,
402 
403  /**
404  * Process connection requests from all devices but filter out scan requests
405  * of devices that are not in the whitelist.
406  */
407  FILTER_SCAN_REQUESTS = 0x01,
408 
409  /**
410  * Process scan requests from all devices but filter out connection requests
411  * of devices that are not in the whitelist.
412  */
413  FILTER_CONNECTION_REQUEST = 0x02,
414 
415  /**
416  * Filter out scan or connection requests of devices that are not in the
417  * whitelist.
418  */
419  FILTER_SCAN_AND_CONNECTION_REQUESTS = 0x03
420  };
421 
422  /**
423  * Construct a advertising_filter_policy_t.
424  * @param value The value of the advertising_filter_policy_t created.
425  */
427  {
428  }
429 };
430 
431 /**
432  * Scanning policy filter mode.
433  *
434  * @see Bluetooth Core Specification 4.2 (Vol. 6), Part B, Section 4.3.3.
435  */
436 struct scanning_filter_policy_t : SafeEnum<scanning_filter_policy_t, uint8_t> {
437  /// enumeration of scanning_filter_policy_t values
438  enum type {
439  /**
440  * Accept all advertising packets except directed advertising packets not
441  * addressed to this device.
442  */
443  NO_FILTER = 0x00,
444 
445  /**
446  * Accept only advertising packets from devices in the whitelist except
447  * directed advertising packets not addressed to this device.
448  */
449  FILTER_ADVERTISING = 0x01,
450 
451  /**
452  * Accept all advertising packets except directed advertising packets
453  * where the initiator's identity address does not address this device.
454  *
455  * @note Directed advertising packets where the initiator's address is a
456  * resolvable private address that cannot be resolved are also accepted.
457  */
458  NO_FILTER_INCLUDE_UNRESOLVABLE_DIRECTED = 2,
459 
460  /**
461  * Accept all advertising packets except:
462  * - Advertising packets where the advertiser's
463  * identity address is not in the whitelist.
464  * - Directed advertising packets where the initiator's identity address
465  * does not address this device.
466  *
467  * @note Directed advertising packets where the initiator's address is a
468  * resolvable private address that cannot be resolved are also accepted.
469  */
470  FILTER_ADVERTISING_INCLUDE_UNRESOLVABLE_DIRECTED = 3
471  };
472 
473  /**
474  * Construct a new instance of scanning_filter_policy_t.
475  *
476  * @param value The value of the scanning_filter_policy_t created.
477  */
479  {
480  }
481 };
482 
483 /**
484  * Filter policy that you can use during connection initiation.
485  */
486 struct initiator_filter_policy_t : SafeEnum<initiator_filter_policy_t, uint8_t> {
487  /// enumeration of initiator_filter_policy_t values.
488  enum type {
489  /**
490  * The whitelist is not used to determine which advertiser to connect to.
491  */
493 
494  /**
495  * The whitelist is used to determine which advertiser to connect to.
496  */
497  USE_WHITE_LIST
498  };
499 
500  /**
501  * Construct a initiator_filter_policy_t.
502  * @param value The value of the initiator_filter_policy_t.
503  */
505  {
506  }
507 };
508 
509 /**
510  * Scanning policy filter mode.
511  *
512  * @see Bluetooth Core Specification 4.2 (Vol. 6), Part B, Section 4.3.3.
513  */
514 struct duplicates_filter_t : SafeEnum<duplicates_filter_t, uint8_t> {
515  /// enumeration of duplicates_filter_t values
516  enum type {
517  /**
518  * Disable duplicate filtering.
519  */
521 
522  /**
523  * Enable duplicate filtering.
524  */
526 
527  /**
528  * Enable duplicate filtering, and reset the cache periodically.
529  */
530  PERIODIC_RESET
531  };
532 
533  /**
534  * Construct a new duplicates_filter_t value.
535  * @param value The value of the duplicates_filter_t created.
536  */
538  {
539  }
540 };
541 
542 /**
543  * Type used to model the own address used during the following GAP operations:
544  * advertising, scanning and initiating
545  */
546 struct own_address_type_t : SafeEnum<own_address_type_t, uint8_t> {
547  /// enumeration of own_address_type_t values.
548  enum type {
549  /**
550  * Use the public device address.
551  */
552  PUBLIC = 0x00,
553 
554  /**
555  * Use the random device address.
556  */
557  RANDOM = 0x01,
558 
559  /**
560  * Generated resolvable private address based on the local IRK from the
561  * resolving list. Use the public address if no entry match in the resolving
562  * list.
563  */
564  RESOLVABLE_PRIVATE_ADDRESS_PUBLIC_FALLBACK = 0x02,
565 
566  /**
567  * Generated resolvable private address based on the local IRK from the
568  * resolving list. Use the random address if no entry match in the resolving
569  * list.
570  */
571  RESOLVABLE_PRIVATE_ADDRESS_RANDOM_FALLBACK = 0x03,
572  };
573 
574  /**
575  * Construct a new instance of own_address_type_t.
576  * @param value The value of the own_address_type_t created.
577  */
579  {
580  }
581 };
582 
583 /**
584  * Type of an address to connect to.
585  *
586  * It is used to connect to a device directly with directed advertising.
587  */
588 struct target_peer_address_type_t : SafeEnum<target_peer_address_type_t, uint8_t> {
589  /// enumeration of target_peer_address_type_t values.
590  enum type {
591  PUBLIC = 0x00, /**< Public Device Address or Public Identity Address. */
592  RANDOM = 0x01, /**< Random Device Address or Random (static) Identity Address. */
593  };
594 
595  /**
596  * Create a new target_peer_address_type_t.
597  * @param value The value of the target_peer_address_type_t created.
598  */
600  {
601  }
602 };
603 
604 /**
605  * Accuracy of the master clock.
606  */
607 struct clock_accuracy_t : SafeEnum<clock_accuracy_t, uint8_t> {
608  /// enumeration of clock_accuracy_t values.
609  enum type {
610  /**
611  * 500 PPM
612  */
613  PPM_500 = 0x00,
614 
615  /**
616  * 250 PPM
617  */
618  PPM_250 = 0x01,
619 
620  /**
621  * 150 PPM
622  */
623  PPM_150 = 0x02,
624 
625  /**
626  * 100 PPM
627  */
628  PPM_100 = 0x03,
629 
630  /**
631  * 75 PPM
632  */
633  PPM_75 = 0x04,
634 
635  /**
636  * 50 PPM
637  */
638  PPM_50 = 0x05,
639 
640  /**
641  * 30 PPM
642  */
643  PPM_30 = 0x06,
644 
645  /**
646  * 20 PPM
647  */
648  PPM_20 = 0x07
649  };
650 
651  /** Get clock accuracy.
652  *
653  * @return Parts per million as a number.
654  */
655  uint16_t get_ppm()
656  {
657  switch (value()) {
658  case PPM_500:
659  return 500;
660  case PPM_250:
661  return 250;
662  case PPM_150:
663  return 150;
664  case PPM_100:
665  return 100;
666  case PPM_75:
667  return 75;
668  case PPM_50:
669  return 50;
670  case PPM_30:
671  return 30;
672  case PPM_20:
673  return 20;
674  default:
675  return 0;
676  }
677  }
678 
679  /**
680  * Construct a new clock_accuracy_t value.
681  * @param value The value of the clock_accuracy_t created.
682  */
684  {
685  }
686 
687 #if !defined(DOXYGEN_ONLY)
688 
689  /**
690  * Construct a new clock_accuracy_t value from a raw value.
691  * @param raw_value The value of the clock accuracy.
692  */
693  explicit clock_accuracy_t(uint8_t raw_value) : SafeEnum(raw_value)
694  {
695  }
696 
697 #endif
698 };
699 
700 /**
701  * Enumeration of GAP roles.
702  *
703  * @note The BLE API does not express the broadcaster and scanner roles.
704  *
705  * @attention A device can fulfill different roles concurrently.
706  */
707 struct connection_role_t : SafeEnum<connection_role_t, uint8_t> {
708  /** struct scoped enum wrapped by the class */
709  enum type {
710  /**
711  * Central Role.
712  *
713  * The device can scan and initiate connection to peripherals. It
714  * acts as the master when a connection is established.
715  *
716  * @note A central is a scanner.
717  */
718  CENTRAL = 0x00,
719 
720  /**
721  * Peripheral Role.
722  *
723  * The device can advertise, and you can connect it by a central. It
724  * acts as a slave when connected.
725  *
726  * @note A peripheral is a broadcaster.
727  */
728  PERIPHERAL = 0x01
729  };
730 
731  /**
732  * Construct a new instance of role_t.
733  *
734  * @param value The value of the role_t created.
735  */
737  {
738  }
739 
740 #if !defined(DOXYGEN_ONLY)
741 
742  /**
743  * Explicit constructor from a raw value.
744  * @param raw_value The role.
745  */
746  explicit connection_role_t(uint8_t raw_value) : SafeEnum(raw_value)
747  {
748  }
749 
750 #endif
751 };
752 
753 /**
754  * Enumeration of disconnection reasons that should be transmited to the peer.
755  */
756 struct local_disconnection_reason_t : SafeEnum<local_disconnection_reason_t, uint8_t> {
757  /// enumeration of local_disconnection_reason_t values.
758  enum type {
759  /**
760  * GAP or GATT failed to authenticate the peer.
761  */
762  AUTHENTICATION_FAILURE = 0x05,
763 
764  /**
765  * Connection terminated by the user.
766  */
767  USER_TERMINATION = 0x13,
768 
769  /**
770  * Connection termination due to low resources.
771  */
772  LOW_RESOURCES = 0x14,
773 
774  /**
775  * Connection termination due to power off.
776  */
777  POWER_OFF = 0x15,
778 
779  /**
780  * Remote feature not supported.
781  */
782  UNSUPPORTED_REMOTE_FEATURE = 0x1A,
783 
784  /**
785  * Not possible to pai with a unit key.
786  */
787  PAIRING_WITH_UNIT_KEY_NOT_SUPPORTED = 0x29,
788 
789  /**
790  * Connection parameters were unacceptable.
791  */
792  UNACCEPTABLE_CONNECTION_PARAMETERS = 0x3B
793  };
794 
795  /**
796  * Construct a new instance of disconnection_reason_t.
797  *
798  * @param value The value of the local_disconnection_reason_t created.
799  */
801  {
802  }
803 };
804 
805 
806 /**
807  * Enumeration of disconnection reasons received in a disconnection event.
808  */
809 struct disconnection_reason_t : SafeEnum<disconnection_reason_t, uint8_t> {
810  /// enumeration of disconnection_reason_t values.
811  enum type {
812  /**
813  * GAP or GATT failed to authenticate the peer.
814  */
815  AUTHENTICATION_FAILURE = 0x05,
816 
817  /**
818  * The connection timed out.
819  */
820  CONNECTION_TIMEOUT = 0x08,
821 
822  /**
823  * Connection terminated by the user.
824  */
825  REMOTE_USER_TERMINATED_CONNECTION = 0x13,
826 
827  /**
828  * Remote device terminated connection due to low resources.
829  */
830  REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES = 0x14,
831 
832  /**
833  * Remote device terminated connection due to power off.
834  */
835  REMOTE_DEV_TERMINATION_DUE_TO_POWER_OFF = 0x15,
836 
837  /**
838  * Indicate that the local user or the internal
839  * Bluetooth subsystem terminated the connection.
840  */
841  LOCAL_HOST_TERMINATED_CONNECTION = 0x16,
842 
843  /**
844  * Connection parameters were unacceptable.
845  */
846  UNACCEPTABLE_CONNECTION_PARAMETERS = 0x3B
847  };
848 
849  /**
850  * Construct a new instance of disconnection_reason_t.
851  *
852  * @param value The value of the disconnection_reason_t created.
853  */
855  {
856  }
857 };
858 
859 /**
860  * Privacy Configuration of the peripheral role.
861  *
862  * @note This configuration also applies to the broadcaster role configuration.
863  */
865  /**
866  * Indicates if nonresolvable random address should be used when the
867  * peripheral advertises nonconnectable packets.
868  *
869  * Resolvable random address continues to be used for connectable packets.
870  */
872 
873  /**
874  * Resolution strategy for initiator resolvable addresses when a
875  * connection request is received.
876  */
878  /**
879  * Do not resolve the address of the initiator and accept the
880  * connection request.
881  */
883 
884  /**
885  * If a bond is present in the secure database and the address
886  * resolution fails, then reject the connection request with the error
887  * code AUTHENTICATION_FAILLURE.
888  */
890 
891  /**
892  * Perform the pairing procedure if the initiator resolvable
893  * address failed the resolution process.
894  */
896 
897  /**
898  * Perform the authentication procedure if the initiator resolvable
899  * address failed the resolution process.
900  */
901  PERFORM_AUTHENTICATION_PROCEDURE
902  };
903 
904  MBED_DEPRECATED_SINCE("mbed-os-5.11", "Use resolution_strategy_t instead.")
906 
907  /**
908  * Connection strategy to use when a connection request contains a
909  * private resolvable address.
910  */
911  resolution_strategy_t resolution_strategy;
912 };
913 
914 /**
915  * Privacy configuration of the central role.
916  *
917  * @note This configuration is also used when the local device operates as
918  * an observer.
919  */
921  /**
922  * Indicates if nonresolvable random address should be used when the
923  * central or observer sends scan request packets.
924  *
925  * Resolvable random address continues to be used for connection requests.
926  */
928 
929 
930  /**
931  * Resolution strategy of resolvable addresses received in advertising
932  * packets.
933  */
935  /**
936  * Do not resolve the address received in advertising packets.
937  */
939 
940  /**
941  * Resolve the resolvable addresses in the advertising packet and
942  * forward advertising packet to the application independently of
943  * the address resolution procedure result.
944  */
946 
947  /**
948  * Filter out packets containing a resolvable address that cannot be resolved
949  * by this device.
950  *
951  * @note Filtering is applied if the local device contains at least
952  * one bond.
953  */
954  RESOLVE_AND_FILTER
955  };
956 
957  MBED_DEPRECATED_SINCE("mbed-os-5.11", "Use resolution_strategy_t instead.")
958  typedef resolution_strategy_t ResolutionStrategy;
959 
960  /**
961  * Resolution strategy applied to advertising packets received by the
962  * local device.
963  */
964  resolution_strategy_t resolution_strategy;
965 };
966 
967 
968 /**
969  * @}
970  * @}
971  */
972 
973 } // namespace ble
974 
975 #endif //BLE_GAP_TYPES_H
Disable duplicate filtering.
Definition: Types.h:520
type
enumeration of initiator_filter_policy_t values.
Definition: Types.h:488
type
struct scoped enum wrapped by the class
Definition: Types.h:709
advertising_data_status_t data_status() const
Payload completeness status.
Definition: Types.h:333
Duration< uint16_t, 10000, Range< 0x00, 0xFFFF >, Value< uint16_t, 0x0000 > > scan_duration_t
Scan process duration.
Definition: Types.h:60
disconnection_reason_t(type value)
Construct a new instance of disconnection_reason_t.
Definition: Types.h:854
Device is scannable but not connectable.
Definition: Types.h:174
Advertising policy filter modes.
Definition: Types.h:394
If a bond is present in the secure database and the address resolution fails, then reject the connect...
Definition: Types.h:889
Device is not connectable and not scannable.
Definition: Types.h:181
target_peer_address_type_t(type value)
Create a new target_peer_address_type_t.
Definition: Types.h:599
Device is connectable, scannable and doesn&#39;t expect connection from a specific peer.
Definition: Types.h:160
Duration< uint16_t, 10000, Range< 0x0A, 0x0C80 > > supervision_timeout_t
Time after which a connection is loss of devices have not exchanged data.
Definition: Types.h:98
uint16_t periodic_sync_handle_t
Handle of a sync representing a periodic advertiser.
Definition: Types.h:141
Enumeration of GAP roles.
Definition: Types.h:707
Scanning policy filter mode.
Definition: Types.h:436
type
enumeration of local_disconnection_reason_t values.
Definition: Types.h:758
Perform the pairing procedure if the initiator resolvable address failed the resolution process...
Definition: Types.h:895
Duration< uint16_t, 1250, Range< 0x06, 0xFFFF > > periodic_interval_t
Interval between two periodic advertising events.
Definition: Types.h:120
type
enumeration of clock_accuracy_t values.
Definition: Types.h:609
Do not resolve the address of the initiator and accept the connection request.
Definition: Types.h:882
bool scannable_advertising() const
Is advertising scannable.
Definition: Types.h:297
Enumeration of disconnection reasons received in a disconnection event.
Definition: Types.h:809
Duration< uint16_t, 1250, Range< 0x06, 0x0C80 > > conn_interval_t
Time interval between two connection events.
Definition: Types.h:89
bool scan_response() const
Is this a scan response.
Definition: Types.h:315
Device is connectable and expects connection from a specific peer (sent at long user set intervals)...
Definition: Types.h:186
Duration< uint16_t, 625, Range< 0, 0xFFFF > > conn_event_length_t
Duration of a connection event.
Definition: Types.h:105
uint8_t advertising_sid_t
Identify an advertising SID.
Definition: Types.h:374
scanning_filter_policy_t(type value)
Construct a new instance of scanning_filter_policy_t.
Definition: Types.h:478
uint8_t value() const
Explicit access to the inner value of the SafeEnum instance.
Definition: SafeEnum.h:202
type
enumeration of duplicates_filter_t values
Definition: Types.h:516
type
enumeration of advertising_filter_policy_t values
Definition: Types.h:396
Device is connectable and expects connection from a specific peer.
Definition: Types.h:167
bool use_non_resolvable_random_address
Indicates if nonresolvable random address should be used when the central or observer sends scan requ...
Definition: Types.h:927
Duration< uint16_t, 10000, Range< 0x0A, 0x4000 > > sync_timeout_t
Time after which a periodic sync link is considered lost if the receiver hasn&#39;t received anything fro...
Definition: Types.h:113
clock_accuracy_t(type value)
Construct a new clock_accuracy_t value.
Definition: Types.h:683
Used to indicate if the packet is complete and if it&#39;s truncated.
Definition: Types.h:219
Helper class used to define safe enumerations.
Definition: SafeEnum.h:109
int8_t rssi_t
Received signal strength.
Definition: Types.h:378
Partial advertising payload, more to come.
Definition: Types.h:224
SafeEnum(uint8_t value)
Construction of an enumeration value.
Definition: SafeEnum.h:119
Type of an address to connect to.
Definition: Types.h:588
Device is connectable, but not scannable and doesn&#39;t expect connection from a specific peer...
Definition: Types.h:193
advertising_data_status_t(type value)
Construct a new advertising_data_status_t value.
Definition: Types.h:232
advertising_filter_policy_t(type value)
Construct a advertising_filter_policy_t.
Definition: Types.h:426
bool use_non_resolvable_random_address
Indicates if nonresolvable random address should be used when the peripheral advertises nonconnectabl...
Definition: Types.h:871
int8_t advertising_power_t
Describe the advertising power.
Definition: Types.h:387
Duration< uint16_t, 1280000, Range< 0x00, 0xFFFF > > scan_period_t
Time interval between two scan processes.
Definition: Types.h:68
bool complete() const
Is payload complete.
Definition: Types.h:344
Do not resolve the address received in advertising packets.
Definition: Types.h:938
Enumeration of disconnection reasons that should be transmited to the peer.
Definition: Types.h:756
resolution_strategy_t
Resolution strategy for initiator resolvable addresses when a connection request is received...
Definition: Types.h:877
own_address_type_t(type value)
Construct a new instance of own_address_type_t.
Definition: Types.h:578
connection_role_t(type value)
Construct a new instance of role_t.
Definition: Types.h:736
duplicates_filter_t(type value)
Construct a new duplicates_filter_t value.
Definition: Types.h:537
uint8_t advertising_handle_t
Handle of an advertising set.
Definition: Types.h:134
Duration< uint16_t, 625, Range< 0x04, 0xFFFF > > scan_interval_t
Time interval between two scans.
Definition: Types.h:75
Properties of an advertising event.
Definition: Types.h:252
bool directed_advertising() const
Is advertising directed.
Definition: Types.h:306
Resolve the resolvable addresses in the advertising packet and forward advertising packet to the appl...
Definition: Types.h:945
initiator_filter_policy_t(type value)
Construct a initiator_filter_policy_t.
Definition: Types.h:504
Duration< uint32_t, 625, Range< 0x20, 0xFFFFFF > > adv_interval_t
Time interval between two advertisements.
Definition: Types.h:42
Scanning policy filter mode.
Definition: Types.h:514
type
enumeration of target_peer_address_type_t values.
Definition: Types.h:590
resolution_strategy_t
Resolution strategy of resolvable addresses received in advertising packets.
Definition: Types.h:934
The whitelist is not used to determine which advertiser to connect to.
Definition: Types.h:492
Advertising payload complete.
Definition: Types.h:223
type
enumeration of advertising_type_t values
Definition: Types.h:151
type
enumeration of advertising_data_status_t values
Definition: Types.h:221
local_disconnection_reason_t(type value)
Construct a new instance of disconnection_reason_t.
Definition: Types.h:800
Bounded< uint16_t, 0, 0x01F3 > slave_latency_t
Number of connection events that can be skipped by the slave.
Definition: Types.h:127
bool more_data_to_come() const
Is there more data coming.
Definition: Types.h:353
Encapsulates the peripheral advertising modes.
Definition: Types.h:149
Accuracy of the master clock.
Definition: Types.h:607
bool connectable() const
Is advertising connectable.
Definition: Types.h:288
Duration< uint16_t, 625, Range< 0x04, 0xFFFF > > scan_window_t
Duration of a scan.
Definition: Types.h:82
Privacy configuration of the central role.
Definition: Types.h:920
advertising_type_t(type value)
Construct a new advertising_type_t value.
Definition: Types.h:211
Enable duplicate filtering.
Definition: Types.h:525
Privacy Configuration of the peripheral role.
Definition: Types.h:864
bool truncated() const
Is the payload truncated.
Definition: Types.h:362
type
enumeration of disconnection_reason_t values.
Definition: Types.h:811
Type used to model the own address used during the following GAP operations: advertising, scanning and initiating.
Definition: Types.h:546
Entry namespace for all BLE API definitions.
type
enumeration of scanning_filter_policy_t values
Definition: Types.h:438
type
enumeration of own_address_type_t values.
Definition: Types.h:548
uint16_t get_ppm()
Get clock accuracy.
Definition: Types.h:655
bool legacy_advertising() const
Is this legacy advertising.
Definition: Types.h:324
#define MBED_DEPRECATED_SINCE(D, M)
MBED_DEPRECATED("message string") Mark a function declaration as deprecated, if it used then a warnin...
Duration< uint16_t, 10000, Range< 0x00, 0xFFFF >, Value< uint16_t, 0x0000 > > adv_duration_t
Advertising process duration.
Definition: Types.h:51
Model BLE durations.
Definition: Duration.h:100
Filter policy that you can use during connection initiation.
Definition: Types.h:486
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.