diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-01-06 13:55:18 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-01-06 13:55:18 +0100 |
commit | 75eecca201016aae2dde136f222c2694822f2d12 (patch) | |
tree | 7ab3dce0a185af830f9ecc1c1efde88d1f50c10a | |
parent | a2fe55b5c31e08ca4df165172269e7eb58d75bf6 (diff) |
gui node name to non-const pointer
-rw-r--r-- | confui/mesh_connector.h | 2 | ||||
-rw-r--r-- | 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; |