Skip to content

Commit 1821d34

Browse files
committed
Bluetooth: shell: Align with terms in v5.3 spec
Align with the new inclusive naming terms in the v5.3 spec in the Bluetooth shell implementation. Signed-off-by: Carles Cufi <[email protected]>
1 parent 3b33ba2 commit 1821d34

File tree

2 files changed

+43
-43
lines changed

2 files changed

+43
-43
lines changed

subsys/bluetooth/shell/bt.c

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ static int cmd_scan(const struct shell *sh, size_t argc, char *argv[])
903903
options |= BT_LE_SCAN_OPT_FILTER_DUPLICATE;
904904
} else if (!strcmp(arg, "nodups")) {
905905
options &= ~BT_LE_SCAN_OPT_FILTER_DUPLICATE;
906-
} else if (!strcmp(arg, "wl")) {
906+
} else if (!strcmp(arg, "fal")) {
907907
options |= BT_LE_SCAN_OPT_FILTER_ACCEPT_LIST;
908908
} else if (!strcmp(arg, "coded")) {
909909
options |= BT_LE_SCAN_OPT_CODED;
@@ -987,12 +987,12 @@ static int cmd_advertise(const struct shell *sh, size_t argc, char *argv[])
987987
} else if (!strcmp(arg, "non_discov")) {
988988
ad = NULL;
989989
ad_len = 0;
990-
} else if (!strcmp(arg, "wl")) {
990+
} else if (!strcmp(arg, "fal")) {
991991
param.options |= BT_LE_ADV_OPT_FILTER_SCAN_REQ;
992992
param.options |= BT_LE_ADV_OPT_FILTER_CONN;
993-
} else if (!strcmp(arg, "wl-scan")) {
993+
} else if (!strcmp(arg, "fal-scan")) {
994994
param.options |= BT_LE_ADV_OPT_FILTER_SCAN_REQ;
995-
} else if (!strcmp(arg, "wl-conn")) {
995+
} else if (!strcmp(arg, "fal-conn")) {
996996
param.options |= BT_LE_ADV_OPT_FILTER_CONN;
997997
} else if (!strcmp(arg, "identity")) {
998998
param.options |= BT_LE_ADV_OPT_USE_IDENTITY;
@@ -1115,12 +1115,12 @@ static bool adv_param_parse(size_t argc, char *argv[],
11151115
param->options |= BT_LE_ADV_OPT_USE_TX_POWER;
11161116
} else if (!strcmp(arg, "scan-reports")) {
11171117
param->options |= BT_LE_ADV_OPT_NOTIFY_SCAN_REQ;
1118-
} else if (!strcmp(arg, "wl")) {
1118+
} else if (!strcmp(arg, "fal")) {
11191119
param->options |= BT_LE_ADV_OPT_FILTER_SCAN_REQ;
11201120
param->options |= BT_LE_ADV_OPT_FILTER_CONN;
1121-
} else if (!strcmp(arg, "wl-scan")) {
1121+
} else if (!strcmp(arg, "fal-scan")) {
11221122
param->options |= BT_LE_ADV_OPT_FILTER_SCAN_REQ;
1123-
} else if (!strcmp(arg, "wl-conn")) {
1123+
} else if (!strcmp(arg, "fal-conn")) {
11241124
param->options |= BT_LE_ADV_OPT_FILTER_CONN;
11251125
} else if (!strcmp(arg, "identity")) {
11261126
param->options |= BT_LE_ADV_OPT_USE_IDENTITY;
@@ -2892,7 +2892,7 @@ static int cmd_auth_pairing_confirm(const struct shell *sh,
28922892
}
28932893

28942894
#if defined(CONFIG_BT_FILTER_ACCEPT_LIST)
2895-
static int cmd_wl_add(const struct shell *sh, size_t argc, char *argv[])
2895+
static int cmd_fal_add(const struct shell *sh, size_t argc, char *argv[])
28962896
{
28972897
bt_addr_le_t addr;
28982898
int err;
@@ -2912,7 +2912,7 @@ static int cmd_wl_add(const struct shell *sh, size_t argc, char *argv[])
29122912
return 0;
29132913
}
29142914

2915-
static int cmd_wl_rem(const struct shell *sh, size_t argc, char *argv[])
2915+
static int cmd_fal_rem(const struct shell *sh, size_t argc, char *argv[])
29162916
{
29172917
bt_addr_le_t addr;
29182918
int err;
@@ -2932,7 +2932,7 @@ static int cmd_wl_rem(const struct shell *sh, size_t argc, char *argv[])
29322932
return 0;
29332933
}
29342934

2935-
static int cmd_wl_clear(const struct shell *sh, size_t argc, char *argv[])
2935+
static int cmd_fal_clear(const struct shell *sh, size_t argc, char *argv[])
29362936
{
29372937
int err;
29382938

@@ -2946,7 +2946,7 @@ static int cmd_wl_clear(const struct shell *sh, size_t argc, char *argv[])
29462946
}
29472947

29482948
#if defined(CONFIG_BT_CENTRAL)
2949-
static int cmd_wl_connect(const struct shell *sh, size_t argc, char *argv[])
2949+
static int cmd_fal_connect(const struct shell *sh, size_t argc, char *argv[])
29502950
{
29512951
int err;
29522952
const char *action = argv[1];
@@ -3079,7 +3079,7 @@ static int cmd_auth_oob_tk(const struct shell *sh, size_t argc, char *argv[])
30793079
#define EXT_ADV_SCAN_OPT " [coded] [no-1m]"
30803080
#define EXT_ADV_PARAM "<type: conn-scan conn-nscan, nconn-scan nconn-nscan> " \
30813081
"[ext-adv] [no-2m] [coded] " \
3082-
"[whitelist: wl, wl-scan, wl-conn] [identity] [name] " \
3082+
"[filter-accept-list: fal, fal-scan, fal-conn] [identity] [name] " \
30833083
"[name-ad] [directed "HELP_ADDR_LE"] [mode: low]" \
30843084
"[disable-37] [disable-38] [disable-39]"
30853085
#else
@@ -3103,14 +3103,14 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
31033103
SHELL_CMD_ARG(name, NULL, "[name]", cmd_name, 1, 1),
31043104
#if defined(CONFIG_BT_OBSERVER)
31053105
SHELL_CMD_ARG(scan, NULL,
3106-
"<value: on, passive, off> [filter: dups, nodups] [wl]"
3106+
"<value: on, passive, off> [filter: dups, nodups] [fal]"
31073107
EXT_ADV_SCAN_OPT,
31083108
cmd_scan, 2, 4),
31093109
#endif /* CONFIG_BT_OBSERVER */
31103110
#if defined(CONFIG_BT_BROADCASTER)
31113111
SHELL_CMD_ARG(advertise, NULL,
31123112
"<type: off, on, scan, nconn> [mode: discov, non_discov] "
3113-
"[whitelist: wl, wl-scan, wl-conn] [identity] [no-name] "
3113+
"[filter-accept-list: fal, fal-scan, fal-conn] [identity] [no-name] "
31143114
"[one-time] [name-ad]"
31153115
"[disable-37] [disable-38] [disable-39]",
31163116
cmd_advertise, 2, 8),
@@ -3214,13 +3214,13 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
32143214
cmd_oob_remote, 3, 2),
32153215
SHELL_CMD_ARG(oob-clear, NULL, HELP_NONE, cmd_oob_clear, 1, 0),
32163216
#if defined(CONFIG_BT_FILTER_ACCEPT_LIST)
3217-
SHELL_CMD_ARG(wl-add, NULL, HELP_ADDR_LE, cmd_wl_add, 3, 0),
3218-
SHELL_CMD_ARG(wl-rem, NULL, HELP_ADDR_LE, cmd_wl_rem, 3, 0),
3219-
SHELL_CMD_ARG(wl-clear, NULL, HELP_NONE, cmd_wl_clear, 1, 0),
3217+
SHELL_CMD_ARG(fal-add, NULL, HELP_ADDR_LE, cmd_fal_add, 3, 0),
3218+
SHELL_CMD_ARG(fal-rem, NULL, HELP_ADDR_LE, cmd_fal_rem, 3, 0),
3219+
SHELL_CMD_ARG(fal-clear, NULL, HELP_NONE, cmd_fal_clear, 1, 0),
32203220

32213221
#if defined(CONFIG_BT_CENTRAL)
3222-
SHELL_CMD_ARG(wl-connect, NULL, "<on, off>" EXT_ADV_SCAN_OPT,
3223-
cmd_wl_connect, 2, 3),
3222+
SHELL_CMD_ARG(fal-connect, NULL, "<on, off>" EXT_ADV_SCAN_OPT,
3223+
cmd_fal_connect, 2, 3),
32243224
#endif /* CONFIG_BT_CENTRAL */
32253225
#endif /* defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
32263226
#if defined(CONFIG_BT_FIXED_PASSKEY)

subsys/bluetooth/shell/l2cap.c

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@
3535
#define DATA_MTU (23 * CREDITS)
3636

3737
#define L2CAP_POLICY_NONE 0x00
38-
#define L2CAP_POLICY_WHITELIST 0x01
38+
#define L2CAP_POLICY_ALLOWLIST 0x01
3939
#define L2CAP_POLICY_16BYTE_KEY 0x02
4040

4141
NET_BUF_POOL_FIXED_DEFINE(data_tx_pool, 1,
4242
BT_L2CAP_SDU_BUF_SIZE(DATA_MTU), NULL);
4343
NET_BUF_POOL_FIXED_DEFINE(data_rx_pool, 1, DATA_MTU, NULL);
4444

4545
static uint8_t l2cap_policy;
46-
static struct bt_conn *l2cap_whitelist[CONFIG_BT_MAX_CONN];
46+
static struct bt_conn *l2cap_allowlist[CONFIG_BT_MAX_CONN];
4747

4848
static uint32_t l2cap_rate;
4949
static uint32_t l2cap_recv_delay_ms;
@@ -172,20 +172,20 @@ static struct l2ch l2ch_chan = {
172172
.ch.rx.mtu = DATA_MTU,
173173
};
174174

175-
static void l2cap_whitelist_remove(struct bt_conn *conn, uint8_t reason)
175+
static void l2cap_allowlist_remove(struct bt_conn *conn, uint8_t reason)
176176
{
177177
int i;
178178

179-
for (i = 0; i < ARRAY_SIZE(l2cap_whitelist); i++) {
180-
if (l2cap_whitelist[i] == conn) {
181-
bt_conn_unref(l2cap_whitelist[i]);
182-
l2cap_whitelist[i] = NULL;
179+
for (i = 0; i < ARRAY_SIZE(l2cap_allowlist); i++) {
180+
if (l2cap_allowlist[i] == conn) {
181+
bt_conn_unref(l2cap_allowlist[i]);
182+
l2cap_allowlist[i] = NULL;
183183
}
184184
}
185185
}
186186

187187
BT_CONN_CB_DEFINE(l2cap_conn_callbacks) = {
188-
.disconnected = l2cap_whitelist_remove,
188+
.disconnected = l2cap_allowlist_remove,
189189
};
190190

191191
static int l2cap_accept_policy(struct bt_conn *conn)
@@ -198,9 +198,9 @@ static int l2cap_accept_policy(struct bt_conn *conn)
198198
if (enc_key_size && enc_key_size < BT_ENC_KEY_SIZE_MAX) {
199199
return -EPERM;
200200
}
201-
} else if (l2cap_policy == L2CAP_POLICY_WHITELIST) {
202-
for (i = 0; i < ARRAY_SIZE(l2cap_whitelist); i++) {
203-
if (l2cap_whitelist[i] == conn) {
201+
} else if (l2cap_policy == L2CAP_POLICY_ALLOWLIST) {
202+
for (i = 0; i < ARRAY_SIZE(l2cap_allowlist); i++) {
203+
if (l2cap_allowlist[i] == conn) {
204204
return 0;
205205
}
206206
}
@@ -254,8 +254,8 @@ static int cmd_register(const struct shell *sh, size_t argc, char *argv[])
254254
if (argc > 3) {
255255
policy = argv[3];
256256

257-
if (!strcmp(policy, "whitelist")) {
258-
l2cap_policy = L2CAP_POLICY_WHITELIST;
257+
if (!strcmp(policy, "allowlist")) {
258+
l2cap_policy = L2CAP_POLICY_ALLOWLIST;
259259
} else if (!strcmp(policy, "16byte_key")) {
260260
l2cap_policy = L2CAP_POLICY_16BYTE_KEY;
261261
} else {
@@ -397,7 +397,7 @@ static int cmd_metrics(const struct shell *sh, size_t argc, char *argv[])
397397
return 0;
398398
}
399399

400-
static int cmd_whitelist_add(const struct shell *sh, size_t argc, char *argv[])
400+
static int cmd_allowlist_add(const struct shell *sh, size_t argc, char *argv[])
401401
{
402402
int i;
403403

@@ -406,33 +406,33 @@ static int cmd_whitelist_add(const struct shell *sh, size_t argc, char *argv[])
406406
return 0;
407407
}
408408

409-
for (i = 0; i < ARRAY_SIZE(l2cap_whitelist); i++) {
410-
if (l2cap_whitelist[i] == NULL) {
411-
l2cap_whitelist[i] = bt_conn_ref(default_conn);
409+
for (i = 0; i < ARRAY_SIZE(l2cap_allowlist); i++) {
410+
if (l2cap_allowlist[i] == NULL) {
411+
l2cap_allowlist[i] = bt_conn_ref(default_conn);
412412
return 0;
413413
}
414414
}
415415

416416
return -ENOMEM;
417417
}
418418

419-
static int cmd_whitelist_remove(const struct shell *sh, size_t argc, char *argv[])
419+
static int cmd_allowlist_remove(const struct shell *sh, size_t argc, char *argv[])
420420
{
421421
if (!default_conn) {
422422
shell_error(sh, "Not connected");
423423
return 0;
424424
}
425425

426-
l2cap_whitelist_remove(default_conn, 0);
426+
l2cap_allowlist_remove(default_conn, 0);
427427

428428
return 0;
429429
}
430430

431431
#define HELP_NONE "[none]"
432432

433-
SHELL_STATIC_SUBCMD_SET_CREATE(whitelist_cmds,
434-
SHELL_CMD_ARG(add, NULL, HELP_NONE, cmd_whitelist_add, 1, 0),
435-
SHELL_CMD_ARG(remove, NULL, HELP_NONE, cmd_whitelist_remove, 1, 0),
433+
SHELL_STATIC_SUBCMD_SET_CREATE(allowlist_cmds,
434+
SHELL_CMD_ARG(add, NULL, HELP_NONE, cmd_allowlist_add, 1, 0),
435+
SHELL_CMD_ARG(remove, NULL, HELP_NONE, cmd_allowlist_remove, 1, 0),
436436
SHELL_SUBCMD_SET_END
437437
);
438438

@@ -442,10 +442,10 @@ SHELL_STATIC_SUBCMD_SET_CREATE(l2cap_cmds,
442442
SHELL_CMD_ARG(metrics, NULL, "<value on, off>", cmd_metrics, 2, 0),
443443
SHELL_CMD_ARG(recv, NULL, "[delay (in miliseconds)", cmd_recv, 1, 1),
444444
SHELL_CMD_ARG(register, NULL, "<psm> [sec_level] "
445-
"[policy: whitelist, 16byte_key]", cmd_register, 2, 2),
445+
"[policy: allowlist, 16byte_key]", cmd_register, 2, 2),
446446
SHELL_CMD_ARG(send, NULL, "[number of packets] [length of packet(s)]",
447447
cmd_send, 1, 2),
448-
SHELL_CMD_ARG(whitelist, &whitelist_cmds, HELP_NONE, NULL, 1, 0),
448+
SHELL_CMD_ARG(allowlist, &allowlist_cmds, HELP_NONE, NULL, 1, 0),
449449
SHELL_SUBCMD_SET_END
450450
);
451451

0 commit comments

Comments
 (0)