diff options
Diffstat (limited to 'confui/serial.cpp')
-rw-r--r-- | confui/serial.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/confui/serial.cpp b/confui/serial.cpp index 1518abd..c0e686b 100644 --- a/confui/serial.cpp +++ b/confui/serial.cpp @@ -92,10 +92,26 @@ void cd_cmd_ping(cd_s_bin* data) { std::cout << "ping request with id " << cast->id << " received!" << std::endl; - cd_s_bin* response = cd_cmd_res_status((cd_e_scmds) cast->opcode, cast->id, false); - cd_pclient_send(response); - free(response); - response = nullptr; + // cd_s_bin* response = cd_cmd_res_status((cd_e_scmds) cast->opcode, cast->id, false); + // cd_pclient_send(response); + // free(response); + // response = nullptr; + + cd_uuid_t light_addrs[] = { + { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xde, 0xad, 0xbe, 0xef, 0x00, 0x00, 0x00, 0x00 }, + }; + cd_s_cmd_node* test = cd_cmd_node_alloc("gert", { + .uuid = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xde, 0xad, 0xbe, 0xef, 0x00, 0x00, 0x00, 0x00 }, + .address = { 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, }, + .light_on = false, + .provisioned = false, + .button_pub = 0xdeadbeef, + }, 1, light_addrs); + cd_s_bin* testres = cd_cmd_res(CD_CMD_GET_NODE, 0xf88f, cd_cmd_node_sizeof(test), (uint8_t*) test); + free(test); + + cd_pclient_send(testres); + free(testres); } void cd_cmd_response(cd_s_bin* data) { |