@@ -869,20 +869,50 @@ static struct bt_gatt_service vnd1_svc = BT_GATT_SERVICE(vnd1_attrs);
869
869
static int cmd_register_test_svc (const struct shell * sh ,
870
870
size_t argc , char * argv [])
871
871
{
872
- bt_gatt_service_register (& vnd_svc );
873
- bt_gatt_service_register (& vnd1_svc );
872
+ char str [BT_UUID_STR_LEN ];
873
+ int err ;
874
+
875
+ bt_uuid_to_str (& vnd_uuid .uuid , str , sizeof (str ));
876
+ err = bt_gatt_service_register (& vnd_svc );
877
+ if (!err ) {
878
+ shell_print (sh , "Registered test vendor service %s" , str );
879
+ } else {
880
+ shell_error (sh , "Failed to register test vendor service %s (%d)" , str , err );
881
+ }
882
+
883
+ bt_uuid_to_str (& vnd1_uuid .uuid , str , sizeof (str ));
884
+ err = bt_gatt_service_register (& vnd1_svc );
885
+ if (!err ) {
886
+ shell_print (sh , "Registered test vendor service %s" , str );
887
+ } else {
888
+ shell_error (sh , "Failed to register test vendor service %s (%d)" , str , err );
889
+ }
874
890
875
- shell_print (sh , "Registering test vendor services" );
876
891
return 0 ;
877
892
}
878
893
879
894
static int cmd_unregister_test_svc (const struct shell * sh ,
880
895
size_t argc , char * argv [])
881
896
{
882
- bt_gatt_service_unregister (& vnd_svc );
883
- bt_gatt_service_unregister (& vnd1_svc );
897
+ char str [BT_UUID_STR_LEN ];
898
+ int err ;
899
+
900
+ bt_uuid_to_str (& vnd_uuid .uuid , str , sizeof (str ));
901
+ err = bt_gatt_service_unregister (& vnd_svc );
902
+ if (!err ) {
903
+ shell_print (sh , "Unregistered test vendor service %s" , str );
904
+ } else {
905
+ shell_error (sh , "Failed to unregister test vendor service %s (%d)" , str , err );
906
+ }
907
+
908
+ bt_uuid_to_str (& vnd1_uuid .uuid , str , sizeof (str ));
909
+ err = bt_gatt_service_unregister (& vnd1_svc );
910
+ if (!err ) {
911
+ shell_print (sh , "Unregistered test vendor service %s" , str );
912
+ } else {
913
+ shell_error (sh , "Failed to unregister test vendor service %s (%d)" , str , err );
914
+ }
884
915
885
- shell_print (sh , "Unregistering test vendor services" );
886
916
return 0 ;
887
917
}
888
918
0 commit comments