Barnard-PL-Labs / esp32-tanks

5 stars 0 forks source link

Have tank respond to coordinator with JSON objects #9

Closed zjc2106 closed 8 months ago

zjc2106 commented 8 months ago

[X] Update the tank's responses to the coordinator to be JSON objects instead of strings [X] Make sure all other network communication is JSON objects

faustinacheng commented 8 months ago

See below on how the packets are structured now:

Packet Structure

Sent Commands

Sent commands are in JSON format, where the function field can be:

Each of these functions have their own required fields:

motor

Example:

{
  "function": "motor",
  "direction": "f",
  "value": "1000"
}

light (TBD)

camera (TBD)

TBD

Note: Commands should be entered via the serial in the form: [function] <required fields>, where the required fields follow the order specified above.

Responses

Responses are also in JSON format, with the fields:

Example:

{
    "status": "success",
    "message":
}

Will add the above as a doc in communication/README.md