News for hackers. Stuff that matters.
Re:Consistent Overhead Byte Stuffing (1999) [pdf] by layoutIfNeeded on Sunday April 04, 2021 @04:44PM (#26692671)
So how would you send a single non-zero byte this way? Or is that why you need the zero byte to delimit your messages? Also it seems that if you wanted to pause your transmission you can’t really “flush” the incomplete COBS frame unless it happens to end with a zero...
Re:Consistent Overhead Byte Stuffing (1999) [pdf] by geeB on Sunday April 04, 2021 @08:52PM (#26694283)
As per the siblings, the encoding for that would be 02 xx (also figure 1 in the paper).

As for delimiters, it's not so much that to use COBS you need the delimiter, but the causality usually goes the other way, i.e. you want to send packets over an unreliable stream where every symbol is valid data, so you use 00 as the packet delimiter, and encode the actual packets with COBS (so the encoded packets won't have zeros).

So in general you won't need to "flush" partial data, because the natural way to interface to this type of channel is to send whole packets. If you don't know in what state the channel is, you can always send out a 00 before the start of packet to make sure the previous packet gets terminated.

And usually the packets themselves will have some additional validation like CRC, so the previous incomplete packet will be ignored.

Re:Consistent Overhead Byte Stuffing (1999) [pdf] by lifthrasiir on Sunday April 04, 2021 @04:56PM (#26692761)
> COBS first takes its input data and logically appends a single zero byte. (It is not necessary actually to add this zero byte to the end of the packet in memory; the encoding routine simply has to behave as if the added zero were there.)

So it's `02 xx`. By the way, a single zero byte would be `01 01`.

Re:Consistent Overhead Byte Stuffing (1999) [pdf] by layoutIfNeeded on Sunday April 04, 2021 @05:30PM (#26693020)
Ah, thanks, I've missed that part.
Re:Consistent Overhead Byte Stuffing (1999) [pdf] by jevinskie on Sunday April 04, 2021 @04:57PM (#26692770)