From 75eecca201016aae2dde136f222c2694822f2d12 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Fri, 6 Jan 2023 13:55:18 +0100 Subject: gui node name to non-const pointer --- confui/mesh_connector.h | 2 +- confui/serial.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/confui/mesh_connector.h b/confui/mesh_connector.h index 1c9f938..ccab6bd 100644 --- a/confui/mesh_connector.h +++ b/confui/mesh_connector.h @@ -31,7 +31,7 @@ typedef struct { cd_mac_addr_t address; /** @brief node bluetooth mac address */ cd_uuid_t uuid; /** @brief node uuid */ size_t name_len; /** @brief name length in bytes */ - const char *name; /** @brief user-friendly node name */ + char *name; /** @brief user-friendly node name */ bool light_on; /** @brief state of light on node */ bool provisioned; /** @brief whether the node is provisioned into the network */ } cd_s_node; diff --git a/confui/serial.cpp b/confui/serial.cpp index bfb809e..c7a52e5 100644 --- a/confui/serial.cpp +++ b/confui/serial.cpp @@ -131,7 +131,7 @@ void cd_cmd_response_get_node_parse_node(cd_s_cmd_node* node) { memcpy(gui_node->address, node->address, sizeof(cd_mac_addr_t)); memcpy(gui_node->uuid, node->uuid, sizeof(cd_uuid_t)); gui_node->name_len = node->name_len; - if (gui_node->name != nullptr) free((char*) gui_node->name); // TODO: set name to non-const pointer + if (gui_node->name != nullptr) free(gui_node->name); char* name = (char*) malloc(node->name_len); memcpy(name, node->remaining_data, node->name_len); gui_node->name = name; -- cgit v1.2.3