summaryrefslogtreecommitdiff
path: root/robot/sercomm.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-05-26 14:05:53 +0200
committerlonkaars <loek@pipeframe.xyz>2022-05-26 14:05:53 +0200
commitd70f4f44f927281d6c9bfff64264bd754d682dc8 (patch)
treeff0ed034fba83a8f4d3c00cd0b7e1e6d78d75082 /robot/sercomm.c
parentf7387fd6af14a740f474620555de379bc9ba69db (diff)
implement mode command
Diffstat (limited to 'robot/sercomm.c')
-rw-r--r--robot/sercomm.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/robot/sercomm.c b/robot/sercomm.c
index a3ccdb0..e972f28 100644
--- a/robot/sercomm.c
+++ b/robot/sercomm.c
@@ -4,6 +4,7 @@
#include "../shared/bin.h"
#include "../shared/serial_parse.h"
#include "hypervisor.h"
+#include "modes.h"
#include "orangutan_shim.h"
#include "sercomm.h"
@@ -66,7 +67,12 @@ void w2_cmd_ping_rx(w2_s_bin *data) {
free(return_message_bin);
}
-void w2_cmd_mode_rx(w2_s_bin *data) { return; }
+void w2_cmd_mode_rx(w2_s_bin *data) {
+ w2_s_cmd_mode_rx *message = malloc(w2_cmd_sizeof(data->data, data->bytes));
+ memcpy(message, data->data, data->bytes);
+
+ w2_modes_switch(message->mode);
+}
void w2_cmd_sped_rx(w2_s_bin *data) { return; }