summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2022-06-24 11:42:23 +0200
committerlonkaars <loek@pipeframe.xyz>2022-06-24 11:42:23 +0200
commit40f6164ba6187a0160af9fe200bbd1d729e8c03b (patch)
tree84246633f40cb0c5d858168f63a5933d18006db3 /client
parent2e537232404bf5123bc92e7218156ec03160c68f (diff)
added TARQ to robot and client
Diffstat (limited to 'client')
-rw-r--r--client/commands.c10
-rw-r--r--client/commands.h2
-rw-r--r--client/i18n.h1
-rw-r--r--client/i18n/en_us.h3
-rw-r--r--client/makefile2
-rw-r--r--client/serial.c1
-rw-r--r--client/ui_modes.c4
7 files changed, 21 insertions, 2 deletions
diff --git a/client/commands.c b/client/commands.c
index d2e53c8..768289e 100644
--- a/client/commands.c
+++ b/client/commands.c
@@ -64,3 +64,13 @@ void w2_send_mode(w2_e_mode mode) {
free(msg_bin);
}
}
+
+void w2_send_tarq(w2_e_target_area target_area) {
+ W2_CREATE_MSG_BIN(w2_s_cmd_tarq_rx, msg, msg_bin);
+
+ msg->opcode = W2_CMD_TARQ | W2_CMDDIR_RX;
+ msg->target_area = target_area;
+
+ w2_send_bin(msg_bin);
+ free(msg_bin);
+}
diff --git a/client/commands.h b/client/commands.h
index 02ae313..8917f99 100644
--- a/client/commands.h
+++ b/client/commands.h
@@ -2,6 +2,7 @@
#include "../shared/bin.h"
#include "../shared/modes.h"
+#include "../shared/protocol.h"
#include "serial.h"
void w2_send_bin(w2_s_bin *data);
@@ -10,3 +11,4 @@ void w2_send_info();
void w2_send_ping();
void w2_send_mode(w2_e_mode mode);
void w2_send_dirc(uint16_t left, uint16_t right);
+void w2_send_tarq(w2_e_target_area target_area);
diff --git a/client/i18n.h b/client/i18n.h
index a8a6d9c..7d1fcbd 100644
--- a/client/i18n.h
+++ b/client/i18n.h
@@ -9,4 +9,3 @@
#define W2_LANG_DEFAULT
#include "i18n/en_us.h"
#endif
-
diff --git a/client/i18n/en_us.h b/client/i18n/en_us.h
index d198296..2a24c15 100644
--- a/client/i18n/en_us.h
+++ b/client/i18n/en_us.h
@@ -110,6 +110,9 @@
"4 - set to charging station mode\n" \
"5 - set to spinning mode (wet floor simulation)\n" \
"6 - calibrate sensors\n" \
+ "7 - set target area to maze\n" \
+ "8 - set target area to grid\n" \
+ "9 - set target area to charging station\n" \
"\n" \
"0 - previous\n" \
diff --git a/client/makefile b/client/makefile
index d89c186..e72b585 100644
--- a/client/makefile
+++ b/client/makefile
@@ -1,7 +1,7 @@
CC = gcc
LD = gcc
RM = rm -f
-CFLAGS = -DW2_LANG_NL_NL
+CFLAGS = -DW2_LANG_EN_US
LDFLAGS = -lncursesw
EXECNAME = main
diff --git a/client/serial.c b/client/serial.c
index 2a4d26f..e52939f 100644
--- a/client/serial.c
+++ b/client/serial.c
@@ -54,3 +54,4 @@ void w2_cmd_info_rx(w2_s_bin *data) { return; }
void w2_cmd_disp_rx(w2_s_bin *data) { return; }
void w2_cmd_play_rx(w2_s_bin *data) { return; }
void w2_cmd_cled_rx(w2_s_bin *data) { return; }
+void w2_cmd_tarq_rx(w2_s_bin *data) { return; }
diff --git a/client/ui_modes.c b/client/ui_modes.c
index 3048ba9..bb34d3c 100644
--- a/client/ui_modes.c
+++ b/client/ui_modes.c
@@ -10,6 +10,10 @@ void w2_ui_onkey_modes(int ch) {
if (ch == '5') w2_send_mode(W2_M_SPIN);
if (ch == '6') w2_send_mode(W2_M_SCAL);
+ if (ch == '7') w2_send_tarq(W2_AREA_MAZE);
+ if (ch == '8') w2_send_tarq(W2_AREA_GRID);
+ if (ch == '9') w2_send_tarq(W2_AREA_CHRG);
+
if (ch == '0') w2_send_mode(W2_M_PREV);
}