Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does the new serial framing protocol in TOS 1.1.x work?

framing Protocol serial TOS
0
Posted

How does the new serial framing protocol in TOS 1.1.x work?

0

Previous versions of TOS sent a serial message without real framing: addr 2 bytes type 1 byte group 1 byte length 1 byte payload 29 bytes crc 2 bytes The trick was that since the addr field is not needed on a serial link, they made the first character 126, which happens to be the HDLC framing byte. Readers look for 126 and assume that the next 35 bytes are the rest of the TOS message. The new format adds some additional framing bytes: sync 1 byte (HDLC framing byte: 126) proto 1 byte (packet type: 66) previous_tos_message (36 bytes) sync 1 byte (HDLC framing byte: 126) The trick here is that within the previous_tos_message all instances of the HDLC framing byte (126) and the HDLC escape bytes (125) must be escaped. To escape a byte, the byte is replaced with a two byte sequence. The first byte of the sequence is the HDLC escape byte (125), and the second byte is the original byte xored with x20. Since the first byte of the previous_tos_message is always a 126, it must always be escaped

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123