We'll use flask-socketio library to create a websocket server and respond to commands. This will allow us to send flight data to the front end in real time, while also making it easy to send commands to the backend.
Commands:
[ ] flight.start - starts new flight, responds with new flight ID. Fails if flight already running.
[x] flight.stop - stops currently running flight
[ ] flight.info - gets info of currently running flight (ID, pilot, start time)
[ ] flight.invalidate - marks flight as invalid for leaderboard (param: flight ID)
[ ] flight.list - responds with list of previous flight ids, w/ pilot info
[ ] joystick.list - responds with list of available joysticks
[ ] joystick.select - selects a given joystick to use for flight (param: joystick index)
We'll use flask-socketio library to create a websocket server and respond to commands. This will allow us to send flight data to the front end in real time, while also making it easy to send commands to the backend.
Commands: