VideoReQuest Protocol Guide v1.1.2 - 5/18/04
Phone (518) 899-1254
•
Fax (518) 899-1251
•
www.request.com
-
6 -
Data Check Sum:
If you are not using Check Sum (based on your Flag settings), then set this byte to
00
h
.
Otherwise, see
Calculating Checksum
below for more information.
I n i t i a l i z i n g t h e C o n n e c t i o n
Before the VideoReQuest will respond to commands OR send you feedback, you must initialize
the connection. This tells the VideoReQuest a number of things, including whether or not you
wish to calculate Check Sum, how many lines of feedback you want at a time, etc. The
format for a “Start Communications” command is as follows:
HEADER DATA
Marker
Command
Type
Command
Subtype
Flags
Data Size
Chk Sum
Cmd
Lines
Chk Sum
FC
h
A0
h
05
h
01
h
Byte 1
Byte 2
00
h
03
h
00
h
01
h
06
h
00
h
Currently, the only variable in this string is
Flags
, which you can set to whatever you want
depending on whether or not you want to use Acknowledgements or Check Sum (see
Flags
on the previous page for more information). To simplify programming, it is recommended
that you use
00
h
, 00
h
for the flag bytes, which turns OFF both Acknowledgements and
Check Sum calculation.
Lines:
The
Lines
portion of the data section is a 1 byte value that tells the VideoReQuest how many
lines of text you want to receive at once on the Browse and Chapters pages. Currently, the
only supported value is
06
h
.
C a l c u l a t i n g C h e c k s u m
The Checksum can be calculated as follows:
1.
Take the value of each byte in the string, up to but NOT including the checksum, and
multiply it by the position in the string from left to right (the leftmost byte is byte 1)
2.
Add all the values calculated in step 1
3.
Convert the result to Hex
4.
The rightmost Hex byte is the checksum
This is done the same way for both the Header and the Data checksums.
Example Header Checksum:
Byte 1
Byte 2
Byte 3
Byte 4
Byte 5
Byte 6
Byte 7
Byte 8
Byte 9
Incoming String
FC A0 05 01 00 00 00 03 67
Integer value
252
160
5 1 0 0 0 3 n/a
Position Multiplier
1 2 3 4 5 6 7 8 9
Result
252
320
15 4 0 0 0 24
n/a
Sum of all Results = 252+320+15+4+0+0+0+24 = 615 =
02
h
, 67
h
The
rightmost
byte of the result is
67
h
, which is the calculated checksum. As we can see,
that matches the incoming checksum, so no data was lost.