diff options
author | lonkaars <loek@pipeframe.xyz> | 2022-05-29 17:01:03 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2022-05-29 17:01:03 +0200 |
commit | 59802547c336d61aa7e950414a3f44180e211974 (patch) | |
tree | cf7107b9085ce3c93e98ec874d25e04ad2362a4c /client/serial.c | |
parent | 3b2c2cf6b2af9e76b343a5a8fc8e9245f240690d (diff) |
client ping working
Diffstat (limited to 'client/serial.c')
-rw-r--r-- | client/serial.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/client/serial.c b/client/serial.c index 6f667a8..ec523cc 100644 --- a/client/serial.c +++ b/client/serial.c @@ -1,15 +1,18 @@ #include "serial.h" +#include "time.h" +#include "main.h" #include "../shared/protocol.h" #include "../shared/serial_parse.h" void w2_serial_main() { int temp; while ((temp = w2_serial_read()) != -1) w2_serial_parse(temp); - w2_serial_write("\xff\x14", 2); } void w2_cmd_ping_tx(w2_s_bin *data) { - printf("w2_cmd_ping_tx()\n"); + // TODO: check ping id + g_w2_state.ping = w2_timer_end(W2_TIMER_PING); + printf("ping measured, %ims\n", g_w2_state.ping); } void w2_cmd_expt_tx(w2_s_bin *data) { printf("w2_cmd_expt_tx()\n"); |