Rename app dir to examples.
[bertos.git] / examples / triface / doc / PROTOCOL
1
2 Command format:
3
4   <command><SP><arg1><SP>...<argN><CR><LF>
5
6 Where:
7   command - alphanumeric command name
8   argN    - numeric argument (unsigned base 10, 0-65535)
9
10 Positive response format:
11
12   0<SP><arg1><SP>...<argN><CR><LF>
13
14 Where:
15   argN   - numeric value (unsigned base 10, 0-65535)
16
17 Negative response format:
18
19   -N<SP>"<desc>"<CR><LF>
20
21 Where:
22   -N    - numeric error code (negative number)
23   desc  - verbose error description
24
25 # Write digital outputs (masked)
26 > dout 120 240
27 < 0
28
29 # Read digital inputs
30 > din
31 < 0 125
32
33 # Read analog inputs
34 > ain
35 < 0 32 121 35 31
36
37 # Wait specified amount of milliseconds
38 > sleep 300
39 < 0
40
41 # Return firmware major version, minor version and revision
42 > vers
43 < 0 1 42 0
44
45 # Reset board
46 < reset
47 > 0
48
49 # Ping/nop
50 < ping
51 > 0
52
53 # NOP (empty command)
54 >
55 < (ignored)
56
57 # Comments
58 > # foo bar foobar
59 < (ignored)
60
61 # Unknown command
62 > sing
63 < -1 "Unknown command"
64
65 # Missing parameter
66 > dout 
67 < -2 "Required parameter missing"
68
69 # Too many parameters
70 > din 42 666
71 < -3 "Too many parameters"
72
73 # Malformed command
74 > dout %'I!
75 < -4 "Invalid parameter"
76
77 # Attention
78 > <CTRL-C> or <CTRL-D>
79 < 1 "Uh?"
80
81
82 To recover from a possibly unknown board status,
83 a client should begin the conversation by issuing
84 an attention sequence, eventually followed by a reset.