From 81cd3df7fcf8b4a333d91c52de98f464e01fe0d6 Mon Sep 17 00:00:00 2001 From: bernie Date: Thu, 18 May 2006 02:35:22 +0000 Subject: [PATCH] Protocol RFC. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@617 38d2e660-2303-0410-9eaa-f027e97ec537 --- app/triface/PROTOCOL | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 app/triface/PROTOCOL diff --git a/app/triface/PROTOCOL b/app/triface/PROTOCOL new file mode 100755 index 00000000..d4dbee74 --- /dev/null +++ b/app/triface/PROTOCOL @@ -0,0 +1,84 @@ + +Command format: + + ... + +Where: + command - alphanurmeric command name + argN - numeric argument (unsigned base 10, 0-65535) + +Positive response format: + + 0... + +Where: + argN - numeric value (unsigned base 10, 0-65535) + +Negative response format: + + -N"" + +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 +> or +< 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. -- 2.25.1