MDPHeader Class Reference

#include <MDPHeader.hpp>

Inheritance diagram for MDPHeader:

Inheritance graph
[legend]
Collaboration diagram for MDPHeader:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class contains header information for all data types transmitted by receiver meeting the MDP specification.

Definition at line 73 of file MDPHeader.hpp.

Public Member Functions

 MDPHeader () throw ()
bool isValid () const
virtual bool isData () const
 This class is "data" so this function always returns "true".
virtual std::string encode () const throw ()
 Encode this object to a string.
virtual void decode (std::string str) throw ()
 Decode this object from a string.
virtual std::string getName () const
 Simple accessors for various static thangs.
void dump (std::ostream &out) const throw ()
 Dump some debugging information to the given ostream.
void setCRC (std::string &str) const throw (FFStreamError)
 Compute the CRC over the string and set the CRC in that string and in the header.
void checkCRC (std::string str) throw ()
 Checks the crc of the message and set crc_err if it fails.
void readHeader (MDPStream &s) throw (FFStreamError, EndOfFile)
std::string readBody (MDPStream &s) throw (FFStreamError, EndOfFile)

Public Attributes

unsigned short id
 Identifies this data's type.
gpstk::DayTime time
 The time associated with this message.
unsigned short freshnessCount
 A message counter.
unsigned short length
 number of bytes in this message (includes the length of the header)
unsigned short crc
 the 16 bit CCITT crc covering the header and body of the message

Static Public Attributes

const unsigned myLength = 16
 = 16
const unsigned frameWord = 0x9c9c
 = 0x9c9c
int debugLevel = 0
bool hexDump = false

Protected Member Functions

virtual void reallyPutRecord (FFStream &s) const throw (std::exception, StringUtils::StringException, FFStreamError)
 Does the actual writing from the stream into this FFData object.
virtual void reallyGetRecord (FFStream &s) throw (std::exception, StringUtils::StringException, FFStreamError, EndOfFile)
 Does the actual reading from the stream into this FFData object.


Constructor & Destructor Documentation

MDPHeader  )  throw () [inline]
 

Definition at line 76 of file MDPHeader.hpp.


Member Function Documentation

void checkCRC std::string  str  )  throw ()
 

Checks the crc of the message and set crc_err if it fails.

Definition at line 181 of file MDPHeader.cpp.

References gpstk::BinUtils::computeCRC().

Referenced by FFIdentifier::FFIdentifier().

void decode std::string  str  )  throw () [virtual]
 

Decode this object from a string.

Parameters:
str the string to read from.
Note:
Decoded data is *NOT* removed from the string.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 103 of file MDPHeader.cpp.

References gpstk::dump(), and DayTime::setGPSfullweek().

void dump std::ostream &  out  )  const throw () [virtual]
 

Dump some debugging information to the given ostream.

Parameters:
out the ostream to write to

Reimplemented from FFData.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 430 of file MDPHeader.cpp.

Referenced by MDPHeader::reallyGetRecord().

string encode  )  const throw () [virtual]
 

Encode this object to a string.

Returns:
this object as a string.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 75 of file MDPHeader.cpp.

References DayTime::GPSfullweek(), DayTime::GPSsecond(), and MDPHeader::time.

virtual std::string getName  )  const [inline, virtual]
 

Simple accessors for various static thangs.

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 97 of file MDPHeader.hpp.

virtual bool isData void   )  const [inline, virtual]
 

This class is "data" so this function always returns "true".

Reimplemented from FFData.

Definition at line 83 of file MDPHeader.hpp.

bool isValid void   )  const [inline]
 

Definition at line 80 of file MDPHeader.hpp.

string readBody MDPStream s  )  throw (FFStreamError, EndOfFile)
 

Definition at line 311 of file MDPHeader.cpp.

Referenced by FFIdentifier::FFIdentifier().

void readHeader MDPStream s  )  throw (FFStreamError, EndOfFile)
 

Definition at line 243 of file MDPHeader.cpp.

References FFBinaryStream::getData(), MDPStream::header, gpstk::StringUtils::hexDumpData(), gpstk::BinUtils::netToHost(), MDPStream::rawHeader, and MDPStream::streamState.

void reallyGetRecord FFStream s  )  throw (std::exception, StringUtils::StringException, FFStreamError, EndOfFile) [protected, virtual]
 

Does the actual reading from the stream into this FFData object.

Implements FFData.

Definition at line 344 of file MDPHeader.cpp.

References gpstk::dump(), MDPHeader::dump(), MDPStream::header, gpstk::StringUtils::hexDumpData(), MDPHeader::id, MDPHeader::length, MDPStream::rawHeader, FFStream::recordNumber, and MDPStream::streamState.

void reallyPutRecord FFStream s  )  const throw (std::exception, StringUtils::StringException, FFStreamError) [protected, virtual]
 

Does the actual writing from the stream into this FFData object.

Implements FFData.

Definition at line 213 of file MDPHeader.cpp.

References GPSTK_THROW, and gpstk::StringUtils::hexDumpData().

void setCRC std::string &  str  )  const throw (FFStreamError)
 

Compute the CRC over the string and set the CRC in that string and in the header.

Definition at line 153 of file MDPHeader.cpp.

References gpstk::StringUtils::asString(), gpstk::BinUtils::computeCRC(), GPSTK_THROW, and gpstk::BinUtils::hostToNet().


Member Data Documentation

unsigned short crc [mutable]
 

the 16 bit CCITT crc covering the header and body of the message

Definition at line 118 of file MDPHeader.hpp.

int debugLevel = 0 [static]
 

Definition at line 69 of file MDPHeader.cpp.

const unsigned frameWord = 0x9c9c [static]
 

= 0x9c9c

Definition at line 62 of file MDPHeader.cpp.

unsigned short freshnessCount
 

A message counter.

Definition at line 113 of file MDPHeader.hpp.

bool hexDump = false [static]
 

Definition at line 72 of file MDPHeader.cpp.

unsigned short id
 

Identifies this data's type.

Definition at line 111 of file MDPHeader.hpp.

Referenced by MDPHeader::reallyGetRecord().

unsigned short length [mutable]
 

number of bytes in this message (includes the length of the header)

Definition at line 117 of file MDPHeader.hpp.

Referenced by MDPHeader::reallyGetRecord().

const unsigned myLength = 16 [static]
 

= 16

Reimplemented in MDPNavSubframe, MDPObsEpoch, MDPPVTSolution, and MDPSelftestStatus.

Definition at line 61 of file MDPHeader.cpp.

gpstk::DayTime time
 

The time associated with this message.

Definition at line 112 of file MDPHeader.hpp.

Referenced by MDPHeader::encode(), gpstk::makeMDPEpoch(), gpstk::makeMDPObsEpoch(), gpstk::makeMDPPVTSolution(), and gpstk::operator>>().


The documentation for this class was generated from the following files:
Generated on Wed Feb 8 03:31:34 2012 for GPS ToolKit Software Library by  doxygen 1.3.9.1