Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
CanIf Class Reference

Interface class for CANbus-based protocols. More...

#include <CanIf.hxx>

Inheritance diagram for CanIf:
openlcb::IfCan

Public Types

typedef DispatchFlow< Buffer< CanMessageData >, 4 > FrameDispatchFlow
 Type of the dispatcher responsible for routing incoming frames to the frome handlers.
 

Public Member Functions

 CanIf (Service *service, CanHubFlow *device)
 Constructor.
 
Serviceservice ()
 
FrameDispatchFlowframe_dispatcher ()
 
OutgoingFrameHandlerframe_write_flow ()
 
OutgoingFrameHandlerloopback_frame_write_flow ()
 

Private Member Functions

CanHubPortInterfacehub_port ()
 
CanHubFlowdevice ()
 

Private Attributes

CanHubFlowdevice_
 The device we need to send packets to.
 
CanFrameWriteFlow frameWriteFlow_
 Flow responsible for writing packets to the CAN hub.
 
CanFrameReadFlow frameReadFlow_
 Flow responsible for translating from CAN hub packets to dispatcher packets.
 
FrameDispatchFlow frameDispatcher_
 Flow responsible for routing incoming messages to handlers.
 

Friends

class CanFrameWriteFlow
 

Detailed Description

Interface class for CANbus-based protocols.

Contains a dispatcher for incoming CANbus messages, and a queue for outgoing messages.

Definition at line 184 of file CanIf.hxx.

Member Typedef Documentation

◆ FrameDispatchFlow

Type of the dispatcher responsible for routing incoming frames to the frome handlers.

Definition at line 199 of file CanIf.hxx.

Constructor & Destructor Documentation

◆ CanIf()

CanIf::CanIf ( Service service,
CanHubFlow device 
)

Constructor.

Parameters
servicespecifies which thread the flows of this service should be executing.
devicethe Can frame hub that the hardware device is connected to.

Definition at line 89 of file CanIf.cxx.

◆ ~CanIf()

CanIf::~CanIf ( )

Definition at line 97 of file CanIf.cxx.

Member Function Documentation

◆ device()

CanHubFlow * CanIf::device ( )
inlineprivate
Returns
the device (hub) that we need to send the packets to.

Definition at line 249 of file CanIf.hxx.

◆ frame_dispatcher()

FrameDispatchFlow * CanIf::frame_dispatcher ( )
inline
Returns
the dispatcher of incoming CAN frames.

Definition at line 208 of file CanIf.hxx.

◆ frame_write_flow()

OutgoingFrameHandler * CanIf::frame_write_flow ( )
inline
Returns
the flow for writing CAN frames to the bus.

Definition at line 214 of file CanIf.hxx.

◆ hub_port()

CanHubPortInterface * CanIf::hub_port ( )
inlineprivate
Returns
the asynchronous read/write object.

Definition at line 244 of file CanIf.hxx.

◆ loopback_frame_write_flow()

OutgoingFrameHandler * CanIf::loopback_frame_write_flow ( )
inline
Returns
the flow for writing CAN frames for localhost (as if they came from the bus).

Definition at line 221 of file CanIf.hxx.

◆ service()

Service * CanIf::service ( )
inline
Returns
the pointer to the service defining which thread to run on.

Definition at line 202 of file CanIf.hxx.

Friends And Related Symbol Documentation

◆ CanFrameWriteFlow

friend class CanFrameWriteFlow
friend

Definition at line 227 of file CanIf.hxx.

Member Data Documentation

◆ device_

CanHubFlow* CanIf::device_
private

The device we need to send packets to.

Definition at line 231 of file CanIf.hxx.

◆ frameDispatcher_

FrameDispatchFlow CanIf::frameDispatcher_
private

Flow responsible for routing incoming messages to handlers.

Definition at line 241 of file CanIf.hxx.

◆ frameReadFlow_

CanFrameReadFlow CanIf::frameReadFlow_
private

Flow responsible for translating from CAN hub packets to dispatcher packets.

Definition at line 238 of file CanIf.hxx.

◆ frameWriteFlow_

CanFrameWriteFlow CanIf::frameWriteFlow_
private

Flow responsible for writing packets to the CAN hub.

Definition at line 234 of file CanIf.hxx.


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