Software Source Code

Version 1 (J. Simmons, 12/29/2017 04:25 am) → Version 2/8 (J. Simmons, 12/29/2017 04:31 am)

h1. Software Source Code

h2. Firmware

h3. Common

|*Field*|*Value*|
|Baud Rate|115200|
|Data Bits|8|
|Parity|None|
|Stop Bit|1|

Commands are sent as JSON strings with a message ID (may be an empty string, but must be present), a URI, an HTTP verb, and possibly arguments.

h3. Tone Ring Controller

|*Command Name*|*URI*|*Verb*|
|Run the motor (use @"CW":-1@ for CCW direction)|/motor|PUT| |Get Device Name|/motor|PUT|
||\2. @{"messageId":"1000","uri":"/motor","verb":"PUT", "args":{"revolutions":1, "cadence": "speed": 30, "CW":1}}@|
||\2. @{messageId":"1000","revolutions":1, "cadence": "speed": 30, "CW":1}@|
|\3. |

h3. Sensor Controller

|*Command Name*|*URI*|*Verb*|
|Get the sensor stats|/stats|GET|
||\2. @{"messageId":"1000","uri":"/stats","verb":"GET"}@|
||\2. @{messageId":"1000","revolutions":1, "maxCadence": 30, "CW":1}@|
|\3. |
|Clear the sensor stats|/stats|DELETE|
||\2. @{"messageId":"1000","uri":"/stats","verb":"DELETE"}@|
||\2. @{messageId":"1000","revolutions":0, "maxCadence": 0, "CW":0}@|