35#ifndef _OPENLCB_DCCDEBUGFLOW_HXX_
36#define _OPENLCB_DCCDEBUGFLOW_HXX_
52 Debug::DccPacketDelay::set(
false);
54 STATE(msg_allocated));
64 string((
char*)
message()->data()->payload,
message()->data()->dlc));
66 return release_and_exit();
84 void dcc_packet_finished(
const uint8_t* payload,
size_t len)
override {
87 memcpy(b->data()->payload, payload, len);
91 void mm_packet_finished(
const uint8_t* payload,
size_t len)
override {
94 memcpy(b->data()->payload, payload, len);
95 b->data()->payload[0] |= 0xFC;
99 void debug_data(uint32_t value)
override {
100 value /= (configCPU_CLOCK_HZ / 1000000);
105 void log(uint8_t value) {
106 dbuffer[ptr] = value;
108 if (ptr >=
sizeof(dbuffer)) ptr = 0;
110 uint8_t dbuffer[1024];
#define STATE(_fn)
Turns a function name into an argument to be supplied to functions expecting a state.
virtual void send(MessageType *message, unsigned priority=UINT_MAX)=0
Entry point to the flow.
MessageType * alloc()
Synchronously allocates a message buffer from the pool of this flow.
Collection of related state machines that pend on incoming messages.
Service * service()
Return a pointer to the service I am bound to.
State flow with a given typed input queue.
Base::Action Action
Allows using Action without having StateFlowBase:: prefix in front of it.
void send(MessageType *msg, unsigned priority=UINT_MAX) OVERRIDE
Sends a message to the state flow for processing.
User-space DCC decoding flow.
DccDecoder decoder_
State machine that does the DCC decoding.
Debug flow for the DCC decoder driver.
Sends every incoming DCC packet as a custom OpenLCB message to the OpenLCB bus.
Action entry() override
Entry into the StateFlow activity.
MessageHandler * global_message_write_flow()
MessageDispatchFlow * dispatcher()
Base class for NMRAnet nodes conforming to the asynchronous interface.
DccPacketDebugFlow g_packet_debug_flow
Global reference to the packet debug flow.
MTI
Known Message type indicators.