nidas  v1.2-1520
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
nidas::dynld::isff::SE_GOESXmtr Class Referenceabstract

An IOChannel implementation for a Signal Engineering GOES transmitter. More...

#include <SE_GOESXmtr.h>

Inheritance diagram for nidas::dynld::isff::SE_GOESXmtr:
Inheritance graph
[legend]

Classes

struct  SE_Codes
 
struct  selfTest
 

Public Member Functions

 SE_GOESXmtr ()
 Constructor. More...
 
 SE_GOESXmtr (const SE_GOESXmtr &)
 Copy constructor. More...
 
 ~SE_GOESXmtr ()
 Destructor. More...
 
SE_GOESXmtrclone () const
 Clone invokes default copy constructor. More...
 
void setRFBaud (long val) throw (nidas::util::InvalidParameterException)
 Set the RF baud rate. More...
 
int getRFBaud () const
 
void init () throw (nidas::util::IOException)
 Initialize tranmitter. More...
 
int getModel () const
 Return the model number of the transmitter. More...
 
void setModel (int val)
 
int getMaxRFBaud () const
 Get the maximum RF baud rate supported by the transmitter. More...
 
virtual bool isNewFile () const
 
void transmitData (const nidas::util::UTime &sendTime, int configid, const Sample *) throw (nidas::util::IOException)
 Queue a sample for writing to a GOES transmitter. More...
 
void transmitDataSE110 (const nidas::util::UTime &sendTime, int configid, const Sample *) throw (nidas::util::IOException)
 Queue a sample for writing to a GOES transmitter. More...
 
void transmitDataSE120 (const nidas::util::UTime &sendTime, int configid, const Sample *) throw (nidas::util::IOException)
 
void close () throw (nidas::util::IOException)
 
size_t send (const std::string &msg) throw (nidas::util::IOException)
 Sent a message to the GOES transmitter. More...
 
size_t send (char c) throw (nidas::util::IOException)
 A one-byte message, containing only the type. More...
 
std::string recv () throw (nidas::util::IOException)
 Receive a message from the transmitter. More...
 
void flush () throw (nidas::util::IOException)
 Default flush implementation does nothing. More...
 
void encodeClock (const nidas::util::UTime &ut, char *out, bool fractsecs)
 
nidas::util::UTime decodeClock (const char *in)
 
void wakeup () throw (nidas::util::IOException)
 Raise RTS to wake up transmitter. More...
 
void tosleep () throw (nidas::util::IOException)
 Lower RTS to put transmitter to sleep. More...
 
void query () throw (nidas::util::IOException)
 Query the GOES Transmitter. More...
 
int detectModel () throw (nidas::util::IOException)
 
bool testTransmitSE120 () throw (nidas::util::IOException)
 
void cancelTransmit (const nidas::util::UTime &at) throw (nidas::util::IOException)
 
int checkStatus () throw (nidas::util::IOException)
 Queries the transmitter for status information. More...
 
void printStatus () throw ()
 Request that transmitter status be printed to an output stream. More...
 
void printStatus (std::ostream &) throw ()
 
void setXmtrId () throw (nidas::util::IOException)
 
unsigned long getXmtrId () throw (nidas::util::IOException)
 
void setXmtrClock () throw (nidas::util::IOException)
 
nidas::util::UTime getXmtrClock () throw (nidas::util::IOException)
 
int getXmtrClockDelay (int nchar) const
 Get the transmission delay of the transmitter clock. More...
 
unsigned long checkId () throw (nidas::util::IOException)
 
int checkClock () throw (nidas::util::IOException)
 Check transmitter clock, and correct it if necessary. More...
 
void transmitDataSE110 () throw (nidas::util::IOException)
 
void reset () throw (nidas::util::IOException)
 
void doSelfTest () throw (nidas::util::IOException)
 
int getSelfTestResults () throw (nidas::util::IOException)
 Fetch self test results. More...
 
void checkResponse (char ptype, const std::string &resp) throw (nidas::util::IOException)
 Check response string. More...
 
void checkACKResponse (char ptype, const std::string &resp, char seqnum) throw (nidas::util::IOException)
 Check response to SE110 Transmit Data packet. More...
 
void getBatteryVoltages (float &current, float &before, float &during) throw (nidas::util::IOException)
 Send Get Status command to SE model 1200 to query the battery voltates. More...
 
std::string getSelfTestStatusString ()
 
const std::string & getName () const
 
void setName (const std::string &val)
 
void setId (unsigned long val)
 
unsigned long getId () const
 
void setChannel (int val)
 
int getChannel () const
 
void setXmitInterval (long val)
 Set the transmission interval. More...
 
int getXmitInterval () const
 
void setXmitOffset (long val)
 Set the transmission offset. More...
 
int getXmitOffset () const
 
