37#ifndef _DCC_RAILCOMBROADCASTDECODER_HXX_
38#define _DCC_RAILCOMBROADCASTDECODER_HXX_
Simple state machine to decode DCC address from railcom broadcast packets.
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)
uint16_t current_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.
uint16_t lastAddress_
usable by clients for storage.
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
Structure used for reading (railcom) feedback data from DCC / Railcom device drivers.