aboutsummaryrefslogtreecommitdiff
path: root/client/commands.c
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-07 22:23:14 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-07 22:23:14 +0200
commit377a6b80fb766995566bd77047eef08e0a4b5aae (patch)
treece70846c12d7426f9550f6dc2a88e49397f4bd52 /client/commands.c
parent3e65c70da770fa31fc8acc6ab9374d908cf1ed17 (diff)
implement mode switching tab
Diffstat (limited to 'client/commands.c')
-rw-r--r--client/commands.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/client/commands.c b/client/commands.c
index 778e9c1..05b92d9 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -46,10 +46,21 @@ void w2_send_ping() {
}
void w2_send_mode(w2_e_mode mode) {
- W2_CREATE_MSG_BIN(w2_s_cmd_mode_rx, msg, msg_bin);
- msg->opcode = W2_CMD_MODE | W2_CMDDIR_RX;
- msg->mode = mode;
+ if (mode == W2_M_PREV) {
+ W2_CREATE_MSG_BIN(w2_s_cmd_sres_rx, msg, msg_bin);
- w2_send_bin(msg_bin);
- free(msg_bin);
+ msg->opcode = W2_CMD_SRES | W2_CMDDIR_RX;
+ msg->type = W2_CMD_SRES_RX_TYPE_PREVMODE;
+
+ w2_send_bin(msg_bin);
+ free(msg_bin);
+ } else {
+ W2_CREATE_MSG_BIN(w2_s_cmd_mode_rx, msg, msg_bin);
+
+ msg->opcode = W2_CMD_MODE | W2_CMDDIR_RX;
+ msg->mode = mode;
+
+ w2_send_bin(msg_bin);
+ free(msg_bin);
+ }
}