From 52e14dfaa825e46d4d72a550edd216a3c6986182 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Sat, 12 Jun 2021 21:00:55 +0100 Subject: [PATCH] Update Command<->Control reference doc Add Rover state and correct comments --- Control/ref/command.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Control/ref/command.cpp b/Control/ref/command.cpp index 6ece01e..ec029d9 100644 --- a/Control/ref/command.cpp +++ b/Control/ref/command.cpp @@ -3,8 +3,8 @@ #include #define WebSocket 0 -int batteryVoltage, batteryLevel, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Command ==> Control -int command_id, mode, reqHeading, reqDistance, reqSpeed, reqCharge; // Info Control ==> Command +int state, batteryVoltage, batteryLevel, totalTripDistance, currentHeading, current_x, current_y, signal_strength, lastCompletedCommand_id; // Info Control ==> Command +int command_id, mode, reqHeading, reqDistance, reqSpeed, reqCharge; // Info Command ==> Control void setup() {} @@ -12,6 +12,7 @@ void loop() { DynamicJsonDocument rdoc(1024); // receive doc, not sure how big this needs to be deserializeJson(rdoc, WebSocket); // Take JSON input from WebSocket + state = rdoc["st"]; // State: -1 = Error, 0 = Idle, 1 = Moving, 2 = Charging batteryVoltage = rdoc["bV"]; batteryLevel = rdoc["bL"]; totalTripDistance = rdoc["tD"];