|
Open Model Railroad Network (OpenMRN)
|
Specialized (DCC protocol) implementation of a DCC extended accessory consumer. More...
#include <DccAccyConsumer.hxx>
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 ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ConsumerIdentified for this event. | |
| virtual void | handle_consumer_range_identified (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ConsumerRangeIdentified. | |
| virtual void | handle_producer_identified (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ProducerIdentified for this event. | |
| virtual void | handle_producer_range_identified (const EventRegistryEntry ®istry_entry, EventReport *event, BarrierNotifiable *done) |
| Called on another node sending ProducerRangeIdentified for this event. | |
| virtual void | handle_identify_producer (const EventRegistryEntry ®istry_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::TrackIf * | track_ |
| 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 ®istry_entry, EventReport *event, BarrierNotifiable *done) OVERRIDE |
| Called on the need of sending out identification messages. | |
| void | handle_event_report (const EventRegistryEntry ®istry_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. | |
| Node * | node_ |
| 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. | |
Specialized (DCC protocol) implementation of a DCC extended accessory consumer.
Definition at line 372 of file DccAccyConsumer.hxx.
|
inline |
Constructs a listener for DCC accessory control.
| node | is the virtual node that will be listening for events and responding to Identify messages. |
| track | is the interface through which we will be writing DCC accessory packets. |
Definition at line 380 of file DccAccyConsumer.hxx.
|
inline |
Destructor.
Definition at line 387 of file DccAccyConsumer.hxx.
|
inlineoverrideprivatevirtual |
Send the actual accessory command.
Implements openlcb::DccExtAccyConsumerBase.
Definition at line 393 of file DccAccyConsumer.hxx.
|
private |
Track to send DCC packets to.
Definition at line 403 of file DccAccyConsumer.hxx.