Clearing The Command Buffer - Zektor CVS4 User Manual

High definition component video switch
Hide thumbs Also See for CVS4:
Table of Contents

Advertisement

K.I.S.S.™ (Continued)
be returned.
See: "Checksums and CRC-8's" for more information on both, and source code examples of
calculating both Checksums and CRC-8's as used by K.I.S.S.™.

Clearing the Command Buffer

All commands are buffered and nothing is executed until the <CR> character is received. To as-
sure that there are no extraneous characters in the command buffer, before a command string is
sent, the <ESC> character can be issued to clear the buffer and reset any checksum or CRC-8
checkcode calculations.
This is useful when communications with the Zektor device is being initialized and the state of
the device is unknown. An <ESC> will clear the command buffer and reset all checksums and
CRC-8 checkcodes.
For example:
dsLG.%df<ESC>V;145<CR>
will return the Version Query Response string for most Zektor devices. The "dsLG%df"
represents noise that could have been in the buffer before the command string was issued. The
<ESC> clears the buffer allowing the "V;145<CR>" to be processed error free.
It is legitimate to prefix all commands with the <ESC> character to assure the buffer is always
empty before the command string is received, which may be helpful in a very noisy environment.
The Response Strings
A response will always be returned whenever a <CR> is received. There are no conditions
where a "timeout" is a valid response to any query.
There are only three valid responses in the K.I.S.S.™ protocol, anything else should be consid-
ered a communication error, including a timeout while waiting for a response.
Each response is prefixed by a unique character. Determining which of the three responses is
received can be done simply, by examining only the first character of any response string.
The three possible prefix characters and their associated responses are
+
The Acknowledgement Response
!
The Error Response
=
The Query Response
The response to a command string will always be an Acknowledgement or an Error Response.
The Acknowledgement is always the string:
+<CR><LF>
CVS4 Component Video Switch


Advertisement

Table of Contents
loading

Table of Contents