SIERRA VIDEO SYSTEMS
28
ensures that a router will always act on a complete command string sent to it, even if the previous
one was never completely received.
When a command string is received, it is not acted upon (but rather, is merely buffered up) until
the final trailer character (!) character of the command string is received. At that time, the routing
switcher begins to execute the commands within the string.
The protocol uses only 7-bit ASCII characters. The 8th bit of received characters is treated as if it
is 0. Within the command string, certain ASCII characters may be present and are ignored: any
ASCII character whose code is
less than
the SPACE character (includes all control characters
and the SPACE character) and the DEL (ASCII 7F) character. Alphabetic characters within the
command string may be in either upper-case or lower-case letters. The router always
sends
upper case characters, except for character strings such as input, output, and level names, which
may have lower case characters in them.
When sending commands
to
the router, SPACE characters are optional, but if used may only
appear before and after each individual command and NOT embedded within an individual
command. Within command strings sent
from
the router, a single SPACE character appears
before and after each individual command. SPACES may also appear in character strings, such
as input, output, and level names.
Certain commands (R, Q, L, and G) have character strings that appear as arguments. The first
three, “R”, “Q”, and “L”, have character strings only in commands sent
from
the router, and these
character strings are always terminated with a ~ (tilde) character. No special character marks the
start of these strings, they simply begin at the appropriate point within the command. The “G”
command, on the other hand, uses the ~ (tilde) character to mark both the
start and end
of a
character string argument.
Just before the router begins executing a command string, it sends a leader (**) to the host (the
same number as are required in commands from the host). As it executes the commands, some
of them may generate additional output back to the host. These command response characters
are always preceded and followed by a space character, making the response string easily
human-readable.
After the command string has been executed, the routing switcher returns the string "
OK
" (with
a single space character before and after the word "OK"), followed by the trailer (!!) and a CR
(carriage return, ASCII 0D) character, to the host. This indicates that the command has executed
successfully. If an error occurs within any command of a command string, the remainder of the
command string is ignored and the router returns the string "
ERROR
", followed by
an optional
descriptive string
followed by a string of trailer characters and a CR character, to the host. An
error can be caused by an unknown command name or bad arguments to a command.
The simplest possible command string would be:**!! which consists of the leader and trailer
characters but no commands between them. This command string would generate the response:
** OK !!<CR>
This can be useful for verifying that the serial link to the router is operational. In routers requiring
only one leader/trailer character, the simplest command string would be: *! which would generate
the response:
* OK !<CR>
(To determine whether a particular router uses one or two leader/trailer characters, send it "!!**"
and check the response to see which of the above two responses it is. It won’t hurt to always use
two even if only one is required.)
The simplest error response is one with no optional descriptive string. For example, this
command string:
** XXX !! might generate this response from the router:
** ERROR Syntax: No Number:XX !!