diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-06-02 12:16:19 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-06-02 12:16:19 +0200 |
commit | d477e63d1968bea59afee7a9e69778952668c49e (patch) | |
tree | 507a9e2580d0ac33fce9e9d70d2ab0f4de845e12 /client | |
parent | b12d6b2ecee0be03122a4bdba8ebbc91112fae3f (diff) | |
parent | e5eeab9dc97c37be905bd616f38e83488dbe2136 (diff) |
fix pull merge conflict
Diffstat (limited to 'client')
-rw-r--r-- | client/commands.c | 21 | ||||
-rw-r--r-- | client/commands.h | 2 |
2 files changed, 12 insertions, 11 deletions
diff --git a/client/commands.c b/client/commands.c index 62867dd..778e9c1 100644 --- a/client/commands.c +++ b/client/commands.c @@ -1,6 +1,7 @@ #include <stdlib.h> #include "../shared/bin.h" +#include "../shared/modes.h" #include "../shared/protocol.h" #include "commands.h" #include "main.h" @@ -22,6 +23,16 @@ void w2_send_info() { free(msg_bin); } +void w2_send_dirc(uint16_t left, uint16_t right) { + W2_CREATE_MSG_BIN(w2_s_cmd_dirc_rx, msg, msg_bin); + msg->opcode = W2_CMD_DIRC | W2_CMDDIR_RX; + msg->left = w2_bin_hton16(left); + msg->right = w2_bin_hton16(right); + + w2_send_bin(msg_bin); + free(msg_bin); +} + void w2_send_ping() { g_w2_state.ping_id = (uint8_t)rand(); W2_CREATE_MSG_BIN(w2_s_cmd_ping_rx, msg, msg_bin); @@ -42,13 +53,3 @@ void w2_send_mode(w2_e_mode mode) { w2_send_bin(msg_bin); free(msg_bin); } - -void w2_send_dirc(int left, int right) { - W2_CREATE_MSG_BIN(w2_s_cmd_dirc_rx, msg, msg_bin); - msg->opcode = W2_CMD_DIRC | W2_CMDDIR_RX; - msg->left = w2_bin_hton16((uint16_t)left); - msg->right = w2_bin_hton16((uint16_t)right); - - w2_send_bin(msg_bin); - free(msg_bin); -} diff --git a/client/commands.h b/client/commands.h index 6768ea1..5a12424 100644 --- a/client/commands.h +++ b/client/commands.h @@ -7,4 +7,4 @@ void w2_send_info(); void w2_send_ping(); void w2_send_mode(w2_e_mode mode); -void w2_send_dirc(int left, int right); +void w2_send_dirc(uint16_t left, uint16_t right); |