Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
ProgrammingTrackRequest Struct Reference
Inheritance diagram for ProgrammingTrackRequest:
CallableFlowRequestBase

Public Types

enum  EnterServiceMode { ENTER_SERVICE_MODE }
 
enum  ExitServiceMode { EXIT_SERVICE_MODE }
 
enum  SendReset { SEND_RESET }
 
enum  SendProgrammingPacket { SEND_PROGRAMMING_PACKET }
 
enum class  Type { ENTER_SERVICE_MODE , EXIT_SERVICE_MODE , SEND_RESET , SEND_SERVICE_PACKET }
 

Public Member Functions

void reset (EnterServiceMode)
 Set up command to enter service mode.
 
void reset (ExitServiceMode)
 Set up command to exit service mode.
 
void reset (SendReset, unsigned count)
 Set up command to send some number of reset packets.
 
void reset (SendProgrammingPacket, dcc::Packet pkt, unsigned count, bool terminate_on_ack=true)
 Set up command to send some number of service mode packets, waiting for an acknowledgement.
 
- Public Member Functions inherited from CallableFlowRequestBase
void reset_base ()
 Call this from all instances of reset(...).
 

Public Attributes

Type cmd_
 What is the instruction to do.
 
dcc::Packet packetToSend_
 This packet will be repeated on the programming track for SEND_SERVICE_PACKET.
 
unsigned repeatCount_: 16
 How many times maximum to repeat the packet before timing out on no acknowledgement, or how many reset packets to send.
 
unsigned terminateOnAck_: 1
 Should we short-cut sending the packet repetitions when we've seen an ack.
 
unsigned hasAck_: 1
 Output arguments. These are filled by the flow upon return.
 
unsigned hasShortCircuit_: 1
 Set to 1 if the programming track has reached the current limit.
 
- Public Attributes inherited from CallableFlowRequestBase
int resultCode
 If high bits are zero, this is a 16-bit OpenLCB result code.
 
BarrierNotifiable done
 Used internally by the invoke_subflow mechanism of StateFlow to notify the calling flow upon completion.
 

Private Member Functions

void reset_base ()
 Resets all internal variables to default state.
 

Detailed Description

Definition at line 56 of file ProgrammingTrackBackend.hxx.

Member Enumeration Documentation

◆ EnterServiceMode

enum ProgrammingTrackRequest::EnterServiceMode

Definition at line 58 of file ProgrammingTrackBackend.hxx.

◆ ExitServiceMode

enum ProgrammingTrackRequest::ExitServiceMode

Definition at line 63 of file ProgrammingTrackBackend.hxx.

◆ SendProgrammingPacket

enum ProgrammingTrackRequest::SendProgrammingPacket

Definition at line 73 of file ProgrammingTrackBackend.hxx.

◆ SendReset

enum ProgrammingTrackRequest::SendReset

Definition at line 68 of file ProgrammingTrackBackend.hxx.

◆ Type

enum class ProgrammingTrackRequest::Type
strong
Enumerator
ENTER_SERVICE_MODE 

Switch from normal mode to service mode.

EXIT_SERVICE_MODE 

Switch from service mode back to normal operations mode.

SEND_RESET 

Send some number of reset commands.

SEND_SERVICE_PACKET 

Send a specific service mode DCC packet.

Definition at line 119 of file ProgrammingTrackBackend.hxx.

Member Function Documentation

◆ reset() [1/4]

void ProgrammingTrackRequest::reset ( EnterServiceMode  )
inline

Set up command to enter service mode.

Definition at line 79 of file ProgrammingTrackBackend.hxx.

◆ reset() [2/4]

void ProgrammingTrackRequest::reset ( ExitServiceMode  )
inline

Set up command to exit service mode.

Definition at line 86 of file ProgrammingTrackBackend.hxx.

◆ reset() [3/4]

void ProgrammingTrackRequest::reset ( SendProgrammingPacket  ,
dcc::Packet  pkt,
unsigned  count,
bool  terminate_on_ack = true 
)
inline

Set up command to send some number of service mode packets, waiting for an acknowledgement.

Parameters
pktthe DCC packet to send
countnumber of times to send the DCC packet. This determines how long we are waiting for an acknowledgement.
terminate_on_ackif true, will stop sending the packet when a service mode acknowledgement is detected instead of going all the way to count repetitions.

Definition at line 109 of file ProgrammingTrackBackend.hxx.

◆ reset() [4/4]

void ProgrammingTrackRequest::reset ( SendReset  ,
unsigned  count 
)
inline

Set up command to send some number of reset packets.

Parameters
countnumber of reset packets to send.

Definition at line 94 of file ProgrammingTrackBackend.hxx.

◆ reset_base()

void ProgrammingTrackRequest::reset_base ( )
inlineprivate

Resets all internal variables to default state.

Call at the beginning of all reset(...) functions.

Definition at line 157 of file ProgrammingTrackBackend.hxx.

Member Data Documentation

◆ cmd_

Type ProgrammingTrackRequest::cmd_

What is the instruction to do.

Definition at line 132 of file ProgrammingTrackBackend.hxx.

◆ hasAck_

unsigned ProgrammingTrackRequest::hasAck_

Output arguments. These are filled by the flow upon return.

Definition at line 147 of file ProgrammingTrackBackend.hxx.

◆ hasShortCircuit_

unsigned ProgrammingTrackRequest::hasShortCircuit_

Set to 1 if the programming track has reached the current limit.

Todo:
(balazs.racz) we need to figure out how to recover from a program track short.

Definition at line 152 of file ProgrammingTrackBackend.hxx.

◆ packetToSend_

dcc::Packet ProgrammingTrackRequest::packetToSend_

This packet will be repeated on the programming track for SEND_SERVICE_PACKET.

Definition at line 136 of file ProgrammingTrackBackend.hxx.

◆ repeatCount_

unsigned ProgrammingTrackRequest::repeatCount_

How many times maximum to repeat the packet before timing out on no acknowledgement, or how many reset packets to send.

Definition at line 140 of file ProgrammingTrackBackend.hxx.

◆ terminateOnAck_

unsigned ProgrammingTrackRequest::terminateOnAck_

Should we short-cut sending the packet repetitions when we've seen an ack.

If 1, returns immediately upon seeing the ack.

Definition at line 144 of file ProgrammingTrackBackend.hxx.


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