Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
RailCom.hxx File Reference
#include <cstdint>
#include <string>
#include <vector>
#include "dcc/railcom.h"

Go to the source code of this file.

Classes

struct  dcc::Feedback
 Structure used for reading (railcom) feedback data from DCC / Railcom device drivers. More...
 
struct  dcc::RailcomDefs
 Special constant values returned by the railcom_decode[] array. More...
 
struct  dcc::RailcomPacket
 Represents a single Railcom datagram. More...
 

Enumerations

enum  dcc::RailcomMobilePacketId {
  RMOB_POM = 0 , RMOB_ADRHIGH = 1 , RMOB_ADRLOW = 2 , RMOB_EXT = 3 ,
  RMOB_DYN = 7 , RMOB_XPOM0 = 8 , RMOB_XPOM1 = 9 , RMOB_XPOM2 = 10 ,
  RMOB_XPOM3 = 11 , RMOB_SUBID = 12 , RMOB_LOGON_ASSIGN_FEEDBACK = 13 , RMOB_LOGON_ENABLE_FEEDBACK = 15
}
 Packet identifiers from Mobile Decoders. More...
 

Functions

std::string dcc::railcom_debug (const Feedback &fb)
 Formats a dcc::Feedback message into a debug string.
 
void dcc::parse_railcom_data (const dcc::Feedback &fb, std::vector< struct RailcomPacket > *output)
 Interprets the data from a railcom feedback.
 

Detailed Description

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

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.

Helper functions and tables for RailCom implementations.

Author
Balazs Racz
Date
12 Nov 2014

Definition in file RailCom.hxx.

Enumeration Type Documentation

◆ RailcomMobilePacketId

Packet identifiers from Mobile Decoders.

Definition at line 195 of file RailCom.hxx.

Function Documentation

◆ parse_railcom_data()

void dcc::parse_railcom_data ( const dcc::Feedback fb,
std::vector< struct RailcomPacket > *  output 
)

Interprets the data from a railcom feedback.

If the railcom data contains error, will add a packet of type "GARBAGE" into the output list. Clears the output list before fillign with the railcom data.

Definition at line 267 of file RailCom.cxx.

◆ railcom_debug()

string dcc::railcom_debug ( const Feedback fb)

Formats a dcc::Feedback message into a debug string.

Definition at line 41 of file RailcomDebug.cxx.