Skip to content

Commit b3d5634

Browse files
MarkWangChinesejhedberg
authored andcommitted
bluetooth: shell: a2dp: use static for functions
add static for functions and variables. Signed-off-by: Mark Wang <[email protected]> (cherry picked from commit 1282bf7)
1 parent a1cbaf7 commit b3d5634

File tree

1 file changed

+32
-31
lines changed
  • subsys/bluetooth/host/classic/shell

1 file changed

+32
-31
lines changed

subsys/bluetooth/host/classic/shell/a2dp.c

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ static void shell_a2dp_print_capabilities(struct bt_a2dp_ep_info *ep_info)
287287
}
288288
}
289289

290-
void app_connected(struct bt_a2dp *a2dp, int err)
290+
static void app_connected(struct bt_a2dp *a2dp, int err)
291291
{
292292
if (!err) {
293293
default_a2dp = a2dp;
@@ -297,13 +297,13 @@ void app_connected(struct bt_a2dp *a2dp, int err)
297297
}
298298
}
299299

300-
void app_disconnected(struct bt_a2dp *a2dp)
300+
static void app_disconnected(struct bt_a2dp *a2dp)
301301
{
302302
found_peer_sbc_endpoint = NULL;
303303
bt_shell_print("a2dp disconnected");
304304
}
305305

