Skip to content

Commit

Permalink
Solidify protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
evantypanski committed Feb 17, 2019
1 parent 52d89d0 commit c00d4ae
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# ESP8266 Escape Room Wifi
The server and client code for Gizmologists escape room.

Code in `escape-room-server.py` will be run on a Raspberry Pi to be communicated with ESP8266-01 chips. Code in the Arduino libraries runs on Arduinos to communicate with it.

## Protocol
All requests and responses are 7 bytes.

### Requests
Format: `puzzle_code command`

`puzzle_code` - The puzzle of the request
- `MRS`: Morse code puzzle
- `BKS`: Books puzzle
- `TIM`: Time machine puzzle
- `GRS`: Gears puzzle

`command` - The command to run
- `DNE`: Mark puzzle as done
- `RST`: Reset puzzle to incomplete
- `GET`: Get status of puzzle

Example requests:
- `MRS DNE`: Mark the morse code puzzle as done
- `BKS GET`: Get the status of the books puzzle

### Responses

Format: `puzzle_code status`

`puzzle_code` - The puzzle of the request (same codes as request)

`status` - Status of the puzzle AFTER the request is processed (same codes as request)

Response will be `INVALID` if command was invalid in any way.
6 changes: 3 additions & 3 deletions escape-room-server.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
#
# Given a request, this server responds in a 7 byte code as follows:
# puzzle_code status
# Where puzzle_code is the puzzle passed in and status is DNE for done or INC for not done
# Where puzzle_code is the puzzle passed in and status is DNE for done or RST for not done
# BKS DNE: Means books puzzle is done
#
# Note this means DNE commands should always return the puzzle name then DNE
# and RST commands always return puzzle name then INC
# GET commands will return the status, either DNE (done) or INC (incomplete)
# and RST commands always return puzzle name then RST
# GET commands will return the status, either DNE (done) or RST (incomplete)
#
# Invalid commands are responded to with INVALID

Expand Down

0 comments on commit c00d4ae

Please sign in to comment.