Skip to content

Commit cf870e8

Browse files
JordanYatesaescolar
authored andcommitted
bluetooth: correct bt_le_scan_param scan type
The `type` parameter of `struct bt_le_scan_param` is documented as taking a `BT_LE_SCAN_TYPE_*` value, not a `BT_HCI_LE_SCAN_*` value. In practice this makes no difference as the values are defined as the same integer, but does result in `<zephyr/bluetooth/hci.h>` not needing to be included. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent bc4743f commit cf870e8

File tree

9 files changed

+12
-13
lines changed

9 files changed

+12
-13
lines changed

samples/bluetooth/central_multilink/src/central_multilink.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static void device_found(const bt_addr_le_t *addr, int8_t rssi, uint8_t type,
9090
static void start_scan(void)
9191
{
9292
struct bt_le_scan_param scan_param = {
93-
.type = BT_HCI_LE_SCAN_PASSIVE,
93+
.type = BT_LE_SCAN_TYPE_PASSIVE,
9494
.options = BT_LE_SCAN_OPT_NONE,
9595
.interval = SCAN_INTERVAL,
9696
.window = SCAN_WINDOW,

samples/bluetooth/scan_adv/src/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <zephyr/sys/util.h>
1313

1414
#include <zephyr/bluetooth/bluetooth.h>
15-
#include <zephyr/bluetooth/hci.h>
1615

1716
static uint8_t mfg_data[] = { 0xff, 0xff, 0x00 };
1817

@@ -29,7 +28,7 @@ static void scan_cb(const bt_addr_le_t *addr, int8_t rssi, uint8_t adv_type,
2928
int main(void)
3029
{
3130
struct bt_le_scan_param scan_param = {
32-
.type = BT_HCI_LE_SCAN_PASSIVE,
31+
.type = BT_LE_SCAN_TYPE_PASSIVE,
3332
.options = BT_LE_SCAN_OPT_NONE,
3433
.interval = 0x0010,
3534
.window = 0x0010,

subsys/bluetooth/host/scan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,8 +1461,8 @@ void bt_hci_le_adv_report(struct net_buf *buf)
14611461

14621462
static bool valid_le_scan_param(const struct bt_le_scan_param *param)
14631463
{
1464-
if (param->type != BT_HCI_LE_SCAN_PASSIVE &&
1465-
param->type != BT_HCI_LE_SCAN_ACTIVE) {
1464+
if (param->type != BT_LE_SCAN_TYPE_PASSIVE &&
1465+
param->type != BT_LE_SCAN_TYPE_ACTIVE) {
14661466
return false;
14671467
}
14681468

subsys/bluetooth/mesh/adv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,8 @@ int bt_mesh_scan_active_set(bool active)
378378
int bt_mesh_scan_enable(void)
379379
{
380380
struct bt_le_scan_param scan_param = {
381-
.type = active_scanning ? BT_HCI_LE_SCAN_ACTIVE :
382-
BT_HCI_LE_SCAN_PASSIVE,
381+
.type = active_scanning ? BT_LE_SCAN_TYPE_ACTIVE :
382+
BT_LE_SCAN_TYPE_PASSIVE,
383383
.interval = MESH_SCAN_INTERVAL,
384384
.window = MESH_SCAN_WINDOW
385385
};

tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_expired.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void start_rpa_scanning(void)
108108
{
109109
/* Start passive scanning */
110110
struct bt_le_scan_param scan_param = {
111-
.type = BT_HCI_LE_SCAN_PASSIVE,
111+
.type = BT_LE_SCAN_TYPE_PASSIVE,
112112
.options = BT_LE_SCAN_OPT_FILTER_DUPLICATE,
113113
.interval = 0x0040,
114114
.window = 0x0020,

tests/bsim/bluetooth/host/privacy/peripheral/src/tester_rpa_rotation.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ void start_scanning(void)
122122
{
123123
/* Start passive scanning */
124124
struct bt_le_scan_param scan_param = {
125-
.type = BT_HCI_LE_SCAN_PASSIVE,
125+
.type = BT_LE_SCAN_TYPE_PASSIVE,
126126
.options = BT_LE_SCAN_OPT_FILTER_DUPLICATE,
127127
.interval = 0x0040,
128128
.window = 0x0020,

tests/bsim/bluetooth/ll/advx/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1300,7 +1300,7 @@ static struct bt_le_per_adv_sync_cb sync_cb = {
13001300
static void test_scanx_main(void)
13011301
{
13021302
struct bt_le_scan_param scan_param = {
1303-
.type = BT_HCI_LE_SCAN_ACTIVE,
1303+
.type = BT_LE_SCAN_TYPE_ACTIVE,
13041304
.options = BT_LE_SCAN_OPT_NONE,
13051305
.interval = 0x0004,
13061306
.window = 0x0004,

tests/bsim/bluetooth/ll/bis/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ static struct bt_le_scan_cb scan_callbacks = {
753753
static void test_iso_recv_main(void)
754754
{
755755
struct bt_le_scan_param scan_param = {
756-
.type = BT_HCI_LE_SCAN_ACTIVE,
756+
.type = BT_LE_SCAN_TYPE_ACTIVE,
757757
.options = BT_LE_SCAN_OPT_NONE,
758758
.interval = 0x0004,
759759
.window = 0x0004,
@@ -1028,7 +1028,7 @@ static void test_iso_recv_main(void)
10281028
static void test_iso_recv_vs_dp_main(void)
10291029
{
10301030
struct bt_le_scan_param scan_param = {
1031-
.type = BT_HCI_LE_SCAN_ACTIVE,
1031+
.type = BT_LE_SCAN_TYPE_ACTIVE,
10321032
.options = BT_LE_SCAN_OPT_NONE,
10331033
.interval = 0x0004,
10341034
.window = 0x0004,

tests/bsim/bluetooth/mesh/src/mesh_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ void bt_mesh_test_send_over_adv(void *data, size_t len)
569569
int bt_mesh_test_wait_for_packet(bt_le_scan_cb_t scan_cb, struct k_sem *observer_sem, uint16_t wait)
570570
{
571571
struct bt_le_scan_param scan_param = {
572-
.type = BT_HCI_LE_SCAN_PASSIVE,
572+
.type = BT_LE_SCAN_TYPE_PASSIVE,
573573
.options = BT_LE_SCAN_OPT_NONE,
574574
.interval = BT_MESH_ADV_SCAN_UNIT(1000),
575575
.window = BT_MESH_ADV_SCAN_UNIT(1000)

0 commit comments

Comments
 (0)