void requestConnection (IOChannelRequester *rqstr) throw (nidas::util::IOException)
 Request a connection. More...
 
IOChannelconnect () throw (nidas::util::IOException)
 Establish a connection. More...
 
void setNonBlocking (bool val __attribute__((unused))) throw (nidas::util::IOException)
 
virtual void setNonBlocking (bool val)=0 throw (nidas::util::IOException)
 
bool isNonBlocking () const throw (nidas::util::IOException)
 
virtual void open () throw (nidas::util::IOException)
 
int getFd () const
 
void setStatusFile (const std::string &val)
 
const std::string & getStatusFile () const
 
void fromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
virtual void setRequestType (enum McSocketRequest)
 
virtual enum McSocketRequest getRequestType () const
 
virtual bool isNewInput () const
 Some IOChannels, namely FileSet, which opens successive files, need to indicate when a read is from the start of a new file. More...
 
virtual int getReconnectDelaySecs () const
 
virtual const ConnectionInfogetConnectionInfo () const
 What is the IP address of the host at the other end of the connection. More...
 
virtual void setConnectionInfo (const ConnectionInfo &val)
 
virtual size_t getBufferSize () const throw ()
 Return suggested buffer length. More...
 
virtual dsm_time_t createFile (dsm_time_t t, bool exact)
 Request that an IOChannel open a new file, with a name based on a time. More...
 
virtual bool writeNidasHeader () const
 Should the NIDAS header be written to this IOChannel? NIDAS headers are not written to DatagramSockets, because there is no guarantee they will get there. More...
 
virtual void setDSMConfig (const DSMConfig *val)
 What DSM is this IOChannel connected to? More...
 
virtual const DSMConfiggetDSMConfig () const
 What DSM is this IOChannel connected to? May be NULL. More...
 
virtual xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException)
 Create a DOMElement and append it to the parent. More...
 
virtual xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException)
 Add my content into a DOMElement. More...
 

Static Public Member Functions

static std::string fix (const std::string &msg)
 Fix a string for transmission to a SE GOES transmitter. More...
 
static std::string unfix (const std::string &msg)
 Unfix a string that was read from a SE GOES transmitter, looking for. More...
 
static char crc (const std::string &msg)
 Compute a CRC for the message. More...
 
static std::string codeString (char pktType)
 
