Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communication Protocol #4

Open
dimembermatt opened this issue Sep 6, 2020 · 1 comment
Open

Communication Protocol #4

dimembermatt opened this issue Sep 6, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dimembermatt
Copy link
Contributor

dimembermatt commented Sep 6, 2020

Robot to Server (GET requests)

When a robot joins the server:
{URL}/robotJoin {ID} {CHARGE} {MOVEMENT} {EYE COLOR} {EYE EXPRESSION} => "OK", 200
The specific format of the request should be as follows:
{URL}/robotJoin?ID={ID}&CHARGE={CHARGE}&MOVE={MOVEMENT}&EC={EYE COLOR}&EE={EYE EXPRESSION}

When a robot leaves the server:
/robotLeave {ID} => "OK", 200

When a robots wants to get the new status:
/robotUpdate {ID} {CHARGE} => "{MOVEMENT}, {EYE COLOR/EXPRESSION} {opt: SHUTDOWN}", 200

User to Server (GET requests)

When the user wants the robot to adopt a specific movement
/userMove {ID} {MOVEMENT} => updated HTML page, 200

When the user wants the robot to adopt a specific expression
/userExpress {ID} {EYE COLOR} {opt: EYE EXPRESSION} => updated HTML page, 200

When the user wants the robot to shut down
/userShutdown {ID} {SHUTDOWN} => updated HTML page, 200

When the user wants to get an updated version of the page
/ => updated HTML page, 200

Parameter specific values are all strings, but need to be parsed into their respective formats:

  • ID - INT32 (positive integer)
  • CHARGE - FLOAT32 (value from 0 to 100%)
  • MOVEMENT - STRING (out of a preset list of movements)
  • EYE COLOR - STRING (out of a preset list of eye colors)
  • EYE EXPRESSION - STRING (out of a preset list of eye expressions)
  • SHUTDOWN COMMAND - BOOL (1 for force shutdown, 0 for no shutdown (default))
@dimembermatt
Copy link
Contributor Author

A suggestion for the return payload string for the Dancebot is of the sort:

  • /robotJoin: "{ROBOT_ID} has joined the server."
  • /robotLeave: "{ROBOT_ID} has left the server."
  • /robotUpdate: "{ROBOT_ID},{MOVEMENT},{EYE_COLOR},{EYE_EXPRESSION},{SHUTDOWN}"

On the firmware end, we'll just be reading the HTTP codes for the first two, but for the third we'll read the HTTP code, check if it's 200, and then parse the string above you give us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants