Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
dcc::RailcomToGpioFlow Class Reference

This flow listens to Railcom packets coming from the hub, and if they are correctly decoded, pulses the given GPIO output. More...

#include <RailcomPortDebug.hxx>

Inheritance diagram for dcc::RailcomToGpioFlow:
FlowInterface< MessageType >

Public Member Functions

 RailcomToGpioFlow (dcc::RailcomHubFlow *source, const Gpio *output)
 Constructor.
 
- Public Member Functions inherited from FlowInterface< MessageType >
virtual Poolpool ()
 
virtual void send (MessageType *message, unsigned priority=UINT_MAX)=0
 Entry point to the flow.
 
virtual MessageType * type_helper ()
 This function is never user in the code, but GDB can use it to infer the correct message types.
 
MessageType * alloc ()
 Synchronously allocates a message buffer from the pool of this flow.
 
void alloc_async (Executable *target)
 Asynchronously allocates a message buffer from the pool of this flow.
 

Private Member Functions

void send (Buffer< dcc::RailcomHubData > *d, unsigned prio) OVERRIDE
 Incoming railcom data.
 

Private Attributes

dcc::RailcomHubFlowparent_
 Flow to which we are registered.
 
const Gpiooutput_
 Output gpio to toggle.
 

Additional Inherited Members

- Public Types inherited from FlowInterface< MessageType >
typedef MessageType message_type
 Stores the message template type for external reference.
 
- Static Public Member Functions inherited from FlowInterface< MessageType >
static MessageType * cast_alloc (QMember *entry)
 Down casts and initializes an asynchronous allocation result to the appropriate flow's buffer type.
 

Detailed Description

This flow listens to Railcom packets coming from the hub, and if they are correctly decoded, pulses the given GPIO output.

Correctly decoded is defined as having every single byte be a correct 4/8 codepoint.

Definition at line 136 of file RailcomPortDebug.hxx.

Constructor & Destructor Documentation

◆ RailcomToGpioFlow()

dcc::RailcomToGpioFlow::RailcomToGpioFlow ( dcc::RailcomHubFlow source,
const Gpio output 
)
inline

Constructor.

Parameters
sourceis the railcom hub to listen to.
output

Definition at line 142 of file RailcomPortDebug.hxx.

◆ ~RailcomToGpioFlow()

dcc::RailcomToGpioFlow::~RailcomToGpioFlow ( )
inline

Definition at line 149 of file RailcomPortDebug.hxx.

Member Function Documentation

◆ send()

void dcc::RailcomToGpioFlow::send ( Buffer< dcc::RailcomHubData > *  d,
unsigned  prio 
)
inlineprivate

Incoming railcom data.

Parameters
drailcom buffer.
priopriority

Definition at line 159 of file RailcomPortDebug.hxx.

Member Data Documentation

◆ output_

const Gpio* dcc::RailcomToGpioFlow::output_
private

Output gpio to toggle.

Definition at line 196 of file RailcomPortDebug.hxx.

◆ parent_

dcc::RailcomHubFlow* dcc::RailcomToGpioFlow::parent_
private

Flow to which we are registered.

Definition at line 194 of file RailcomPortDebug.hxx.


The documentation for this class was generated from the following file: