aboutsummaryrefslogtreecommitdiff
path: root/confui
diff options
context:
space:
mode:
Diffstat (limited to 'confui')
-rw-r--r--confui/makefile3
-rw-r--r--confui/serial.cpp24
2 files changed, 23 insertions, 4 deletions
diff --git a/confui/makefile b/confui/makefile
index e1faed6..2e22e20 100644
--- a/confui/makefile
+++ b/confui/makefile
@@ -18,3 +18,6 @@ FMT_FILES := $(filter-out %.pro,$(FMT_FILES)) # filter *.pro
format:
clang-format -i $(FMT_FILES)
clang-tidy --fix-errors $(FMT_FILES)
+
+compile_commands:
+ compiledb make -Bn
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) {