68 for (
unsigned i = 0; i < size; ++i)
90 case dcc::RMOB_ADRLOW:
104 case dcc::RMOB_ADRHIGH:
const uint8_t railcom_decode[256]
Table for 8-to-6 decoding of railcom data.
static const uint8_t MIN_EMPTY_COUNT
This is how many empty packets we need to forget the current address when we're getting empty packets...
uint16_t currentAddress_
last valid address (0 if no valid address)
bool process_data(const uint8_t *data, unsigned size)
Helper function to process a sequence of bytes (whichever window they are coming from).
bool process_packet(const dcc::Feedback &packet)
Decodes a packet.
void set_occupancy(bool value)
Notifies the state machine about observed occupancy.
uint8_t countH_
observed repeat count of high address bits
uint8_t currentL_
last received low address bits
static const uint8_t MIN_REPEAT_COUNT
How many times we shall get the same data out of railcom before we believe it and report to the bus.
uint8_t countL_
observed repeat count of low address bits
void notify_empty()
Notifies the state machine that there is no occupancy detected.
uint8_t currentH_
last received high address bits
uint8_t ch2Size
Number of bytes in channel two.
uint8_t ch1Size
Number of bytes in channel one.
uint8_t ch1Data[2]
Payload of channel 1.
Structure used for reading (railcom) feedback data from DCC / Railcom device drivers.
@ INV
invalid value (not conforming to the 4bit weighting requirement)