diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-01-07 14:42:37 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-01-07 14:42:37 +0100 |
commit | b083c8e08d610a4e74f39f66f3daa191301893b1 (patch) | |
tree | 93546ddfb96aeb60246b1b253fb9569e664715c8 /confui | |
parent | 7c9afe1982c1c3778e65740fa2e161621d380285 (diff) |
implement response handlers for other post commands
Diffstat (limited to 'confui')
-rw-r--r-- | confui/serial.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/confui/serial.cpp b/confui/serial.cpp index 7a9e102..b3f1cd6 100644 --- a/confui/serial.cpp +++ b/confui/serial.cpp @@ -164,6 +164,21 @@ void cd_cmd_response_ping(cd_s_bin* data) { std::cout << "ping response with id " << cast->response_id << " received!" << std::endl; } +void cd_cmd_response_post_led(cd_s_bin* data) { + CD_CAST_BIN(cd_s_cmd_response, data, cast); + if (cast->error) printf("POST_LED response with error for msg id 0x%04x", cast->response_id); +} + +void cd_cmd_response_post_link(cd_s_bin* data) { + CD_CAST_BIN(cd_s_cmd_response, data, cast); + if (cast->error) printf("POST_LINK response with error for msg id 0x%04x", cast->response_id); +} + +void cd_cmd_response_post_net(cd_s_bin* data) { + CD_CAST_BIN(cd_s_cmd_response, data, cast); + if (cast->error) printf("POST_NET response with error for msg id 0x%04x", cast->response_id); +} + void cd_cmd_response(cd_s_bin* data) { CD_CAST_BIN(cd_s_cmd_response, data, cast); @@ -173,9 +188,9 @@ void cd_cmd_response(cd_s_bin* data) { switch (cast->response_type) { case CD_CMD_PING: return cd_cmd_response_ping(data); case CD_CMD_GET_NODE: return cd_cmd_response_get_node(data); - case CD_CMD_POST_LED: return; // TODO - case CD_CMD_POST_LINK: return; // TODO - case CD_CMD_POST_NET: return; // TODO + case CD_CMD_POST_LED: return cd_cmd_response_post_led(data); + case CD_CMD_POST_LINK: return cd_cmd_post_link(data); + case CD_CMD_POST_NET: return cd_cmd_response_post_net(data); default: return; } } |