htsmsgbinary wiki page information
Added by Martin Bednar almost 12 years ago
Hi all, I'm trying implement the htsp protocol, and I think that a mention that message size and and datalength aren't encoded using the S64 scheme would be nice.
Integers are encoded using a very simple variable length encoding. All leading bytes that are 0 is discarded. So to encode the value 100, datalength should be 1 and the data itself should be just one byte [0x64]. To encode 1337; datalength=2, data=[0x39 0x05].
The fact that it says "Integers are encoded" led me to think that it included all integers, even those in the message header are encoded using this scheme. Took me 2 evenings and reading two other implementations to figure out