@@ -523,16 +523,42 @@ enum {
523523 /**
524524 * @brief Advertise as connectable.
525525 *
526+ * @deprecated Use @ref BT_LE_ADV_OPT_CONN instead.
527+ *
526528 * Advertise as connectable. If not connectable then the type of
527529 * advertising is determined by providing scan response data.
528530 * The advertiser address is determined by the type of advertising
529531 * and/or enabling privacy @kconfig{CONFIG_BT_PRIVACY}.
532+ *
533+ * Starting connectable advertising preallocates a connection
534+ * object. If this fails, the API returns @c -ENOMEM.
535+ *
536+ * When an advertiser set results in a connection creation, the
537+ * controller automatically disables that advertising set.
538+ *
539+ * If the advertising set was started with @ref bt_le_adv_start
540+ * without @ref BT_LE_ADV_OPT_ONE_TIME, the host will attempt to
541+ * resume the advertiser under some conditions.
542+ */
543+ BT_LE_ADV_OPT_CONNECTABLE __deprecated = BIT (0 ),
544+
545+ /**
546+ * @internal
547+ *
548+ * Internal access to the deprecated value to maintain the
549+ * implementation of the deprecated feature.
550+ *
551+ * At the end of the deprecation period, ABI will change so
552+ * `BT_LE_ADV_OPT_CONN` is just `BIT(0)`, removing the need for this
553+ * symbol.
530554 */
531- BT_LE_ADV_OPT_CONNECTABLE = BIT (0 ),
555+ _BT_LE_ADV_OPT_CONNECTABLE = BIT (0 ),
532556
533557 /**
534558 * @brief Advertise one time.
535559 *
560+ * @deprecated Use @ref BT_LE_ADV_OPT_CONN instead.
561+ *
536562 * Don't try to resume connectable advertising after a connection.
537563 * This option is only meaningful when used together with
538564 * BT_LE_ADV_OPT_CONNECTABLE. If set the advertising will be stopped
@@ -544,7 +570,35 @@ enum {
544570 * @ref bt_le_ext_adv_start then this behavior is the default behavior
545571 * and this flag has no effect.
546572 */
547- BT_LE_ADV_OPT_ONE_TIME = BIT (1 ),
573+ BT_LE_ADV_OPT_ONE_TIME __deprecated = BIT (1 ),
574+
575+ /**
576+ * @internal
577+ *
578+ * Internal access to the deprecated value to maintain
579+ * the implementation of the deprecated feature.
580+ */
581+ _BT_LE_ADV_OPT_ONE_TIME = BIT (1 ),
582+
583+ /**
584+ * @brief Connectable advertising
585+ *
586+ * Starting connectable advertising preallocates a connection
587+ * object. If this fails, the API returns @c -ENOMEM.
588+ *
589+ * The advertising set stops immediately after it creates a
590+ * connection. This happens automatically in the controller.
591+ *
592+ * @note To continue advertising after a connection is created,
593+ * the application should listen for the @ref bt_conn_cb.connected
594+ * event and start the advertising set again. Note that the
595+ * advertiser cannot be started when all connection objects are
596+ * in use. In that case, defer starting the advertiser until
597+ * @ref bt_conn_cb.recycled. To continue after a disconnection,
598+ * listen for @ref bt_conn_cb.recycled.
599+
600+ */
601+ BT_LE_ADV_OPT_CONN = BIT (0 ) | BIT (1 ),
548602
549603 /**
550604 * @brief Advertise using identity address.
@@ -623,8 +677,7 @@ enum {
623677 * @brief Support scan response data.
624678 *
625679 * When used together with @ref BT_LE_ADV_OPT_EXT_ADV then this option
626- * cannot be used together with the @ref BT_LE_ADV_OPT_CONNECTABLE
627- * option.
680+ * cannot be used together with the @ref BT_LE_ADV_OPT_CONN option.
628681 * When used together with @ref BT_LE_ADV_OPT_EXT_ADV then scan
629682 * response data must be set.
630683 */
@@ -912,20 +965,61 @@ struct bt_le_per_adv_param {
912965 BT_LE_ADV_PARAM_INIT(_options, _int_min, _int_max, _peer) \
913966 })
914967
915- #define BT_LE_ADV_CONN_DIR (_peer ) BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | \
916- BT_LE_ADV_OPT_ONE_TIME, 0, 0,\
917- _peer)
968+ #define BT_LE_ADV_CONN_DIR (_peer ) BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN, 0, 0, _peer)
918969
970+ /**
971+ * @deprecated This is a convenience macro for @ref
972+ * BT_LE_ADV_OPT_CONNECTABLE, which is deprecated. Please use
973+ * @ref BT_LE_ADV_CONN_FAST_1 or @ref BT_LE_ADV_CONN_FAST_2
974+ * instead.
975+ */
976+ #define BT_LE_ADV_CONN \
977+ BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, BT_GAP_ADV_FAST_INT_MIN_2, \
978+ BT_GAP_ADV_FAST_INT_MAX_2, NULL) \
979+ __DEPRECATED_MACRO
919980
920- #define BT_LE_ADV_CONN BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE, \
921- BT_GAP_ADV_FAST_INT_MIN_2, \
922- BT_GAP_ADV_FAST_INT_MAX_2, NULL)
981+ /** @brief GAP recommended connectable advertising
982+ *
983+ * This is the recommended default for when a person is likely
984+ * to be waiting the device to connect or be discovered.
985+ *
986+ * Use a longer interval to conserve battery at the cost of
987+ * responsiveness. Consider entering a lower power state with
988+ * longer intervals after a timeout.
989+ *
990+ * GAP recommends advertisers use this "when user-initiated".
991+ * The application developer decides what this means. It can by
992+ * any time the user interacts with the device, a press on a
993+ * dedicated Bluetooth wakeup button, or anything in-between.
994+ *
995+ * This is the recommended setting for limited discoverable
996+ * mode.
997+ *
998+ * See Bluetooth Core Specification:
999+ * - 3.C.A "Timers and Constants", T_GAP(adv_fast_interval1)
1000+ * - 3.C.9.3.11 "Connection Establishment Timing parameters"
1001+ */
1002+ #define BT_LE_ADV_CONN_FAST_1 \
1003+ BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN, BT_GAP_ADV_FAST_INT_MIN_1, BT_GAP_ADV_FAST_INT_MAX_1, \
1004+ NULL)
9231005
924- /** This is the recommended default for connectable advertisers.
1006+ /** @brief Connectable advertising with
1007+ * T_GAP(adv_fast_interval2)
1008+ *
1009+ * The advertising interval corresponds to what was offered as
1010+ * `BT_LE_ADV_CONN` in Zephyr 3.6 and earlier, but unlike
1011+ * `BT_LE_ADV_CONN`, the host does not automatically resume the
1012+ * advertiser after it results in a connection.
1013+ *
1014+ * See Bluetooth Core Specification:
1015+ * - 3.C.A "Timers and Constants", T_GAP(adv_fast_interval1)
1016+ * - 3.C.9.3.11 "Connection Establishment Timing parameters"
9251017 */
926- #define BT_LE_ADV_CONN_ONE_TIME \
927- BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME, \
928- BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, NULL)
1018+ #define BT_LE_ADV_CONN_FAST_2 \
1019+ BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN, BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, \
1020+ NULL)
1021+
1022+ #define BT_LE_ADV_CONN_ONE_TIME BT_LE_ADV_CONN_FAST_2 __DEPRECATED_MACRO
9291023
9301024/**
9311025 * @deprecated This macro will be removed in the near future, see
@@ -948,11 +1042,9 @@ struct bt_le_per_adv_param {
9481042 BT_GAP_ADV_FAST_INT_MAX_2, NULL) \
9491043 __DEPRECATED_MACRO
9501044
951- #define BT_LE_ADV_CONN_DIR_LOW_DUTY (_peer ) \
952- BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONNECTABLE | BT_LE_ADV_OPT_ONE_TIME | \
953- BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY, \
954- BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, \
955- _peer)
1045+ #define BT_LE_ADV_CONN_DIR_LOW_DUTY (_peer ) \
1046+ BT_LE_ADV_PARAM(BT_LE_ADV_OPT_CONN | BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY, \
1047+ BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, _peer)
9561048
9571049/** Non-connectable advertising with private address */
9581050#define BT_LE_ADV_NCONN BT_LE_ADV_PARAM(0, BT_GAP_ADV_FAST_INT_MIN_2, \
@@ -976,11 +1068,9 @@ struct bt_le_per_adv_param {
9761068 NULL)
9771069
9781070/** Connectable extended advertising */
979- #define BT_LE_EXT_ADV_CONN BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | \
980- BT_LE_ADV_OPT_CONNECTABLE, \
981- BT_GAP_ADV_FAST_INT_MIN_2, \
982- BT_GAP_ADV_FAST_INT_MAX_2, \
983- NULL)
1071+ #define BT_LE_EXT_ADV_CONN \
1072+ BT_LE_ADV_PARAM(BT_LE_ADV_OPT_EXT_ADV | BT_LE_ADV_OPT_CONN, BT_GAP_ADV_FAST_INT_MIN_2, \
1073+ BT_GAP_ADV_FAST_INT_MAX_2, NULL)
9841074
9851075/**
9861076 * @deprecated This macro will be removed in the near future, see
0 commit comments