@@ -1580,7 +1580,7 @@ static int cmd_id_show(const struct shell *sh, size_t argc, char *argv[])
1580
1580
1581
1581
bt_addr_le_to_str (& addrs [i ], addr_str , sizeof (addr_str ));
1582
1582
shell_print (sh , "%s%zu: %s" , i == selected_id ? "*" : " " , i ,
1583
- addr_str );
1583
+ addr_str );
1584
1584
}
1585
1585
1586
1586
return 0 ;
@@ -1625,7 +1625,7 @@ static int cmd_active_scan_on(const struct shell *sh, uint32_t options,
1625
1625
err = bt_le_scan_start (& param , NULL );
1626
1626
if (err ) {
1627
1627
shell_error (sh , "Bluetooth set active scan failed "
1628
- "(err %d)" , err );
1628
+ "(err %d)" , err );
1629
1629
return err ;
1630
1630
} else {
1631
1631
shell_print (sh , "Bluetooth active scan enabled" );
@@ -1753,7 +1753,7 @@ static int cmd_scan_filter_set_name(const struct shell *sh, size_t argc,
1753
1753
const char * name_arg = argv [1 ];
1754
1754
1755
1755
if (strlen (name_arg ) >= sizeof (scan_filter .name )) {
1756
- shell_error (ctx_shell , "Name is too long (max %zu): %s\n" ,
1756
+ shell_error (sh , "Name is too long (max %zu): %s\n" ,
1757
1757
sizeof (scan_filter .name ), name_arg );
1758
1758
return - ENOEXEC ;
1759
1759
}
@@ -1773,8 +1773,7 @@ static int cmd_scan_filter_set_addr(const struct shell *sh, size_t argc,
1773
1773
1774
1774
/* Validate length including null terminator. */
1775
1775
if (len > max_cpy_len ) {
1776
- shell_error (ctx_shell , "Invalid address string: %s\n" ,
1777
- addr_arg );
1776
+ shell_error (sh , "Invalid address string: %s\n" , addr_arg );
1778
1777
return - ENOEXEC ;
1779
1778
}
1780
1779
@@ -1784,9 +1783,7 @@ static int cmd_scan_filter_set_addr(const struct shell *sh, size_t argc,
1784
1783
uint8_t tmp ;
1785
1784
1786
1785
if (c != ':' && char2hex (c , & tmp ) < 0 ) {
1787
- shell_error (ctx_shell ,
1788
- "Invalid address string: %s\n" ,
1789
- addr_arg );
1786
+ shell_error (sh , "Invalid address string: %s\n" , addr_arg );
1790
1787
return - ENOEXEC ;
1791
1788
}
1792
1789
}
@@ -2307,7 +2304,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[])
2307
2304
if (* data_len == ARRAY_SIZE (ad )) {
2308
2305
/* Maximum entries limit reached. */
2309
2306
shell_print (sh , "Failed to set advertising data: "
2310
- "Maximum entries limit reached" );
2307
+ "Maximum entries limit reached" );
2311
2308
2312
2309
return - ENOEXEC ;
2313
2310
}
@@ -2327,7 +2324,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[])
2327
2324
if (strcmp (arg , "scan-response" ) && * data_len == ARRAY_SIZE (ad )) {
2328
2325
/* Maximum entries limit reached. */
2329
2326
shell_print (sh , "Failed to set advertising data: "
2330
- "Maximum entries limit reached" );
2327
+ "Maximum entries limit reached" );
2331
2328
2332
2329
return - ENOEXEC ;
2333
2330
}
@@ -2341,7 +2338,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[])
2341
2338
} else if (!strcmp (arg , "scan-response" )) {
2342
2339
if (data == sd ) {
2343
2340
shell_print (sh , "Failed to set advertising data: "
2344
- "duplicate scan-response option" );
2341
+ "duplicate scan-response option" );
2345
2342
return - ENOEXEC ;
2346
2343
}
2347
2344
@@ -2358,7 +2355,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[])
2358
2355
2359
2356
if (!len || (len - 1 ) != (hex_data [hex_data_len ])) {
2360
2357
shell_print (sh , "Failed to set advertising data: "
2361
- "malformed hex data" );
2358
+ "malformed hex data" );
2362
2359
return - ENOEXEC ;
2363
2360
}
2364
2361
@@ -2379,7 +2376,7 @@ static int cmd_adv_data(const struct shell *sh, size_t argc, char *argv[])
2379
2376
if (* data_len == ARRAY_SIZE (ad )) {
2380
2377
/* Maximum entries limit reached. */
2381
2378
shell_print (sh , "Failed to set advertising data: "
2382
- "Maximum entries limit reached" );
2379
+ "Maximum entries limit reached" );
2383
2380
2384
2381
return - ENOEXEC ;
2385
2382
}
@@ -2499,7 +2496,7 @@ static int cmd_adv_delete(const struct shell *sh, size_t argc, char *argv[])
2499
2496
2500
2497
err = bt_le_ext_adv_delete (adv );
2501
2498
if (err ) {
2502
- shell_error (ctx_shell , "Failed to delete advertiser set" );
2499
+ shell_error (sh , "Failed to delete advertiser set" );
2503
2500
return err ;
2504
2501
}
2505
2502
@@ -3109,7 +3106,7 @@ static int cmd_set_power_report_enable(const struct shell *sh, size_t argc, char
3109
3106
return - ENOEXEC ;
3110
3107
}
3111
3108
err = bt_conn_le_set_tx_power_report_enable (default_conn , local_enable ,
3112
- remote_enable );
3109
+ remote_enable );
3113
3110
if (!err ) {
3114
3111
shell_print (sh , "Tx Power Report: local: %s, remote: %s" ,
3115
3112
enabled2str (local_enable ), enabled2str (remote_enable ));
@@ -3494,11 +3491,11 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[])
3494
3491
3495
3492
err = bt_conn_get_info (conn , & info );
3496
3493
if (err ) {
3497
- shell_print (ctx_shell , "Failed to get info" );
3494
+ shell_print (sh , "Failed to get info" );
3498
3495
goto done ;
3499
3496
}
3500
3497
3501
- shell_print (ctx_shell , "Type: %s, Role: %s, Id: %u" ,
3498
+ shell_print (sh , "Type: %s, Role: %s, Id: %u" ,
3502
3499
get_conn_type_str (info .type ),
3503
3500
get_conn_role_str (info .role ),
3504
3501
info .id );
@@ -3509,28 +3506,28 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[])
3509
3506
print_le_addr ("Remote on-air" , info .le .remote );
3510
3507
print_le_addr ("Local on-air" , info .le .local );
3511
3508
3512
- shell_print (ctx_shell , "Interval: 0x%04x (%u us)" ,
3509
+ shell_print (sh , "Interval: 0x%04x (%u us)" ,
3513
3510
info .le .interval ,
3514
3511
BT_CONN_INTERVAL_TO_US (info .le .interval ));
3515
- shell_print (ctx_shell , "Latency: 0x%04x" ,
3512
+ shell_print (sh , "Latency: 0x%04x" ,
3516
3513
info .le .latency );
3517
- shell_print (ctx_shell , "Supervision timeout: 0x%04x (%d ms)" ,
3514
+ shell_print (sh , "Supervision timeout: 0x%04x (%d ms)" ,
3518
3515
info .le .timeout , info .le .timeout * 10 );
3519
3516
#if defined(CONFIG_BT_USER_PHY_UPDATE )
3520
- shell_print (ctx_shell , "LE PHY: TX PHY %s, RX PHY %s" ,
3517
+ shell_print (sh , "LE PHY: TX PHY %s, RX PHY %s" ,
3521
3518
phy2str (info .le .phy -> tx_phy ),
3522
3519
phy2str (info .le .phy -> rx_phy ));
3523
3520
#endif
3524
3521
#if defined(CONFIG_BT_USER_DATA_LEN_UPDATE )
3525
- shell_print (ctx_shell , "LE data len: TX (len: %d time: %d)"
3522
+ shell_print (sh , "LE data len: TX (len: %d time: %d)"
3526
3523
" RX (len: %d time: %d)" ,
3527
3524
info .le .data_len -> tx_max_len ,
3528
3525
info .le .data_len -> tx_max_time ,
3529
3526
info .le .data_len -> rx_max_len ,
3530
3527
info .le .data_len -> rx_max_time );
3531
3528
#endif
3532
3529
#if defined(CONFIG_BT_SUBRATING )
3533
- shell_print (ctx_shell , "LE Subrating: Subrate Factor: %d"
3530
+ shell_print (sh , "LE Subrating: Subrate Factor: %d"
3534
3531
" Continuation Number: %d" ,
3535
3532
info .le .subrate -> factor ,
3536
3533
info .le .subrate -> continuation_number );
@@ -3542,7 +3539,7 @@ static int cmd_info(const struct shell *sh, size_t argc, char *argv[])
3542
3539
char addr_str [BT_ADDR_STR_LEN ];
3543
3540
3544
3541
bt_addr_to_str (info .br .dst , addr_str , sizeof (addr_str ));
3545
- shell_print (ctx_shell , "Peer address %s" , addr_str );
3542
+ shell_print (sh , "Peer address %s" , addr_str );
3546
3543
}
3547
3544
#endif /* defined(CONFIG_BT_CLASSIC) */
3548
3545
@@ -3559,8 +3556,8 @@ static int cmd_conn_update(const struct shell *sh, size_t argc, char *argv[])
3559
3556
3560
3557
if (default_conn == NULL ) {
3561
3558
shell_error (sh ,
3562
- "%s: at least, one connection is required" ,
3563
- sh -> ctx -> active_cmd .syntax );
3559
+ "%s: at least, one connection is required" ,
3560
+ sh -> ctx -> active_cmd .syntax );
3564
3561
return - ENOEXEC ;
3565
3562
}
3566
3563
@@ -3608,8 +3605,8 @@ static int cmd_conn_data_len_update(const struct shell *sh, size_t argc,
3608
3605
3609
3606
if (default_conn == NULL ) {
3610
3607
shell_error (sh ,
3611
- "%s: at least, one connection is required" ,
3612
- sh -> ctx -> active_cmd .syntax );
3608
+ "%s: at least, one connection is required" ,
3609
+ sh -> ctx -> active_cmd .syntax );
3613
3610
return - ENOEXEC ;
3614
3611
}
3615
3612
@@ -3633,8 +3630,6 @@ static int cmd_conn_data_len_update(const struct shell *sh, size_t argc,
3633
3630
shell_print (sh , "Calculated tx time: %d" , param .tx_max_time );
3634
3631
}
3635
3632
3636
-
3637
-
3638
3633
err = bt_conn_le_data_len_update (default_conn , & param );
3639
3634
if (err ) {
3640
3635
shell_error (sh , "data len update failed (err %d)." , err );
@@ -3655,8 +3650,8 @@ static int cmd_conn_phy_update(const struct shell *sh, size_t argc,
3655
3650
3656
3651
if (default_conn == NULL ) {
3657
3652
shell_error (sh ,
3658
- "%s: at least, one connection is required" ,
3659
- sh -> ctx -> active_cmd .syntax );
3653
+ "%s: at least, one connection is required" ,
3654
+ sh -> ctx -> active_cmd .syntax );
3660
3655
return - ENOEXEC ;
3661
3656
}
3662
3657
@@ -3772,7 +3767,7 @@ static int cmd_clear(const struct shell *sh, size_t argc, char *argv[])
3772
3767
err = bt_unpair (selected_id , NULL );
3773
3768
if (err ) {
3774
3769
shell_error (sh , "Failed to clear pairings (err %d)" ,
3775
- err );
3770
+ err );
3776
3771
return err ;
3777
3772
} else {
3778
3773
shell_print (sh , "Pairings successfully cleared" );
0 commit comments