static IOChannelcreateIOChannel (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 
static const XMLCh * getNamespaceURI ()
 

Static Public Attributes

static const char SOH = '\x1'
 Byte at beginning of each message sent to or received from transmitter. More...
 
static const char EOT = '\x4'
 Byte at end of each message sent to or received from transmitter. More...
 
static const std::string SOH_STR = string(1,SOH)
 
static const char PKT_GET_ID = '\x10'
 Get the transmitter's id. More...
 
static const char PKT_SET_ID = '\x11'
 Sets Transmitter id in either ram or eeprom. More...
 
static const char PKT_SET_TIME = '\x13'
 Load Transmitter time-of-day. More...
 
static const char PKT_GET_TIME = '\x14'
 Get Transmitter time-of-day. More...
 
static const char PKT_XMT_DATA = '\x15'
 Transmit data, SE110 only. More...
 
static const char PKT_CANCEL_XMT = '\x16'
 Cancel transmission. More...
 
static const char PKT_GET_XMT_QUE = '\x17'
 
static const char PKT_QUERY = '\x18'
 
static const char PKT_SET_GLOBALS = '\x1b'
 SE110. More...
 
static const char PKT_GET_GLOBALS = '\x1c'
 SE110. More...
 
static const char PKT_DISPLAY_VERSION = '\x1d'
 Display version information, SE120, SE1200. More...
 
static const char PKT_XMT_DATA_SE120 = '\x1e'
 Transmit, SE120, SE1200. More...
 
static const char PKT_POLL_ENABLE = 0x38
 
static const char PKT_POLL_DATA_GET = 0x39
 
static const char PKT_POLL_DATA_SET = 0x3a
 
static const char PKT_GET_SE1200_STATUS = '\x74'
 SE1200 Only, grabs status info. More...
 
static const char PKT_RESET_XMTR = '\x76'
 
static const char PKT_SELFTEST_DISPL = '\x77'
 
static const char PKT_SELFTEST_START = '\x78'
 
static const char PKT_SEND_FIXED_CHAN = '\x7a'
 
static const char PKT_SOFTWARE_LOAD = '\x7c'
 SE120, SE1200. More...
 
static const char PKT_ACKNOWLEDGE = '\x80'
 
static const char PKT_ERR_RESPONSE = '\xf0'
 Xmtr detected an error in msg it rcvd. More...
 
static struct SE_Codes cmdCodes []
 
static const char PKT_STATUS_OK = 0
 
static const char PKT_STATUS_ILLEGAL_REQUEST = 0x01
 
static const char PKT_STATUS_ITEM_NOT_FOUND = 0x03
 
static const char PKT_STATUS_INVALID_DATE_TIME = 0x04
 
static const char PKT_STATUS_TRANSMIT_OVERLAP = 0x05
 
static const char PKT_STATUS_INVALID_CHANNEL = 0x06
 
static const char PKT_STATUS_INVALID_TRANSMIT_INTERVAL = 0x07
 
static const char PKT_STATUS_EEPROM_NOT_UPDATED = 0x08
 
static const char PKT_STATUS_INVALID_REPEAT_COUNT = 0x09
 
static const char PKT_STATUS_CLOCK_NOT_LOADED = 0x0a
 
static const char PKT_STATUS_CRC_ERROR_ON_LOAD = 0x0b
 
static const char * statusCodeStrings []
 
static const char ERR_TOOLONG = 0x01
 
static const char ERR_TOOSHORT = 0x02
 
static const char ERR_CRC = 0x03
 
static const char ERR_BADTYPE = 0x04
 
static const char ERR_BADLEN = 0x05
 
static const char ERR_MEMORY = 0x06
 
static const char ERR_SEQUENCE = 0x07
 
static const char ERR_TIMEOUT = 0x08
 
static const char * errorCodeStrings []
 
static struct
nidas::dynld::isff::SE_GOESXmtr::selfTest 
selfTestCodes [2][10]
 

Protected Attributes

nidas::util::SerialPort _port
 

Private Member Functions

size_t read (void *buf, size_t len) throw (nidas::util::IOException)
 Read a message, up to the EOT, from the serial port. More...
 
size_t write (const void *buf, size_t len) throw (nidas::util::IOException)
 Write a message to the serial port. More...
 
size_t write (const struct iovec *iov, int iovcnt) throw (nidas::util::IOException)
 Physical write method which must be implemented in derived classes. More...
 
SE_GOESXmtroperator= (const SE_GOESXmtr &)
 No assignment. More...
 

Private Attributes

int _model
 
int _clockDiffMsecs
 Most recent value for GOES clock difference: GOES clock - system clock. More...
 
nidas::util::UTime _transmitQueueTime
 
nidas::util::UTime _transmitAtTime
 
nidas::util::UTime _transmitSampleTime
 
std::string _lastXmitStatus
 
std::string _softwareBuildDate
 
short _selfTestStatus
 
int _maxRFBaud
 
bool _gpsInstalled
 
size_t _xmitNbytes
 
unsigned long _activeId
 Actual id read from transmitter. More...
 
int _rfBaud
 

Static Private Attributes

static const
nidas::util::EndianConverter
_fromBig
 

Detailed Description

An IOChannel implementation for a Signal Engineering GOES transmitter.

Constructor & Destructor Documentation

SE_GOESXmtr::SE_GOESXmtr ( )
SE_GOESXmtr::SE_GOESXmtr ( const SE_GOESXmtr x)
SE_GOESXmtr::~SE_GOESXmtr ( )

Destructor.

Member Function Documentation

void SE_GOESXmtr::cancelTransmit ( const nidas::util::UTime at)
throw (nidas::util::IOException
)
void SE_GOESXmtr::checkACKResponse ( char  ptype,
const std::string &  resp,
char  seqnum 
)
throw (nidas::util::IOException
)

Check response to SE110 Transmit Data packet.

If status is not OK, put the transmitter toSleep(), and throw IOException. toSleep() is not done if an exception is not thrown.

int SE_GOESXmtr::checkClock ( )
throw (nidas::util::IOException
)
virtual

Check transmitter clock, and correct it if necessary.

Returns
transmitter clock minus system clock, in milliseconds.

Implements nidas::dynld::isff::GOESXmtr.

References _clockDiffMsecs, _gpsInstalled, nidas::dynld::isff::GOESXmtr::getName(), nidas::dynld::isff::GOESException::getStatus(), getXmtrClock(), getXmtrClockDelay(), PKT_STATUS_CLOCK_NOT_LOADED, setXmtrClock(), USECS_PER_MSEC, USECS_PER_SEC, and WLOG.

Referenced by detectModel(), and init().

unsigned long SE_GOESXmtr::checkId ( )
throw (nidas::util::IOException
)
virtual
void SE_GOESXmtr::checkResponse ( char  ptype,
const std::string &  resp 
)
throw (nidas::util::IOException
)

Check response string.

If status is not OK, put the transmitter toSleep(), and throw IOException. toSleep() is not done if an exception is not thrown.

Referenced by checkStatus(), doSelfTest(), getSelfTestResults(), getXmtrClock(), getXmtrId(), query(), reset(), setXmtrClock(), setXmtrId(), and testTransmitSE120().

int SE_GOESXmtr::checkStatus ( )
throw (nidas::util::IOException
)

Queries the transmitter for status information.

Returns a preliminary guess at the model number, which may be wrong. Use detectModel() for a more complete check of the model number.

References _softwareBuildDate, checkResponse(), ERR_BADTYPE, nidas::dynld::isff::GOESXmtr::getName(), getSelfTestResults(), nidas::dynld::isff::GOESException::getStatus(), ILOG, PKT_DISPLAY_VERSION, recv(), send(), and wakeup().

Referenced by detectModel().

SE_GOESXmtr* nidas::dynld::isff::SE_GOESXmtr::clone ( ) const
inlinevirtual

Clone invokes default copy constructor.

Implements nidas::core::IOChannel.

void nidas::dynld::isff::SE_GOESXmtr::close ( )
throw (nidas::util::IOException
)
inlinevirtual

Reimplemented from nidas::dynld::isff::GOESXmtr.

string SE_GOESXmtr::codeString ( char  pktType)
static
IOChannel * GOESXmtr::connect ( )
throw (nidas::util::IOException
)
virtualinherited

Establish a connection.

On return, the connection has been established. It may return a new instance of an IOChannel.

Implements nidas::core::IOChannel.

References nidas::dynld::isff::GOESXmtr::open().

char SE_GOESXmtr::crc ( const std::string &  msg)
static

Compute a CRC for the message.

Referenced by recv().

virtual dsm_time_t nidas::core::IOChannel::createFile ( dsm_time_t  t,
bool  exact 
)
inlinevirtualinherited

Request that an IOChannel open a new file, with a name based on a time.

This should be implemented by derived classes which write to disk files. Other derived classes (e.g. sockets) can just use this default implementation - basically ignoring the request.

Parameters
tTime to use when creating file name.
exactUse exact time when creating file name, else the time is adjusted to an even time interval.

Reimplemented in nidas::core::FileSet.

Referenced by nidas::core::IOStream::createFile().

IOChannel * IOChannel::createIOChannel ( const xercesc::DOMElement *  node)
throw (nidas::util::InvalidParameterException
)
staticinherited
n_u::UTime SE_GOESXmtr::decodeClock ( const char *  in)
int SE_GOESXmtr::detectModel ( )
throw (nidas::util::IOException
)
void SE_GOESXmtr::doSelfTest ( )
throw (nidas::util::IOException
)
void SE_GOESXmtr::encodeClock ( const nidas::util::UTime ut,
char *  out,
bool  fractsecs 
)
string SE_GOESXmtr::fix ( const std::string &  msg)
static

Fix a string for transmission to a SE GOES transmitter.

SOH character is changed to "#" followed by ~SOH (one's complement) EOT character is changed to "#" followed by ~EOT (one's complement)

character is changed to "#" followed by ~# (one's complement)

void nidas::dynld::isff::SE_GOESXmtr::flush ( )
throw (nidas::util::IOException
)
inlinevirtual

Default flush implementation does nothing.

Reimplemented from nidas::dynld::isff::GOESXmtr.

void GOESXmtr::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtualinherited
void SE_GOESXmtr::getBatteryVoltages ( float &  current,
float &  before,
float &  during 
)
throw (nidas::util::IOException
)

Send Get Status command to SE model 1200 to query the battery voltates.

Parameters
current battery voltage, voltage before last transmission, voltage during last transmission.

References nidas::core::floatNAN.

virtual size_t nidas::core::IOChannel::getBufferSize ( ) const
throw (
)
inlinevirtualinherited
int nidas::dynld::isff::GOESXmtr::getChannel ( ) const
inlineinherited
virtual const ConnectionInfo& nidas::core::IOChannel::getConnectionInfo ( ) const
inlinevirtualinherited

What is the IP address of the host at the other end of the connection.

If this IOChannel is not a socket then return INADDR_ANY, using the default constructor of an Inet4Address. Socket subclasses should override this.

Referenced by nidas::dynld::SampleInputStream::setIOChannel().

virtual const DSMConfig* nidas::core::IOChannel::getDSMConfig ( ) const
inlinevirtualinherited

What DSM is this IOChannel connected to? May be NULL.

Referenced by nidas::core::FileSet::setDir(), and nidas::core::FileSet::setFileName().

int nidas::dynld::isff::GOESXmtr::getFd ( ) const
inlinevirtualinherited
unsigned long nidas::dynld::isff::GOESXmtr::getId ( ) const
inlineinherited

Referenced by checkId(), and setXmtrId().

int nidas::dynld::isff::SE_GOESXmtr::getMaxRFBaud ( ) const
inline

Get the maximum RF baud rate supported by the transmitter.

This value is set by the checkStatus() method, which is called by detectModel(), init(), and transmitData().

Referenced by detectModel().

int nidas::dynld::isff::SE_GOESXmtr::getModel ( ) const
inline

Return the model number of the transmitter.

Returns
: 0=unknown, 100, 110, 120, or 1200.

Referenced by decodeClock(), encodeClock(), and getSelfTestStatusString().

const std::string& nidas::dynld::isff::GOESXmtr::getName ( ) const
inlinevirtualinherited
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
virtual int nidas::core::IOChannel::getReconnectDelaySecs ( ) const
inlinevirtualinherited
virtual enum McSocketRequest nidas::core::IOChannel::getRequestType ( ) const
inlinevirtualinherited
int nidas::dynld::isff::SE_GOESXmtr::getRFBaud ( ) const
inlinevirtual

Implements nidas::dynld::isff::GOESXmtr.

Referenced by detectModel().

int SE_GOESXmtr::getSelfTestResults ( )
throw (nidas::util::IOException
)

Fetch self test results.

Returns
model number. This model number may be incorrect, because a model 110 will be reported as a 120. One must do a test transmission to determine that it is actually a 110.

References _gpsInstalled, _maxRFBaud, _selfTestStatus, checkResponse(), nidas::dynld::isff::GOESXmtr::getName(), PKT_SELFTEST_DISPL, recv(), send(), tosleep(), and WLOG.

Referenced by checkStatus().

string SE_GOESXmtr::getSelfTestStatusString ( )
const std::string& nidas::dynld::isff::GOESXmtr::getStatusFile ( ) const
inlineinherited

Referenced by printStatus().

int nidas::dynld::isff::GOESXmtr::getXmitInterval ( ) const
inlineinherited
int nidas::dynld::isff::GOESXmtr::getXmitOffset ( ) const
inlineinherited
n_u::UTime SE_GOESXmtr::getXmtrClock ( )
throw (nidas::util::IOException
)
int SE_GOESXmtr::getXmtrClockDelay ( int  nchar) const

Get the transmission delay of the transmitter clock.

Parameters
ncharNumber of characters sent to set the clock, or number of characters received when getting the clock.
Returns
The number of microseconds that the receipt of a transmitter clock value was delayed due to serial transmission. This value is typically 14 * 10 * 10^6 / 9600 = 14583. The clock packet is 14 bytes long, assume 10 transmitted bits per byte, at 9600 baud.

References nidas::dynld::isff::GOESXmtr::_port, nidas::util::Termios::getBaudRate(), nidas::util::SerialPort::getTermios(), and USECS_PER_SEC.

Referenced by checkClock(), and setXmtrClock().

unsigned long SE_GOESXmtr::getXmtrId ( )
throw (nidas::util::IOException
)
void SE_GOESXmtr::init ( )
throw (nidas::util::IOException
)
virtual
virtual bool nidas::dynld::isff::SE_GOESXmtr::isNewFile ( ) const
inlinevirtual
virtual bool nidas::core::IOChannel::isNewInput ( ) const
inlinevirtualinherited

Some IOChannels, namely FileSet, which opens successive files, need to indicate when a read is from the start of a new file.

This method is used by code which may need to do special things at the beginning of a file, like read a SampleInputHeader.

Reimplemented in nidas::core::UnixIOChannel, nidas::core::McSocketUDP, nidas::core::McSocket, nidas::core::Socket, nidas::core::DatagramSocket, and nidas::core::FileSet.

Referenced by nidas::core::IOStream::read().

bool nidas::dynld::isff::GOESXmtr::isNonBlocking ( ) const
throw (nidas::util::IOException
)
inlinevirtualinherited
void GOESXmtr::open ( )
throw (nidas::util::IOException
)
virtualinherited
SE_GOESXmtr& nidas::dynld::isff::SE_GOESXmtr::operator= ( const SE_GOESXmtr )
private

No assignment.

void SE_GOESXmtr::printStatus ( )
throw (
)
virtual

Request that transmitter status be printed to an output stream.

Implements nidas::dynld::isff::GOESXmtr.

References nidas::dynld::isff::GOESXmtr::getStatusFile(), and PLOG.

Referenced by main().

void SE_GOESXmtr::printStatus ( std::ostream &  ost)
throw (
)
void SE_GOESXmtr::query ( )
throw (nidas::util::IOException
)

Query the GOES Transmitter.

Returns
false: not responding or not ready. true: A-OK.

References checkResponse(), PKT_QUERY, recv(), send(), tosleep(), and wakeup().

Referenced by init().

size_t SE_GOESXmtr::read ( void *  buf,
size_t  len 
)
throw (nidas::util::IOException
)
privatevirtual

Read a message, up to the EOT, from the serial port.

Implements nidas::core::IOChannel.

References len.

Referenced by recv().

string SE_GOESXmtr::recv ( )
throw (nidas::util::IOException
)

Receive a message from the transmitter.

IOException is thrown if the message does not match specs:

  1. Is not enclosed in SOH,EOT.
  2. the length does not match what was read.
  3. The CRC check fails.
    Returns
    The unfix'd contents of the message, without the SOH, length, CRC or the EOT.

References crc(), EOT, nidas::dynld::isff::GOESXmtr::getName(), len, read(), SOH, and unfix().

Referenced by checkStatus(), doSelfTest(), getSelfTestResults(), getXmtrClock(), getXmtrId(), query(), reset(), setXmtrClock(), setXmtrId(), and testTransmitSE120().

void GOESXmtr::requestConnection ( IOChannelRequester rqstr)
throw (nidas::util::IOException
)
virtualinherited

Request a connection.

Implements nidas::core::IOChannel.

void SE_GOESXmtr::reset ( )
throw (nidas::util::IOException
)
virtual
size_t SE_GOESXmtr::send ( const std::string &  msg)
throw (nidas::util::IOException
)

Sent a message to the GOES transmitter.

Parameters
msgThe basic message, without the leading SOH, or length, or the trailing CRC or EOT.

References crc.

Referenced by checkStatus(), doSelfTest(), getSelfTestResults(), getXmtrClock(), getXmtrId(), query(), reset(), setXmtrClock(), setXmtrId(), and testTransmitSE120().

size_t SE_GOESXmtr::send ( char  c)
throw (nidas::util::IOException
)

A one-byte message, containing only the type.

void nidas::dynld::isff::GOESXmtr::setChannel ( int  val)
inlineinherited

Referenced by main().

virtual void nidas::core::IOChannel::setConnectionInfo ( const ConnectionInfo val)
inlinevirtualinherited
virtual void nidas::core::IOChannel::setDSMConfig ( const DSMConfig val)
inlinevirtualinherited
void nidas::dynld::isff::GOESXmtr::setId ( unsigned long  val)
inlineinherited

Referenced by main().

void nidas::dynld::isff::SE_GOESXmtr::setModel ( int  val)
inline

Referenced by detectModel(), doSelfTest(), and reset().

void nidas::dynld::isff::GOESXmtr::setName ( const std::string &  val)
inlinevirtualinherited

Implements nidas::core::IOChannel.

Referenced by main().

virtual void nidas::core::IOChannel::setNonBlocking ( bool  val)
throw (nidas::util::IOException
)
pure virtualinherited
void nidas::dynld::isff::GOESXmtr::setNonBlocking ( bool val   __attribute__(unused))
throw (nidas::util::IOException
)
inlineinherited
virtual void nidas::core::IOChannel::setRequestType ( enum McSocketRequest  )
inlinevirtualinherited
void SE_GOESXmtr::setRFBaud ( long  val)
throw (nidas::util::InvalidParameterException
)
virtual

Set the RF baud rate.

Parameters
valRF baud, in bits/sec.

Implements nidas::dynld::isff::GOESXmtr.

Referenced by detectModel().

void nidas::dynld::isff::GOESXmtr::setStatusFile ( const std::string &  val)
inlineinherited
void nidas::dynld::isff::GOESXmtr::setXmitInterval ( long  val)
inlineinherited

Set the transmission interval.

Parameters
valInterval, in seconds.
void nidas::dynld::isff::GOESXmtr::setXmitOffset ( long  val)
inlineinherited

Set the transmission offset.

Parameters
valOffset, in seconds.
void SE_GOESXmtr::setXmtrClock ( )
throw (nidas::util::IOException
)
void SE_GOESXmtr::setXmtrId ( )
throw (nidas::util::IOException
)
bool SE_GOESXmtr::testTransmitSE120 ( )
throw (nidas::util::IOException
)
xercesc::DOMElement * DOMable::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
xercesc::DOMElement * DOMable::toDOMParent ( xercesc::DOMElement *  parent,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
void SE_GOESXmtr::tosleep ( )
throw (nidas::util::IOException
)
void SE_GOESXmtr::transmitData ( const nidas::util::UTime sendTime,
int  configid,
const Sample samp 
)
throw (nidas::util::IOException
)
virtual

Queue a sample for writing to a GOES transmitter.

Implements nidas::dynld::isff::GOESXmtr.

References nidas::dynld::isff::GOESException::getStatus(), PLOG, and nidas::util::Exception::what().

void SE_GOESXmtr::transmitDataSE110 ( const nidas::util::UTime sendTime,
int  configid,
const Sample samp 
)
throw (nidas::util::IOException
)
void nidas::dynld::isff::SE_GOESXmtr::transmitDataSE110 ( )
throw (nidas::util::IOException
)
void SE_GOESXmtr::transmitDataSE120 ( const nidas::util::UTime sendTime,
int  configid,
const Sample samp 
)
throw (nidas::util::IOException
)
string SE_GOESXmtr::unfix ( const std::string &  msg)
static

Unfix a string that was read from a SE GOES transmitter, looking for.

'#c' 

where c is any character, and replacing the two characters with the one's complement of c.

Referenced by recv().

void SE_GOESXmtr::wakeup ( )
throw (nidas::util::IOException
)
size_t SE_GOESXmtr::write ( const void *  buf,
size_t  len 
)
throw (nidas::util::IOException
)
privatevirtual

Write a message to the serial port.

The message must have already been formatted for a SE GOES tranmitter: leading SOH, length, message, CRC, EOT, and the length,message and CRC portion must have been fixed with the fix() method.

Implements nidas::core::IOChannel.

References len.

size_t SE_GOESXmtr::write ( const struct iovec *  iov,
int  iovcnt 
)
throw (nidas::util::IOException
)
privatevirtual

Physical write method which must be implemented in derived classes.

Returns the number of bytes written, which may be less than the number requested.

Implements nidas::core::IOChannel.

virtual bool nidas::core::IOChannel::writeNidasHeader ( ) const
inlinevirtualinherited

Should the NIDAS header be written to this IOChannel? NIDAS headers are not written to DatagramSockets, because there is no guarantee they will get there.

Reimplemented in nidas::core::DatagramSocket.

Referenced by nidas::dynld::SampleInputStream::setIOChannel().

Member Data Documentation

unsigned long nidas::dynld::isff::SE_GOESXmtr::_activeId
private

Actual id read from transmitter.

Referenced by checkId(), getXmtrId(), and setXmtrId().

int nidas::dynld::isff::SE_GOESXmtr::_clockDiffMsecs
private

Most recent value for GOES clock difference: GOES clock - system clock.

Referenced by checkClock().

const n_u::EndianConverter * SE_GOESXmtr::_fromBig
staticprivate
bool nidas::dynld::isff::SE_GOESXmtr::_gpsInstalled
private
std::string nidas::dynld::isff::SE_GOESXmtr::_lastXmitStatus
private

Referenced by init().

int nidas::dynld::isff::SE_GOESXmtr::_maxRFBaud
private

Referenced by getSelfTestResults().

int nidas::dynld::isff::SE_GOESXmtr::_model
private
nidas::util::SerialPort nidas::dynld::isff::GOESXmtr::_port
protectedinherited
int nidas::dynld::isff::SE_GOESXmtr::_rfBaud
private
short nidas::dynld::isff::SE_GOESXmtr::_selfTestStatus
private
std::string nidas::dynld::isff::SE_GOESXmtr::_softwareBuildDate
private

Referenced by checkStatus().

nidas::util::UTime nidas::dynld::isff::SE_GOESXmtr::_transmitAtTime
private
nidas::util::UTime nidas::dynld::isff::SE_GOESXmtr::_transmitQueueTime
private
nidas::util::UTime nidas::dynld::isff::SE_GOESXmtr::_transmitSampleTime
private
size_t nidas::dynld::isff::SE_GOESXmtr::_xmitNbytes
private
struct SE_Codes nidas::dynld::isff::SE_GOESXmtr::cmdCodes[]
static
const char nidas::dynld::isff::SE_GOESXmtr::EOT = '\x4'
static

Byte at end of each message sent to or received from transmitter.

Referenced by recv().

const char nidas::dynld::isff::SE_GOESXmtr::ERR_BADLEN = 0x05
static
const char nidas::dynld::isff::SE_GOESXmtr::ERR_BADTYPE = 0x04
static

Referenced by checkStatus(), and testTransmitSE120().

const char nidas::dynld::isff::SE_GOESXmtr::ERR_CRC = 0x03
static
const char nidas::dynld::isff::SE_GOESXmtr::ERR_MEMORY = 0x06
static
const char nidas::dynld::isff::SE_GOESXmtr::ERR_SEQUENCE = 0x07
static
const char nidas::dynld::isff::SE_GOESXmtr::ERR_TIMEOUT = 0x08
static
const char nidas::dynld::isff::SE_GOESXmtr::ERR_TOOLONG = 0x01
static
const char nidas::dynld::isff::SE_GOESXmtr::ERR_TOOSHORT = 0x02
static
const char * SE_GOESXmtr::errorCodeStrings
static
Initial value:
= {
"Packet OK",
"Received Packet Too Long",
"Received Packet Too Short",
"Received Packet Checksum Error",
"Invalid Type Code",
"Length Field mismatch",
"Unable to Allocate Memory",
"Invalid Sequence Number",
"Command Timeout for multi-packet Command",
}
const char nidas::dynld::isff::SE_GOESXmtr::PKT_ACKNOWLEDGE = '\x80'
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_CANCEL_XMT = '\x16'
static

Cancel transmission.

const char nidas::dynld::isff::SE_GOESXmtr::PKT_DISPLAY_VERSION = '\x1d'
static

Display version information, SE120, SE1200.

Referenced by checkStatus().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_ERR_RESPONSE = '\xf0'
static

Xmtr detected an error in msg it rcvd.

const char nidas::dynld::isff::SE_GOESXmtr::PKT_GET_GLOBALS = '\x1c'
static

SE110.

const char nidas::dynld::isff::SE_GOESXmtr::PKT_GET_ID = '\x10'
static

Get the transmitter's id.

Referenced by getXmtrId().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_GET_SE1200_STATUS = '\x74'
static

SE1200 Only, grabs status info.

const char nidas::dynld::isff::SE_GOESXmtr::PKT_GET_TIME = '\x14'
static

Get Transmitter time-of-day.

Referenced by getXmtrClock().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_GET_XMT_QUE = '\x17'
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_POLL_DATA_GET = 0x39
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_POLL_DATA_SET = 0x3a
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_POLL_ENABLE = 0x38
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_QUERY = '\x18'
static

Referenced by query().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_RESET_XMTR = '\x76'
static

Referenced by reset().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_SELFTEST_DISPL = '\x77'
static

Referenced by getSelfTestResults().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_SELFTEST_START = '\x78'
static

Referenced by doSelfTest(), and reset().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_SEND_FIXED_CHAN = '\x7a'
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_SET_GLOBALS = '\x1b'
static

SE110.

const char nidas::dynld::isff::SE_GOESXmtr::PKT_SET_ID = '\x11'
static

Sets Transmitter id in either ram or eeprom.

Referenced by setXmtrId().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_SET_TIME = '\x13'
static

Load Transmitter time-of-day.

Referenced by setXmtrClock().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_SOFTWARE_LOAD = '\x7c'
static

SE120, SE1200.

const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_CLOCK_NOT_LOADED = 0x0a
static

Referenced by checkClock().

const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_CRC_ERROR_ON_LOAD = 0x0b
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_EEPROM_NOT_UPDATED = 0x08
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_ILLEGAL_REQUEST = 0x01
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_INVALID_CHANNEL = 0x06
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_INVALID_DATE_TIME = 0x04
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_INVALID_REPEAT_COUNT = 0x09
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_INVALID_TRANSMIT_INTERVAL = 0x07
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_ITEM_NOT_FOUND = 0x03
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_OK = 0
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_STATUS_TRANSMIT_OVERLAP = 0x05
static
const char nidas::dynld::isff::SE_GOESXmtr::PKT_XMT_DATA = '\x15'
static

Transmit data, SE110 only.

const char nidas::dynld::isff::SE_GOESXmtr::PKT_XMT_DATA_SE120 = '\x1e'
static

Transmit, SE120, SE1200.

Referenced by testTransmitSE120().

SE_GOESXmtr::selfTest SE_GOESXmtr::selfTestCodes
static
Initial value:
= {
{
{0x0001,"Ext RAM Test Failure"},
{0x0002,"Ext RAM PageTest Failure"},
{0x0004,"Battery Voltage < 10.5 Volts"},
{0x0008,"EEPROM1 Program CRC Test Failure"},
{0x0100,"RF Supply Voltage Failure"},
{0x0200,"RF PLL Lock Failure"},
{0x0000,""},
{0x0000,""},
{0x0000,""},
{0x0000,""},
},
{
{0x0004,"Battery Voltage < 10.0 Volts"},
{0x0008,"Software Boot Code Flash CRC Error"},
{0x0010,"RS232 Software Flash CRC Error"},
{0x0020,"Temperature Sensor Test Failure"},
{0x0040,"TCX0 DAC Test Failure"},
{0x0100,"HSB Software Flash CRC Error"},
{0x0200,"RF PLL Lock Failure"},
{0x0400,"TOD Interrrupt Test Failure"},
{0x0800,"Modulation Interrupt Test Failure"},
{0x1000,"Manufacturing Data Flash CRC Error"},
},
}

Referenced by getSelfTestStatusString().

const char nidas::dynld::isff::SE_GOESXmtr::SOH = '\x1'
static

Byte at beginning of each message sent to or received from transmitter.

Referenced by recv().

const std::string SE_GOESXmtr::SOH_STR = string(1,SOH)
static
const char * SE_GOESXmtr::statusCodeStrings
static
Initial value:
= {
"Packet transmission OK",
"Illegal request",
"Unknown status",
"Item not found",
"Invalid data or time",
"Transmission time overlap",
"Invalid channel",
"Invalid transmit interval",
"EEPROM not updated",
"Invalid repeat count",
"Clock not loaded",
"CRC error on load",
}

The documentation for this class was generated from the following files: