summaryrefslogtreecommitdiff
path: root/shared/protocol.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-27 12:53:42 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-27 12:53:42 +0200
commit4c4d045329c4a149bae0b53952c39c14243e1870 (patch)
tree18ce1a31adb20421635738d627b46150b1fb9fea /shared/protocol.c
parent05318790dcbd6714a2adb3532e902a56a6638ca0 (diff)
throw error on noisy serial channel
Diffstat (limited to 'shared/protocol.c')
-rw-r--r--shared/protocol.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/shared/protocol.c b/shared/protocol.c
index fcc9fa4..9be1d31 100644
--- a/shared/protocol.c
+++ b/shared/protocol.c
@@ -74,22 +74,3 @@ size_t w2_cmd_expt_tx_sizeof(w2_s_bin *data) {
size_t w2_cmd_mcfg_rx_sizeof(w2_s_bin *data) {
return W2_DYN_MEMBER_SIZEOF(w2_s_cmd_mcfg_rx, 3, w2_s_cmd_mcfg_feature);
}
-
-void w2_cmd_handler(uint8_t data[W2_SERIAL_READ_BUFFER_SIZE], uint8_t data_length) {
- w2_s_bin *copy = w2_bin_s_alloc(data_length, data);
- void (*handler)(w2_s_bin *) = g_w2_cmd_handlers[data[0]];
-
- if (handler == NULL) {
-#ifdef W2_SIM
- // TODO throw warning
- simwarn("unknown serial message with code 0x%02x\n", data[0]);
-#endif
- } else {
-#ifdef W2_SIM
- w2_sim_print_serial(copy);
-#endif
- handler(copy);
- }
-
- free(copy);
-}