SeaTrac Serial Command Interface Reference
Page 26
5.3.
Synchronisation Characters
To indicate the start of a message, a unique synchronisation character (‘#’ or ‘$’) is used,
whose presence is guaranteed not to occur anywhere else other than at the start of a valid
message.
Messages from the PC to the Beacon should start with a ‘#’ character (ASCII code 35).
Messages from the Beacon to the PC start with a ‘$’ character (ASCII code 36).
5.4.
Data Encoding
Following the synchronisation character, all message data is encoded in ASCII as hexadecimal
character pairs describing bytes of data – where the first received character represents the
most-significant nibble (bits 7 to 4) and the second character represent the lest-significant
nibble (bits 3 to 0).
This means that only hexadecimal characters ‘0’ to ‘9’ and ‘A’ to ‘F’ are valid during decoding of
the message content following the synchronisation character. All other characters are invalid.
For data values that require more than one byte in size to transmit (i.e. 16-bit Words and 32-
bit DWords), the value is transmitted least-significant-byte first (Little-Endian).
Data lengths should always be a multiple of 2 as single nibble (character) values are never
used.
For example receiving characters…
Sequence 4A = 0x4A = 0b010 01010 = 74 decimal
Sequence 1234 = 0x3412 = 0b0011 0100 0001 0010 = 13330 decimal
The end of the message is indicated by the ‘Carriage-Return/Line-Feed’ character pair
(<CR><LF>) of ASCII values 13 (0x0D) and 10 (0x0A) respectively, allowing data to be
displayed on a variety of terminal applications.
5.5.
Command ID Codes
Following the synchronisation character, all messages start with a single byte (2 character)
Command Identification Code (CID), indicating the purpose of the following data payload.
All acknowledgement Response Messages sent from the Beacon use the same CID as that
specified in the Command Message sent to the Beacon.
For a list of valid
codes see section 6.3.6, and section 7 for definitions of their purpose.