|
Open Model Railroad Network (OpenMRN)
|
Abstract class for streams of DCC packets. More...
#include <PacketSource.hxx>
Public Member Functions | |
| virtual void | get_next_packet (unsigned code, Packet *packet)=0 |
| Generates the next packet to send out to the track. | |
Public Member Functions inherited from openlcb::TrainImpl | |
| virtual void | set_speed (SpeedType speed)=0 |
| Sets the speed of the locomotive. | |
| virtual SpeedType | get_speed ()=0 |
| virtual SpeedType | get_commanded_speed () |
| virtual SpeedType | get_actual_speed () |
| Returns the actual speed of the locomotive, as provided by feedback from the decoder. | |
| virtual void | set_emergencystop ()=0 |
| Sets the train to emergency stop. | |
| virtual bool | get_emergencystop ()=0 |
| Get the current E-Stop state. | |
| virtual void | set_fn (uint32_t address, uint16_t value)=0 |
| Sets the value of a function. | |
| virtual uint16_t | get_fn (uint32_t address)=0 |
| virtual uint32_t | legacy_address ()=0 |
| virtual dcc::TrainAddressType | legacy_address_type ()=0 |
Abstract class for streams of DCC packets.
there will be typically one object of a child type for every decoder on the track voltage that needs an infinite set of repeating packets. This interface will be polled in a round-robin manner by the UpdateLoopBase.
Definition at line 51 of file PacketSource.hxx.
|
pure virtual |
Generates the next packet to send out to the track.
| code | if 0, then the next background refresh packet shold be generated. If non-zero, then it specifies a train-specific value that tells which recently changed value should be generated. |
| packet | is the storage to set the outgoing packet in. |
Implemented in ProgrammingTrackBackend, dcc::DccTrain< Payload >, dcc::MMOldTrain, and dcc::MMNewTrain.