Protocol RFC.
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 18 May 2006 02:35:22 +0000 (02:35 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Thu, 18 May 2006 02:35:22 +0000 (02:35 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@617 38d2e660-2303-0410-9eaa-f027e97ec537

app/triface/PROTOCOL [new file with mode: 0755]

diff --git a/app/triface/PROTOCOL b/app/triface/PROTOCOL
new file mode 100755 (executable)
index 0000000..d4dbee7
--- /dev/null
@@ -0,0 +1,84 @@
+
+Command format:
+
+  <command><SP><arg1><SP>...<argN><CR><LF>
+
+Where:
+  command - alphanurmeric command name
+  argN    - numeric argument (unsigned base 10, 0-65535)
+
+Positive response format:
+
+  0<SP><arg1><SP>...<argN><CR><LF>
+
+Where:
+  argN   - numeric value (unsigned base 10, 0-65535)
+
+Negative response format:
+
+  -N<SP>"<desc>"<CR><LF>
+
+Where:
+  -N    - numeric error code (negative number)
+  desc  - verbose error description
+
+# Write digital outputs (masked)
+> dout 120 240
+< 0
+
+# Read digital inputs
+> din
+< 0 125
+
+# Read analog inputs
+> ain
+< 0 32 121 35 31
+
+# Wait specified amount of milliseconds
+> sleep 300
+< 0
+
+# Return firmware major version, minor version and revision
+> vers
+< 0 1 42 0
+
+# Reset board
+< reset
+> 0
+
+# Ping/nop
+< ping
+> 0
+
+# NOP (empty command)
+>
+< (ignored)
+
+# Comments
+> # foo bar foobar
+< (ignored)
+
+# Unknown command
+> sing
+< -1 "Unknown command"
+
+# Missing parameter
+> dout 
+< -2 "Required parameter missing"
+
+# Too many parameters
+> din 42 666
+< -3 "Too many parameters"
+
+# Malformed command
+> dout %'I!
+< -4 "Invalid parameter"
+
+# Attention
+> <CTRL-C> or <CTRL-D>
+< 1 "Uh?"
+
+
+To recover from a possibly unknown board status,
+a client should begin the conversation by issuing
+an attention sequence, eventually followed by a reset.