Skip to content

Commit 1a2ea57

Browse files
Thalleykartben
authored andcommitted
Bluetooth: Classic: Shell: Remove last use of ctx_shell
The Bluetooth Classic sdp_client was the last user of the ctx_shell, which could easily be removed. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 5fa78d0 commit 1a2ea57

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

tests/bluetooth/classic/sdp_c/src/sdp_client.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
#include <zephyr/shell/shell.h>
2222

23-
static const struct shell *ctx_shell;
24-
2523
extern struct bt_conn *default_conn;
2624

2725
static struct bt_sdp_discover_params sdp_discover;
@@ -173,8 +171,6 @@ static int cmd_ssa_discovery(const struct shell *sh, size_t argc, char *argv[])
173171
int err;
174172
size_t len;
175173

176-
ctx_shell = sh;
177-
178174
len = strlen(argv[1]);
179175

180176
if (len == (BT_UUID_SIZE_16 * 2)) {
@@ -207,7 +203,7 @@ static int cmd_ssa_discovery(const struct shell *sh, size_t argc, char *argv[])
207203

208204
err = bt_sdp_discover(default_conn, &sdp_discover);
209205
if (err) {
210-
shell_error(ctx_shell, "Fail to start SDP Discovery (err %d)", err);
206+
shell_error(sh, "Fail to start SDP Discovery (err %d)", err);
211207
return err;
212208
}
213209
return 0;
@@ -218,8 +214,6 @@ static int cmd_ss_discovery(const struct shell *sh, size_t argc, char *argv[])
218214
int err;
219215
size_t len;
220216

221-
ctx_shell = sh;
222-
223217
len = strlen(argv[1]);
224218

225219
if (len == (BT_UUID_SIZE_16 * 2)) {
@@ -252,7 +246,7 @@ static int cmd_ss_discovery(const struct shell *sh, size_t argc, char *argv[])
252246

253247
err = bt_sdp_discover(default_conn, &sdp_discover);
254248
if (err) {
255-
shell_error(ctx_shell, "Fail to start SDP Discovery (err %d)", err);
249+
shell_error(sh, "Fail to start SDP Discovery (err %d)", err);
256250
return err;
257251
}
258252
return 0;
@@ -264,8 +258,6 @@ static int cmd_sa_discovery(const struct shell *sh, size_t argc, char *argv[])
264258
size_t len;
265259
uint32_t handle;
266260

267-
ctx_shell = sh;
268-
269261
len = strlen(argv[1]);
270262

271263
if (len == (sizeof(handle) * 2)) {
@@ -282,7 +274,7 @@ static int cmd_sa_discovery(const struct shell *sh, size_t argc, char *argv[])
282274

283275
err = bt_sdp_discover(default_conn, &sdp_discover);
284276
if (err) {
285-
shell_error(ctx_shell, "Fail to start SDP Discovery (err %d)", err);
277+
shell_error(sh, "Fail to start SDP Discovery (err %d)", err);
286278
return err;
287279
}
288280
return 0;

0 commit comments

Comments
 (0)