WolfVision SCB-1 User Manual

Page 17

Advertising
background image

SCB-1 Command

List

R

15

Packet-Format


Short-Packet-Format: For short packets (up to 15 Byte Data):
00hex Len+F0hex Data[1] Data[2]... Data[Len]

Checksum


Long-Packet-Format: For long packets (up to 61439 Byte Data):
00hex

Len H

Len L

Len-Checksum

Data[1]... Data[Len]

Data-Checksum


The long-packet-format-data can also be used for short packets (below 15 bytes of data).
(However, only one of the two possible formats will be used in this document.) The long
packet-format is mainly used for the "OSD Write Line"-command and for image transfers.

Len H and Len L are the High- and Low-Byte of the 16 bit Length. The High-Byte is not
allowed to get F0hex or higher, as this would indicate the short-packet-format. In the short-
packet-format, F0hex is added to the length, so F1hex is for 1 byte length, F2hex for 2 byte,
etc.

The checksum is the ones-complement (bit-wise NOT) of the sum of all length- and data-
bytes (truncated to 8 bit).

The length-checksum is the ones-complement (bit-wise NOT) of the sum of both length-bytes
(truncated to 8 bit).

The data-checksum is the ones-complement (bit-wise NOT) of the sum of all data-bytes
(truncated to 8 bit).

The shortest possible packet has a length of 4 Bytes (using the short-packet-format): 1 Byte
Header, 1 Byte Length, 1 Byte Data and 1 Byte Checksum. For example, if Data is 01hex:

00hex F1hex

01hex 0Dhex

Header Length

Data

Checksum

(F1hex+01hex=F2hex,
Ones-Complement=0Dhex)

Following message in the long-packet-format would have the same effect:

00hex 00hex

01hex FEhex

01hex FEhex

Header Length H

Length L Check Len

Data

Checksum Data

(00hex+01hex=01hex,

(01hex=01hex,

Ones-Complement=FEhex)

Ones-Complement=FEhex)


The host and the camera should both ignore all the data that they receive if a header is not
detected (however, the camera will respond to 76hex with a version-string) If the camera
detects a checksum-error, it will reply with a checksum-error-packet and the host should
resend the packet. If e.g. the header from the host is corrupted, the camera will not detect the
header and will not respond to the packet. The host should then time-out and resends the
packet. If a false header is detected (e.g. a Data-Byte is 00hex) a checksum-error will be
generated. If the camera receives the start of a packet, but not enough data, it will timeout
after 1 second and send a time-out-error-packet.

Advertising