Skip to content

Bit-stuffing issue #4

@OliverGorman

Description

@OliverGorman

This issue takes place in the process() function of the Encoder class.
If a byte is begun with a stuffed bit, bitPosition is not incremented. This leads to the next byte being loaded before the current byte has been transmitted.

In other words, if bytePosition % 8 == 0 and a bit-stuff occurs, currentByte will be overwritten on the next iteration since the algorithm thinks the byte has finished.

A simple solution would be to introduce a flag that when raised prevents entry into the if(bitPosition == 0) block. It is lowered on each loop before currentBit is set, and raised when a bit-stuff occurs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions