aboutsummaryrefslogtreecommitdiff
path: root/confui
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-12-13 18:09:23 +0100
committerlonkaars <loek@pipeframe.xyz>2022-12-13 18:09:23 +0100
commit2c2ff814653f37947f8c253b29f8b08520ae71b7 (patch)
tree6b265b0e7731c9a7ac4d46b68900def8f44ac911 /confui
parent9c6c30156aae3bf20a3f1b1d3b0766bb3c924412 (diff)
[WIP] node with pub/sub address and uuid
Diffstat (limited to 'confui')
-rw-r--r--confui/serial.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/confui/serial.cpp b/confui/serial.cpp
index 1518abd..09bd7db 100644
--- a/confui/serial.cpp
+++ b/confui/serial.cpp
@@ -92,10 +92,25 @@ 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({
+ .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,
+ }, "gert", 1, light_addrs);
+ cd_s_bin* testres = cd_cmd_res(CD_CMD_GET_NODE, 0xf88f, test->size, (uint8_t*) test);
+ cd_pclient_send(testres);
+ free(testres);
+ free(test);
}
void cd_cmd_response(cd_s_bin* data) {