diff --git a/include/bluetooth/hci.h b/include/bluetooth/hci.h index d8f84a85b0c..9975aa0b76e 100644 --- a/include/bluetooth/hci.h +++ b/include/bluetooth/hci.h @@ -609,14 +609,20 @@ struct bt_hci_cp_le_set_random_address { bt_addr_t bdaddr; } __packed; -/* Advertising types */ -#define BT_LE_ADV_IND 0x00 -#define BT_LE_ADV_DIRECT_IND 0x01 -#define BT_LE_ADV_SCAN_IND 0x02 -#define BT_LE_ADV_NONCONN_IND 0x03 -#define BT_LE_ADV_DIRECT_IND_LOW_DUTY 0x04 -/* Needed in advertising reports when getting info about */ -#define BT_LE_ADV_SCAN_RSP 0x04 +/* LE Advertising Types (LE Advertising Parameters Set)*/ +#define BT_LE_ADV_IND (__DEPRECATED_MACRO 0x00) +#define BT_LE_ADV_DIRECT_IND (__DEPRECATED_MACRO 0x01) +#define BT_LE_ADV_SCAN_IND (__DEPRECATED_MACRO 0x02) +#define BT_LE_ADV_NONCONN_IND (__DEPRECATED_MACRO 0x03) +#define BT_LE_ADV_DIRECT_IND_LOW_DUTY (__DEPRECATED_MACRO 0x04) +/* LE Advertising PDU Types. */ +#define BT_LE_ADV_SCAN_RSP (__DEPRECATED_MACRO 0x04) + +#define BT_HCI_ADV_IND 0x00 +#define BT_HCI_ADV_DIRECT_IND 0x01 +#define BT_HCI_ADV_SCAN_IND 0x02 +#define BT_HCI_ADV_NONCONN_IND 0x03 +#define BT_HCI_ADV_DIRECT_IND_LOW_DUTY 0x04 #define BT_LE_ADV_FP_NO_WHITELIST 0x00 #define BT_LE_ADV_FP_WHITELIST_SCAN_REQ 0x01 diff --git a/samples/bluetooth/central/src/main.c b/samples/bluetooth/central/src/main.c index 282bb0617bc..9175118355e 100644 --- a/samples/bluetooth/central/src/main.c +++ b/samples/bluetooth/central/src/main.c @@ -32,7 +32,8 @@ static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type, } /* We're only interested in connectable events */ - if (type != BT_LE_ADV_IND && type != BT_LE_ADV_DIRECT_IND) { + if (type != BT_GAP_ADV_TYPE_ADV_IND && + type != BT_GAP_ADV_TYPE_ADV_DIRECT_IND) { return; } diff --git a/samples/bluetooth/central_hr/src/main.c b/samples/bluetooth/central_hr/src/main.c index 857fd9dc343..56f6b71a85d 100644 --- a/samples/bluetooth/central_hr/src/main.c +++ b/samples/bluetooth/central_hr/src/main.c @@ -151,7 +151,8 @@ static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type, dev, type, ad->len, rssi); /* We're only interested in connectable events */ - if (type == BT_LE_ADV_IND || type == BT_LE_ADV_DIRECT_IND) { + if (type == BT_GAP_ADV_TYPE_ADV_IND || + type == BT_GAP_ADV_TYPE_ADV_DIRECT_IND) { bt_data_parse(ad, eir_found, (void *)addr); } } diff --git a/samples/boards/bbc_microbit/pong/src/ble.c b/samples/boards/bbc_microbit/pong/src/ble.c index cc232cbfc0c..86985899a74 100644 --- a/samples/boards/bbc_microbit/pong/src/ble.c +++ b/samples/boards/bbc_microbit/pong/src/ble.c @@ -360,7 +360,7 @@ static void create_conn(const bt_addr_le_t *addr) static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type, struct net_buf_simple *ad) { - if (type != BT_LE_ADV_IND) { + if (type != BT_GAP_ADV_TYPE_ADV_IND) { return; } diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 1e5648d8710..1e05f27b963 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -940,7 +940,7 @@ static void le_set_adv_param(struct net_buf *buf, struct net_buf **evt) min_interval = sys_le16_to_cpu(cmd->min_interval); if (IS_ENABLED(CONFIG_BT_CTLR_PARAM_CHECK) && - (cmd->type != BT_LE_ADV_DIRECT_IND)) { + (cmd->type != BT_HCI_ADV_DIRECT_IND)) { u16_t max_interval = sys_le16_to_cpu(cmd->max_interval); if ((min_interval > max_interval) || @@ -2446,7 +2446,7 @@ static inline void le_dir_adv_report(struct pdu_adv *adv, struct net_buf *buf, dir_info = (void *)(((u8_t *)drp) + sizeof(*drp)); /* Directed Advertising */ - dir_info->evt_type = BT_LE_ADV_DIRECT_IND; + dir_info->evt_type = BT_HCI_ADV_DIRECT_IND; #if defined(CONFIG_BT_CTLR_PRIVACY) if (rl_idx < ll_rl_size_get()) { diff --git a/subsys/bluetooth/host/hci_core.c b/subsys/bluetooth/host/hci_core.c index f8449aaed78..6cdffa05bb1 100644 --- a/subsys/bluetooth/host/hci_core.c +++ b/subsys/bluetooth/host/hci_core.c @@ -1771,7 +1771,7 @@ static void check_pending_conn(const bt_addr_le_t *id_addr, } /* Return if event is not connectable */ - if (evtype != BT_LE_ADV_IND && evtype != BT_LE_ADV_DIRECT_IND) { + if (evtype != BT_HCI_ADV_IND && evtype != BT_HCI_ADV_DIRECT_IND) { return; } @@ -3844,7 +3844,7 @@ static void le_adv_report(struct net_buf *buf) if (!IS_ENABLED(CONFIG_BT_PRIVACY) && !IS_ENABLED(CONFIG_BT_SCAN_WITH_IDENTITY) && atomic_test_bit(bt_dev.flags, BT_DEV_EXPLICIT_SCAN) && - info->evt_type == BT_LE_ADV_DIRECT_IND) { + info->evt_type == BT_HCI_ADV_DIRECT_IND) { BT_DBG("Dropped direct adv report"); continue; } @@ -6064,9 +6064,9 @@ int bt_le_adv_start_internal(const struct bt_le_adv_param *param, if (dir_adv) { if (param->options & BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY) { - set_param.type = BT_LE_ADV_DIRECT_IND_LOW_DUTY; + set_param.type = BT_HCI_ADV_DIRECT_IND_LOW_DUTY; } else { - set_param.type = BT_LE_ADV_DIRECT_IND; + set_param.type = BT_HCI_ADV_DIRECT_IND; } bt_addr_le_copy(&set_param.direct_addr, peer); @@ -6082,7 +6082,7 @@ int bt_le_adv_start_internal(const struct bt_le_adv_param *param, BT_HCI_OWN_ADDR_RPA_MASK; } } else { - set_param.type = BT_LE_ADV_IND; + set_param.type = BT_HCI_ADV_IND; } } else { if (param->options & BT_LE_ADV_OPT_USE_IDENTITY) { @@ -6119,9 +6119,9 @@ int bt_le_adv_start_internal(const struct bt_le_adv_param *param, } if (sd || (param->options & BT_LE_ADV_OPT_USE_NAME)) { - set_param.type = BT_LE_ADV_SCAN_IND; + set_param.type = BT_HCI_ADV_SCAN_IND; } else { - set_param.type = BT_LE_ADV_NONCONN_IND; + set_param.type = BT_HCI_ADV_NONCONN_IND; } } diff --git a/subsys/bluetooth/mesh/adv.c b/subsys/bluetooth/mesh/adv.c index 16cfe2ba1b6..319cb015549 100644 --- a/subsys/bluetooth/mesh/adv.c +++ b/subsys/bluetooth/mesh/adv.c @@ -256,7 +256,7 @@ void bt_mesh_adv_send(struct net_buf *buf, const struct bt_mesh_send_cb *cb, static void bt_mesh_scan_cb(const bt_addr_le_t *addr, s8_t rssi, u8_t adv_type, struct net_buf_simple *buf) { - if (adv_type != BT_LE_ADV_NONCONN_IND) { + if (adv_type != BT_GAP_ADV_TYPE_ADV_NONCONN_IND) { return; } diff --git a/subsys/net/l2/bluetooth/bluetooth.c b/subsys/net/l2/bluetooth/bluetooth.c index cd7cd7c30ab..c89fe007602 100644 --- a/subsys/net/l2/bluetooth/bluetooth.c +++ b/subsys/net/l2/bluetooth/bluetooth.c @@ -473,7 +473,8 @@ static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type, struct net_buf_simple *ad) { /* We're only interested in connectable events */ - if (type == BT_LE_ADV_IND || type == BT_LE_ADV_DIRECT_IND) { + if (type == BT_GAP_ADV_TYPE_ADV_IND || + type == BT_GAP_ADV_TYPE_ADV_DIRECT_IND) { ad_parse(ad, eir_found, (void *)addr); } } diff --git a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c index 27eaad0f2e8..f8caea31670 100644 --- a/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c +++ b/tests/bluetooth/bsim_bt/bsim_test_app/src/test_connect1.c @@ -331,7 +331,8 @@ static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t type, dev, type, ad->len, rssi); /* We're only interested in connectable events */ - if (type == BT_LE_ADV_IND || type == BT_LE_ADV_DIRECT_IND) { + if (type == BT_GAP_ADV_TYPE_ADV_IND || + type == BT_GAP_ADV_TYPE_ADV_DIRECT_IND) { bt_data_parse(ad, eir_found, (void *)addr); } } diff --git a/tests/bluetooth/tester/src/gap.c b/tests/bluetooth/tester/src/gap.c index 1b289ebc186..3a3c30862eb 100644 --- a/tests/bluetooth/tester/src/gap.c +++ b/tests/bluetooth/tester/src/gap.c @@ -386,7 +386,7 @@ static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t evtype, { /* if General/Limited Discovery - parse Advertising data to get flags */ if (!(discovery_flags & GAP_DISCOVERY_FLAG_LE_OBSERVE) && - (evtype != BT_LE_ADV_SCAN_RSP)) { + (evtype != BT_GAP_ADV_TYPE_SCAN_RSP)) { u8_t flags = get_ad_flags(ad); /* ignore non-discoverable devices */ @@ -404,7 +404,7 @@ static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t evtype, } /* attach Scan Response data */ - if (evtype == BT_LE_ADV_SCAN_RSP) { + if (evtype == BT_GAP_ADV_TYPE_SCAN_RSP) { struct gap_device_found_ev *ev; bt_addr_le_t a; @@ -449,7 +449,8 @@ static void device_found(const bt_addr_le_t *addr, s8_t rssi, u8_t evtype, /* if Active Scan and scannable event - wait for Scan Response */ if ((discovery_flags & GAP_DISCOVERY_FLAG_LE_ACTIVE_SCAN) && - (evtype == BT_LE_ADV_IND || evtype == BT_LE_ADV_SCAN_IND)) { + (evtype == BT_GAP_ADV_TYPE_ADV_IND || + evtype == BT_GAP_ADV_TYPE_ADV_SCAN_IND)) { LOG_DBG("Waiting for scan response"); return; }