Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
openlcb::DccExtAccyConsumer Class Reference

Specialized (DCC protocol) implementation of a DCC extended accessory consumer. More...

#include <DccAccyConsumer.hxx>

Inheritance diagram for openlcb::DccExtAccyConsumer:
openlcb::DccExtAccyConsumerBase openlcb::SimpleEventHandler openlcb::EventHandler

Public Member Functions

 DccExtAccyConsumer (Node *node, dcc::TrackIf *track)
 Constructs a listener for DCC accessory control.
 
 ~DccExtAccyConsumer ()
 Destructor.
 
- Public Member Functions inherited from openlcb::SimpleEventHandler
 IGNOREFN (handle_event_report)
 
 IGNOREFN (handle_consumer_identified)
 
 IGNOREFN (handle_consumer_range_identified)
 
 IGNOREFN (handle_producer_identified)
 
 IGNOREFN (handle_producer_range_identified)
 
 IGNOREFN (handle_identify_consumer)
 
 IGNOREFN (handle_identify_producer)
 
- Public Member Functions inherited from openlcb::EventHandler
virtual void handle_consumer_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ConsumerIdentified for this event.
 
virtual void handle_consumer_range_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ConsumerRangeIdentified.
 
virtual void handle_producer_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ProducerIdentified for this event.
 
virtual void handle_producer_range_identified (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)
 Called on another node sending ProducerRangeIdentified for this event.
 
virtual void handle_identify_producer (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done)=0
 Called on another node sending IdentifyProducer.
 

Private Member Functions

void send_accy_command () override
 Send the actual accessory command.
 

Private Attributes

dcc::TrackIftrack_
 Track to send DCC packets to.
 

Additional Inherited Members

- Public Types inherited from openlcb::EventHandler
using EventReport = openlcb::EventReport
 
using EventRegistryEntry = openlcb::EventRegistryEntry
 
using EventId = openlcb::EventId
 
- Protected Member Functions inherited from openlcb::DccExtAccyConsumerBase
 DccExtAccyConsumerBase (Node *node)
 Constructs a listener for DCC extended accessory control.
 
 ~DccExtAccyConsumerBase ()
 Destructor.
 
void handle_identify_global (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done) OVERRIDE
 Called on the need of sending out identification messages.
 
void handle_event_report (const EventRegistryEntry &registry_entry, EventReport *event, BarrierNotifiable *done) override
 Called on incoming EventReport messages.
 
void handle_identify_consumer (const EventRegistryEntry &entry, EventReport *event, BarrierNotifiable *done) override
 Called on another node sending IdentifyConsumer.
 
bool parse_event (EventId event)
 Parses an event into an openlcb accessory offset.
 
- Protected Attributes inherited from openlcb::DccExtAccyConsumerBase
unsigned dccAddress_: 11
 Parsed event state: dcc address (0..2047) without inverting or encoding.
 
unsigned aspect_: 8
 Parsed event state: the aspect commanded.
 
Nodenode_
 OpenLCB node to export the consumer on.
 
- Static Protected Attributes inherited from openlcb::DccExtAccyConsumerBase
static constexpr unsigned NUM_ADDRESS = 2048
 How may addresses are there for extended accessories.
 
static constexpr unsigned NUM_ASPECT = 256
 How may aspects are supported per accessory.
 
static constexpr unsigned NUM_EVENT = NUM_ASPECT * NUM_ADDRESS
 Total number of events we are listening for.
 

Detailed Description

Specialized (DCC protocol) implementation of a DCC extended accessory consumer.

Definition at line 372 of file DccAccyConsumer.hxx.

Constructor & Destructor Documentation

◆ DccExtAccyConsumer()

openlcb::DccExtAccyConsumer::DccExtAccyConsumer ( Node node,
dcc::TrackIf track 
)
inline

Constructs a listener for DCC accessory control.

Parameters
nodeis the virtual node that will be listening for events and responding to Identify messages.
trackis the interface through which we will be writing DCC accessory packets.

Definition at line 380 of file DccAccyConsumer.hxx.

◆ ~DccExtAccyConsumer()

openlcb::DccExtAccyConsumer::~DccExtAccyConsumer ( )
inline

Destructor.

Definition at line 387 of file DccAccyConsumer.hxx.

Member Function Documentation

◆ send_accy_command()

void openlcb::DccExtAccyConsumer::send_accy_command ( )
inlineoverrideprivatevirtual

Send the actual accessory command.

Implements openlcb::DccExtAccyConsumerBase.

Definition at line 393 of file DccAccyConsumer.hxx.

Member Data Documentation

◆ track_

dcc::TrackIf* openlcb::DccExtAccyConsumer::track_
private

Track to send DCC packets to.

Definition at line 403 of file DccAccyConsumer.hxx.


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