File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -863,6 +863,8 @@ int bt_br_init(void)
863863 return err ;
864864 }
865865
866+ strncpy (bt_dev .name , CONFIG_BT_DEVICE_NAME , CONFIG_BT_DEVICE_NAME_MAX );
867+
866868 /* Set Class of device */
867869 buf = bt_hci_cmd_alloc (K_FOREVER );
868870 if (!buf ) {
Original file line number Diff line number Diff line change @@ -4752,6 +4752,10 @@ int bt_set_name(const char *name)
47524752 return - ENOMEM ;
47534753 }
47544754
4755+ if (len == 0 ) {
4756+ return - EINVAL ;
4757+ }
4758+
47554759 if (!strcmp (bt_dev .name , name )) {
47564760 return 0 ;
47574761 }
@@ -4766,6 +4770,14 @@ int bt_set_name(const char *name)
47664770 }
47674771 }
47684772
4773+ #if defined(CONFIG_BT_CLASSIC )
4774+ err = bt_br_write_local_name (bt_dev .name );
4775+ if (err ) {
4776+ LOG_WRN ("Unable to set local name" );
4777+ return err ;
4778+ }
4779+ #endif
4780+
47694781 return 0 ;
47704782#else
47714783 return - ENOMEM ;
You can’t perform that action at this time.
0 commit comments