HSP

Version 26 (J. Simmons, 11/12/2017 02:37 am)

1 1 J. Simmons
h1. Holoseat Serial Protocol
2 1 J. Simmons
3 1 J. Simmons
{{>toc}}
4 1 J. Simmons
5 1 J. Simmons
h2. Introduction
6 1 J. Simmons
7 1 J. Simmons
_*Note*: Beginning with version 0.4.0, this document supersedes the material covered in [[Software Source Code|Project Software]].
8 1 J. Simmons
_
9 1 J. Simmons
The HoloSeat firmware has a serial protocol, the Holoseat Serial Protocol (HSP), to enable the desktop configuration app to modify all key parameters and to determine the current configuration of the Holoseat at runtime.  It is laid out to mirror the REST API presented to Holoseat clients by the desktop application.
10 1 J. Simmons
11 1 J. Simmons
h2. Serial Port Configuration
12 1 J. Simmons
13 2 J. Simmons
|*Field*|*Value*|
14 1 J. Simmons
|Baud Rate|115200|
15 1 J. Simmons
|Data Bits|8|
16 1 J. Simmons
|Parity|None|
17 1 J. Simmons
|Stop Bit|1|
18 2 J. Simmons
19 4 J. Simmons
h2. Command Structure
20 4 J. Simmons
21 22 J. Simmons
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.  
22 22 J. Simmons
23 22 J. Simmons
Note, the Holoseat Python serial library will insert a message ID if none is included.  But users interacting directly with the serial port must include at least an empty message ID.  This means that the message ID is optional from the app serial monitor and from the app libraries, but not the Arduino serial monitor.  
24 22 J. Simmons
25 22 J. Simmons
*TODO* (fill this in more)
26 4 J. Simmons
27 2 J. Simmons
h2. Low Level Commands
28 2 J. Simmons
29 26 J. Simmons
The low level commands are intended for development or low level communication use.  These commands will not be reproduced in the Holoseat REST API.  
30 1 J. Simmons
31 1 J. Simmons
|*Command Name*|*URI*|*Verb*|
32 26 J. Simmons
|Echo Current Events|/lowlevel/events|GET|
33 26 J. Simmons
||\2. @{"messageId":"ee764e45b0de469d9c949dc1c43beb1a","uri":"/lowlevel/events","verb":"GET"}@|
34 26 J. Simmons
||\2. @{messageId":"ee764e45b0de469d9c949dc1c43beb1a","events":"Echoed"}@|
35 26 J. Simmons
|\3. |
36 24 J. Simmons
37 8 J. Simmons
38 1 J. Simmons
h2. Public Commands
39 1 J. Simmons
40 1 J. Simmons
The following commands mirror the REST API to implement the features of the REST API.
41 1 J. Simmons
42 20 J. Simmons
|*Command Name*|*URI*|*Verb*|
43 20 J. Simmons
|Get Device Name|/main/devicename|GET|
44 20 J. Simmons
||\2. @{"messageId":"ee764e45b0de469d9c949dc1c43beb1a","uri":"/main/devicename","verb":"GET"}@|
45 20 J. Simmons
||\2. @{messageId":"ee764e45b0de469d9c949dc1c43beb1a","deviceName":"Holoseat Alpha"}@|
46 20 J. Simmons
|\3. |
47 20 J. Simmons
|Get Version|/main/version|GET|
48 20 J. Simmons
||\2. @{"messageId":"ee764e45b0de469d9c949dc1c43beb1a","uri":"/main/version","verb":"GET"}@|
49 20 J. Simmons
||\2. @{"messageId":"ee764e45b0de469d9c949dc1c43beb1a","hwVer":"v0.4","fwVer":"v0.4.0","hspVer":"v0.4.0"}@|
50 23 J. Simmons
|Get Enabled State|/main/enabled|GET|
51 23 J. Simmons
||\2. @{"messageId":"ee764e45b0de469d9c949dc1c43beb1a","uri":"/main/enabled","verb":"GET"}@|
52 23 J. Simmons
||\2. @{messageId":"ee764e45b0de469d9c949dc1c43beb1a","enabled":1}@|
53 23 J. Simmons
|\3. |
54 23 J. Simmons
|Set Enabled State|/main/enabled|PUT|
55 25 J. Simmons
||\2. @{"messageId":"ee764e45b0de469d9c949dc1c43beb1a","uri":"/main/enabled","verb":"PUT", "args":{"enabled":0}}@|
56 23 J. Simmons
||\2. @{messageId":"ee764e45b0de469d9c949dc1c43beb1a","enabled":0}@|
57 23 J. Simmons
|\3. |