@@ -3902,6 +3902,35 @@ static int cmd_bondable(const struct shell *sh, size_t argc, char *argv[])
3902
3902
return 0 ;
3903
3903
}
3904
3904
3905
+ #if defined(CONFIG_BT_BONDABLE_PER_CONNECTION )
3906
+ static int cmd_conn_bondable (const struct shell * sh , size_t argc , char * argv [])
3907
+ {
3908
+ int err = 0 ;
3909
+ bool enable ;
3910
+
3911
+ if (!default_conn ) {
3912
+ shell_error (sh , "Not connected" );
3913
+ return - ENOEXEC ;
3914
+ }
3915
+
3916
+ enable = shell_strtobool (argv [1 ], 0 , & err );
3917
+ if (err ) {
3918
+ shell_help (sh );
3919
+ return SHELL_CMD_HELP_PRINTED ;
3920
+ }
3921
+
3922
+ shell_print (sh , "[%p] set conn bondable %s" , default_conn , argv [1 ]);
3923
+
3924
+ err = bt_conn_set_bondable (default_conn , enable );
3925
+ if (err ) {
3926
+ shell_error (sh , "Set conn bondable failed: err %d" , err );
3927
+ return - ENOEXEC ;
3928
+ }
3929
+ shell_print (sh , "Set conn bondable done" );
3930
+ return 0 ;
3931
+ }
3932
+ #endif /* CONFIG_BT_BONDABLE_PER_CONNECTION */
3933
+
3905
3934
static void bond_info (const struct bt_bond_info * info , void * user_data )
3906
3935
{
3907
3936
char addr [BT_ADDR_LE_STR_LEN ];
@@ -5079,6 +5108,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(bt_cmds,
5079
5108
cmd_security , 1 , 2 ),
5080
5109
SHELL_CMD_ARG (bondable , NULL , HELP_ONOFF , cmd_bondable ,
5081
5110
2 , 0 ),
5111
+ #if defined(CONFIG_BT_BONDABLE_PER_CONNECTION )
5112
+ SHELL_CMD_ARG (conn - bondable , NULL , HELP_ONOFF , cmd_conn_bondable , 2 , 0 ),
5113
+ #endif /* CONFIG_BT_BONDABLE_PER_CONNECTION */
5082
5114
SHELL_CMD_ARG (bonds , NULL , HELP_NONE , cmd_bonds , 1 , 0 ),
5083
5115
SHELL_CMD_ARG (connections , NULL , HELP_NONE , cmd_connections , 1 , 0 ),
5084
5116
SHELL_CMD_ARG (auth , NULL ,
0 commit comments