Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Defs.hxx File Reference
#include <string>
#include "openlcb/TractionThrottle.hxx"

Go to the source code of this file.

Classes

struct  withrottle::LocoAddress
 Locomotive address. More...
 
struct  withrottle::RosterEntry
 Roster entry item. More...
 
class  withrottle::ThrottleCommand
 Command from the throttle. More...
 
struct  withrottle::Defs
 The interface definitions for WiThrottle. More...
 

Enumerations

enum  withrottle::CommandType {
  withrottle::PRIMARY = 'T' , withrottle::SECONDARY = 'S' , withrottle::MULTI = 'M' , withrottle::HEX_PACKET = 'D' ,
  withrottle::HEARTBEAT = '*' , withrottle::SET_NAME = 'N' , withrottle::SET_ID = 'H' , withrottle::PANEL = 'P' ,
  withrottle::ROSTER = 'R' , withrottle::QUIT = 'Q' , withrottle::TYPE_MASK = 0xFF
}
 type of command. More...
 
enum  withrottle::CommandMultiType { withrottle::ACTION = 'A' , withrottle::ADD = '+' , withrottle::REMOVE = '-' }
 type of multi throttle command. More...
 
enum  withrottle::CommandSubType {
  withrottle::VELOCITY = 'V' , withrottle::ESTOP = 'X' , withrottle::FUNCTION = 'F' , withrottle::FORCE = 'f' ,
  withrottle::DIRECTION = 'R' , withrottle::RELEASE = 'r' , withrottle::DISPATCH = 'd' , withrottle::ADDR_LONG = 'L' ,
  withrottle::ADDR_SHORT = 'S' , withrottle::ADDR_ROSTER = 'E' , withrottle::CONSIST = 'C' , withrottle::CONSIST_LEAD = 'c' ,
  withrottle::IDLE = 'I' , withrottle::SS_MODE = 's' , withrottle::MOMENTARY = 'm' , withrottle::QUERY = 'q' ,
  withrottle::SUBTYPE_MASK = 0xFF
}
 type of throttle command. More...
 
enum  withrottle::ServerState {
  withrottle::STATE_COMMAND = 0 , withrottle::STATE_MULTI_TYPE , withrottle::STATE_TRAIN , withrottle::STATE_SUBCOMMAND ,
  withrottle::STATE_PAYLOAD , withrottle::STATE_NEXT
}
 Server state machine commands. More...
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are strictly prohibited without written consent.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This file provides basic WiThrottle definitions.

Author
Stuart Baker
Date
17 December 2016

Definition in file withrottle/Defs.hxx.

Enumeration Type Documentation

◆ CommandMultiType

type of multi throttle command.

Enumerator
ACTION 

pefrom an action

ADD 

Add a locomotive to the throttle.

REMOVE 

remove a locomotive from the throttle

Definition at line 73 of file withrottle/Defs.hxx.

◆ CommandSubType

type of throttle command.

Enumerator
VELOCITY 

velocity command

ESTOP 

emergency stop

FUNCTION 

function key

FORCE 

force function

DIRECTION 

set direction

RELEASE 

release a loco

DISPATCH 

dispatch a loco

ADDR_LONG 

set long address

ADDR_SHORT 

set short address

ADDR_ROSTER 

set address from roster entry

CONSIST 

consist

CONSIST_LEAD 

consist lead from roster entry

IDLE 

idle, set speed to 0

SS_MODE 

set speed step mode

MOMENTARY 

momentary

QUERY 

query about current speed, direction, etc...

SUBTYPE_MASK 

exact mask for dispatcher

Definition at line 82 of file withrottle/Defs.hxx.

◆ CommandType

type of command.

Enumerator
PRIMARY 

primary throttle

SECONDARY 

secondary throttle

MULTI 

multi throttle

HEX_PACKET 

hex packet for command station

HEARTBEAT 

send hardbeat or set heartbeat on/off

SET_NAME 

set the device name

SET_ID 

set the device id

PANEL 

send panel command

ROSTER 

send roster command

QUIT 

device has quit

TYPE_MASK 

exact mask for dispatcher

Definition at line 56 of file withrottle/Defs.hxx.

◆ ServerState

Server state machine commands.

Enumerator
STATE_COMMAND 

look for command

STATE_MULTI_TYPE 

look for the multi-throttle type

STATE_TRAIN 

look for the train

STATE_SUBCOMMAND 

look for sub-command

STATE_PAYLOAD 

look for data

STATE_NEXT 

look for next command

Definition at line 126 of file withrottle/Defs.hxx.