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