306-
int app_config_req(struct bt_a2dp *a2dp, struct bt_a2dp_ep *ep,
306+
static int app_config_req(struct bt_a2dp *a2dp, struct bt_a2dp_ep *ep,
307307
struct bt_a2dp_codec_cfg *codec_cfg, struct bt_a2dp_stream **stream,
308308
uint8_t *rsp_err_code)
309309
{
@@ -321,8 +321,8 @@ int app_config_req(struct bt_a2dp *a2dp, struct bt_a2dp_ep *ep,
321321
return 0;
322322
}
323323

324-
int app_reconfig_req(struct bt_a2dp_stream *stream,
325-
struct bt_a2dp_codec_cfg *codec_cfg, uint8_t *rsp_err_code)
324+
static int app_reconfig_req(struct bt_a2dp_stream *stream, struct bt_a2dp_codec_cfg *codec_cfg,
325+
uint8_t *rsp_err_code)
326326
{
327327
uint32_t sample_rate;
328328

@@ -335,7 +335,7 @@ int app_reconfig_req(struct bt_a2dp_stream *stream,
335335
return 0;
336336
}
337337

338-
void app_config_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
338+
static void app_config_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
339339
{
340340
if (rsp_err_code == 0) {
341341
bt_shell_print("success to configure");
@@ -344,14 +344,14 @@ void app_config_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
344344
}
345345
}
346346

347-
int app_establish_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
347+
static int app_establish_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
348348
{
349349
*rsp_err_code = 0;
350350
bt_shell_print("receive requesting establishment and accept");
351351
return 0;
352352
}
353353

354-
void app_establish_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
354+
static void app_establish_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
355355
{
356356
if (rsp_err_code == 0) {
357357
bt_shell_print("success to establish");
@@ -360,14 +360,14 @@ void app_establish_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
360360
}
361361
}
362362

363-
int app_release_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
363+
static int app_release_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
364364
{
365365
*rsp_err_code = 0;
366366
bt_shell_print("receive requesting release and accept");
367367
return 0;
368368
}
369369

370-
void app_release_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
370+
static void app_release_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
371371
{
372372
if (rsp_err_code == 0) {
373373
bt_shell_print("success to release");
@@ -376,14 +376,14 @@ void app_release_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
376376
}
377377
}
378378

379-
int app_start_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
379+
static int app_start_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
380380
{
381381
*rsp_err_code = 0;
382382
bt_shell_print("receive requesting start and accept");
383383
return 0;
384384
}
385385

386-
void app_start_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
386+
static void app_start_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
387387
{
388388
if (rsp_err_code == 0) {
389389
bt_shell_print("success to start");
@@ -392,14 +392,14 @@ void app_start_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
392392
}
393393
}
394394

395-
int app_suspend_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
395+
static int app_suspend_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
396396
{
397397
*rsp_err_code = 0;
398398
bt_shell_print("receive requesting suspend and accept");
399399
return 0;
400400
}
401401

402-
void app_suspend_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
402+
static void app_suspend_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
403403
{
404404
if (rsp_err_code == 0) {
405405
bt_shell_print("success to suspend");
@@ -408,33 +408,33 @@ void app_suspend_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
408408
}
409409
}
410410

411-
void stream_configured(struct bt_a2dp_stream *stream)
411+
static void stream_configured(struct bt_a2dp_stream *stream)
412412
{
413413
bt_shell_print("stream configured");
414414
}
415415

416-
void stream_established(struct bt_a2dp_stream *stream)
416+
static void stream_established(struct bt_a2dp_stream *stream)
417417
{
418418
bt_shell_print("stream established");
419419
}
420420

421-
void stream_released(struct bt_a2dp_stream *stream)
421+
static void stream_released(struct bt_a2dp_stream *stream)
422422
{
423423
bt_shell_print("stream released");
424424
}
425425

426-
void stream_started(struct bt_a2dp_stream *stream)
426+
static void stream_started(struct bt_a2dp_stream *stream)
427427
{
428428
bt_shell_print("stream started");
429429
}
430430

431-
void stream_suspended(struct bt_a2dp_stream *stream)
431+
static void stream_suspended(struct bt_a2dp_stream *stream)
432432
{
433433
bt_shell_print("stream suspended");
434434
}
435435

436-
void sink_sbc_streamer_data(struct bt_a2dp_stream *stream, struct net_buf *buf,
437-
uint16_t seq_num, uint32_t ts)
436+
static void sink_sbc_streamer_data(struct bt_a2dp_stream *stream, struct net_buf *buf,
437+
uint16_t seq_num, uint32_t ts)
438438
{
439439
uint8_t sbc_hdr;
440440

@@ -448,20 +448,21 @@ void sink_sbc_streamer_data(struct bt_a2dp_stream *stream, struct net_buf *buf,
448448
buf->data[1], buf->data[2], buf->data[3], buf->data[4], buf->data[5]);
449449
}
450450

451-
void stream_recv(struct bt_a2dp_stream *stream,
452-
struct net_buf *buf, uint16_t seq_num, uint32_t ts)
451+
static void stream_recv(struct bt_a2dp_stream *stream,
452+
struct net_buf *buf, uint16_t seq_num, uint32_t ts)
453453
{
454454
sink_sbc_streamer_data(stream, buf, seq_num, ts);
455455
}
456456

457-
int app_delay_report_req(struct bt_a2dp_stream *stream, uint16_t value, uint8_t *rsp_err_code)
457+
static int app_delay_report_req(struct bt_a2dp_stream *stream, uint16_t value,
458+
uint8_t *rsp_err_code)
458459
{
459460
*rsp_err_code = 0;
460461
bt_shell_print("receive delay report and accept");
461462
return 0;
462463
}
463464

464-
void app_delay_report_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
465+
static void app_delay_report_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
465466
{
466467
if (rsp_err_code == 0) {
467468
bt_shell_print("success to send report delay");
@@ -470,15 +471,15 @@ void app_delay_report_rsp(struct bt_a2dp_stream *stream, uint8_t rsp_err_code)
470471
}
471472
}
472473

473-
int app_get_config_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
474+
static int app_get_config_req(struct bt_a2dp_stream *stream, uint8_t *rsp_err_code)
474475
{
475476
*rsp_err_code = 0;
476477
bt_shell_print("receive get config request and accept");
477478
return 0;
478479
}
479480

480-
void app_get_config_rsp(struct bt_a2dp_stream *stream, struct bt_a2dp_codec_cfg *codec_cfg,
481-
uint8_t rsp_err_code)
481+
static void app_get_config_rsp(struct bt_a2dp_stream *stream, struct bt_a2dp_codec_cfg *codec_cfg,
482+
uint8_t rsp_err_code)
482483
{
483484
bt_shell_print("get config result: %d", rsp_err_code);
484485

@@ -489,7 +490,7 @@ void app_get_config_rsp(struct bt_a2dp_stream *stream, struct bt_a2dp_codec_cfg
489490
}
490491
}
491492

492-
struct bt_a2dp_cb a2dp_cb = {
493+
static struct bt_a2dp_cb a2dp_cb = {
493494
.connected = app_connected,
494495
.disconnected = app_disconnected,
495496
.config_req = app_config_req,
@@ -620,7 +621,7 @@ static int cmd_disconnect(const struct shell *sh, int32_t argc, char *argv[])
620621
return 0;
621622
}
622623

623-
void delay_report(struct bt_a2dp_stream *stream, uint16_t value)
624+
static void delay_report(struct bt_a2dp_stream *stream, uint16_t value)
624625
{
625626
bt_shell_print("received delay report: %d 1/10ms", value);
626627
}
@@ -705,7 +706,7 @@ static uint8_t bt_a2dp_discover_peer_endpoint_cb(struct bt_a2dp *a2dp,
705706

706707
static struct bt_avdtp_sep_info found_seps[5];
707708

708-
struct bt_a2dp_discover_param discover_param = {
709+
static struct bt_a2dp_discover_param discover_param = {
709710
.cb = bt_a2dp_discover_peer_endpoint_cb,
710711
.seps_info = &found_seps[0],
711712
.sep_count = 5,

0 commit comments

Comments
 (0)