nidas
v1.2-1520
|
An IOChannel implementation for a Signal Engineering GOES transmitter. More...
#include <SE_GOESXmtr.h>
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_GOESXmtr * | clone () 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 ¤t, 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... | |
IOChannel * | connect () 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 ConnectionInfo & | getConnectionInfo () 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 DSMConfig * | getDSMConfig () 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 IOChannel * | createIOChannel (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_GOESXmtr & | operator= (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 |
An IOChannel implementation for a Signal Engineering GOES transmitter.
SE_GOESXmtr::SE_GOESXmtr | ( | ) |
Constructor.
References nidas::dynld::isff::GOESXmtr::_port, nidas::util::Termios::NOFLOWCONTROL, nidas::util::Termios::NONE, nidas::util::Termios::setBaudRate(), nidas::util::Termios::setDataBits(), nidas::util::Termios::setFlowControl(), nidas::util::Termios::setLocal(), nidas::util::Termios::setParity(), nidas::util::Termios::setRaw(), nidas::util::Termios::setRawLength(), nidas::util::Termios::setRawTimeout(), nidas::util::Termios::setStopBits(), and nidas::util::SerialPort::termios().
SE_GOESXmtr::SE_GOESXmtr | ( | const SE_GOESXmtr & | x | ) |
Copy constructor.
References nidas::dynld::isff::GOESXmtr::_port, nidas::util::Termios::NOFLOWCONTROL, nidas::util::Termios::NONE, nidas::util::Termios::setBaudRate(), nidas::util::Termios::setDataBits(), nidas::util::Termios::setFlowControl(), nidas::util::Termios::setLocal(), nidas::util::Termios::setParity(), nidas::util::Termios::setRaw(), nidas::util::Termios::setRawLength(), nidas::util::Termios::setRawTimeout(), nidas::util::Termios::setStopBits(), and nidas::util::SerialPort::termios().
SE_GOESXmtr::~SE_GOESXmtr | ( | ) |
Destructor.
void SE_GOESXmtr::cancelTransmit | ( | const nidas::util::UTime & | at | ) | |
throw | ( | nidas::util::IOException | |||
) |
References nidas::dynld::isff::GOESException::getStatus(), PLOG, and nidas::util::Exception::what().
Referenced by testTransmitSE120().
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.
|
virtual |
Check transmitter clock, and correct it if necessary.
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().
|
virtual |
Implements nidas::dynld::isff::GOESXmtr.
References _activeId, nidas::dynld::isff::GOESXmtr::getId(), nidas::dynld::isff::GOESXmtr::getName(), getXmtrId(), setXmtrId(), and WLOG.
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().
|
inlinevirtual |
Clone invokes default copy constructor.
Implements nidas::core::IOChannel.
|
inlinevirtual |
Reimplemented from nidas::dynld::isff::GOESXmtr.
|
static |
|
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().
|
static |
Compute a CRC for the message.
Referenced by recv().
|
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.
t | Time to use when creating file name. |
exact | Use 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().
|
staticinherited |
References nidas::core::DOMObjectFactory::createObject(), nidas::core::Socket::createSocket(), nidas::util::Process::expandEnvVars(), nidas::core::XDOMElement::getAttributeValue(), and nidas::core::XDOMElement::getNodeName().
Referenced by nidas::dynld::psql::PSQLSampleOutput::fromDOMElement(), nidas::core::DSMService::fromDOMElement(), nidas::dynld::isff::GOESOutput::fromDOMElement(), nidas::core::SampleOutputBase::fromDOMElement(), and nidas::dynld::SampleInputStream::fromDOMElement().
n_u::UTime SE_GOESXmtr::decodeClock | ( | const char * | in | ) |
References nidas::util::UTime::format(), getModel(), nidas::dynld::isff::GOESXmtr::getName(), ILOG, USECS_PER_MSEC, and WLOG.
Referenced by getXmtrClock().
int SE_GOESXmtr::detectModel | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
References checkClock(), checkStatus(), getMaxRFBaud(), nidas::dynld::isff::GOESXmtr::getName(), getRFBaud(), ILOG, setModel(), setRFBaud(), testTransmitSE120(), and nidas::util::Exception::toString().
Referenced by init().
void SE_GOESXmtr::doSelfTest | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
References checkResponse(), nidas::dynld::isff::GOESXmtr::getName(), ILOG, PKT_SELFTEST_START, recv(), send(), setModel(), tosleep(), and wakeup().
Referenced by main().
void SE_GOESXmtr::encodeClock | ( | const nidas::util::UTime & | ut, |
char * | out, | ||
bool | fractsecs | ||
) |
References getModel(), nidas::util::UTime::toTm(), and USECS_PER_SEC.
Referenced by setXmtrClock(), and testTransmitSE120().
|
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)
|
inlinevirtual |
Default flush implementation does nothing.
Reimplemented from nidas::dynld::isff::GOESXmtr.
|
virtualinherited |
Initialize myself from a xercesc::DOMElement.
Implements nidas::core::DOMable.
References nidas::util::Termios::EVEN, nidas::core::XDOMAttr::getName(), nidas::util::Termios::NONE, nidas::util::Termios::ODD, nidas::util::Termios::setBaudRate(), nidas::util::Termios::setDataBits(), nidas::util::Termios::setParity(), and nidas::util::Termios::setStopBits().
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.
current battery voltage, voltage before last transmission, voltage during last transmission. |
References nidas::core::floatNAN.
|
inlinevirtualinherited |
Return suggested buffer length.
Reimplemented in nidas::core::Socket, nidas::core::DatagramSocket, and nidas::core::MultipleUDPSockets.
Referenced by nidas::dynld::isff::PacketInputStream::init(), nidas::dynld::isff::PacketInputStream::PacketInputStream(), and nidas::dynld::SampleInputStream::SampleInputStream().
|
inlineinherited |
Referenced by nidas::dynld::isff::SimGOESXmtr::printStatus(), and testTransmitSE120().
|
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().
|
inlinevirtualinherited |
What DSM is this IOChannel connected to? May be NULL.
Referenced by nidas::core::FileSet::setDir(), and nidas::core::FileSet::setFileName().
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
|
inlineinherited |
Referenced by checkId(), and setXmtrId().
|
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().
|
inline |
Return the model number of the transmitter.
Referenced by decodeClock(), encodeClock(), and getSelfTestStatusString().
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
Referenced by checkClock(), checkId(), checkStatus(), decodeClock(), detectModel(), doSelfTest(), getSelfTestResults(), recv(), reset(), testTransmitSE120(), tosleep(), and wakeup().
|
inlinestaticinherited |
References nidas::core::DOMable::namespaceURI.
Referenced by nidas::dynld::UDPSampleOutput::getProjectDOM(), nidas::core::Dataset::toDOMElement(), nidas::core::ProjectConfig::toDOMElement(), nidas::core::Dataset::toDOMParent(), nidas::core::ProjectConfig::toDOMParent(), nidas::core::Datasets::toDOMParent(), nidas::core::ProjectConfigs::toDOMParent(), nidas::core::DSMConfig::toDOMParent(), nidas::core::Project::toDOMParent(), nidas::core::Site::toDOMParent(), nidas::core::SampleTag::toDOMParent(), nidas::core::ServerSocket::toDOMParent(), nidas::core::Variable::toDOMParent(), nidas::core::DSMSensor::toDOMParent(), nidas::core::Datasets::writeXML(), and nidas::core::ProjectConfigs::writeXML().
|
inlinevirtualinherited |
Reimplemented in nidas::core::FileSet.
Referenced by nidas::core::SampleOutputBase::getReconnectDelaySecs().
|
inlinevirtualinherited |
Reimplemented in nidas::core::Socket, nidas::core::McSocketUDP, and nidas::core::McSocket.
|
inlinevirtual |
Implements nidas::dynld::isff::GOESXmtr.
Referenced by detectModel().
int SE_GOESXmtr::getSelfTestResults | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
Fetch self test results.
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 | ( | ) |
|
inlineinherited |
Referenced by printStatus().
|
inlineinherited |
|
inlineinherited |
n_u::UTime SE_GOESXmtr::getXmtrClock | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
References checkResponse(), decodeClock(), PKT_GET_TIME, recv(), send(), tosleep(), and wakeup().
Referenced by checkClock().
int SE_GOESXmtr::getXmtrClockDelay | ( | int | nchar | ) | const |
Get the transmission delay of the transmitter clock.
nchar | Number of characters sent to set the clock, or number of characters received when getting the clock. |
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 | ||
) |
References _activeId, checkResponse(), PKT_GET_ID, recv(), send(), tosleep(), and wakeup().
Referenced by checkId().
|
virtual |
Initialize tranmitter.
Implements nidas::dynld::isff::GOESXmtr.
References _lastXmitStatus, checkClock(), detectModel(), query(), setXmtrId(), and nidas::util::Exception::what().
Referenced by main().
|
inlinevirtual |
|
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().
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
|
virtualinherited |
Reimplemented in nidas::dynld::isff::SimGOESXmtr.
References nidas::dynld::isff::GOESXmtr::_port, nidas::util::SerialPort::flushBoth(), and nidas::util::SerialPort::open().
Referenced by nidas::dynld::isff::GOESXmtr::connect(), and main().
|
private |
No assignment.
|
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 | ( | ||||
) |
References nidas::util::Exception::what(), and WLOG.
void SE_GOESXmtr::query | ( | ) | ||
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:
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().
|
virtualinherited |
Request a connection.
Implements nidas::core::IOChannel.
|
virtual |
Implements nidas::dynld::isff::GOESXmtr.
References checkResponse(), nidas::dynld::isff::GOESXmtr::getName(), ILOG, PKT_RESET_XMTR, PKT_SELFTEST_START, recv(), send(), setModel(), tosleep(), and wakeup().
size_t SE_GOESXmtr::send | ( | const std::string & | msg | ) | |
throw | ( | nidas::util::IOException | |||
) |
Sent a message to the GOES transmitter.
msg | The 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.
|
inlineinherited |
Referenced by main().
|
inlinevirtualinherited |
|
inlinevirtualinherited |
What DSM is this IOChannel connected to?
Referenced by nidas::core::SampleOutputBase::fromDOMElement(), nidas::core::SampleOutputBase::SampleOutputBase(), and nidas::core::SampleOutputBase::setIOChannel().
|
inlineinherited |
Referenced by main().
|
inline |
Referenced by detectModel(), doSelfTest(), and reset().
|
inlinevirtualinherited |
Implements nidas::core::IOChannel.
Referenced by main().
|
pure virtualinherited |
|
inlineinherited |
|
inlinevirtualinherited |
Reimplemented in nidas::core::Socket, nidas::core::McSocketUDP, and nidas::core::McSocket.
Referenced by nidas::dynld::XMLConfigService::schedule().
|
virtual |
Set the RF baud rate.
val | RF baud, in bits/sec. |
Implements nidas::dynld::isff::GOESXmtr.
Referenced by detectModel().
|
inlineinherited |
|
inlineinherited |
Set the transmission interval.
val | Interval, in seconds. |
|
inlineinherited |
Set the transmission offset.
val | Offset, in seconds. |
void SE_GOESXmtr::setXmtrClock | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
References checkResponse(), encodeClock(), getXmtrClockDelay(), PKT_SET_TIME, recv(), send(), tosleep(), and wakeup().
Referenced by checkClock().
void SE_GOESXmtr::setXmtrId | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
References _activeId, checkResponse(), nidas::dynld::isff::GOESXmtr::getId(), PKT_SET_ID, recv(), send(), tosleep(), and wakeup().
bool SE_GOESXmtr::testTransmitSE120 | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
References cancelTransmit(), checkResponse(), encodeClock(), ERR_BADTYPE, nidas::util::UTime::format(), nidas::dynld::isff::GOESXmtr::getChannel(), nidas::dynld::isff::GOESXmtr::getName(), nidas::dynld::isff::GOESException::getStatus(), nidas::dynld::isff::GOESXmtr::getXmitInterval(), nidas::dynld::isff::GOESXmtr::getXmitOffset(), PKT_XMT_DATA_SE120, recv(), send(), tosleep(), nidas::util::UTime::toUsecs(), USECS_PER_SEC, wakeup(), nidas::util::Exception::what(), and WLOG.
Referenced by detectModel().
|
virtualinherited |
Add my content into a DOMElement.
Reimplemented in nidas::core::DSMSensor, nidas::core::Variable, nidas::core::ServerSocket, nidas::core::SampleTag, nidas::core::Site, nidas::core::Project, and nidas::core::DSMConfig.
Referenced by nidas::core::ServerSocket::toDOMParent().
|
virtualinherited |
Create a DOMElement and append it to the parent.
Reimplemented in nidas::core::DSMSensor, nidas::core::Variable, nidas::core::ServerSocket, nidas::core::SampleTag, nidas::core::Site, nidas::core::Project, and nidas::core::DSMConfig.
void SE_GOESXmtr::tosleep | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
Lower RTS to put transmitter to sleep.
References nidas::dynld::isff::GOESXmtr::_port, nidas::util::SerialPort::clearModemBits(), nidas::util::SerialPort::getModemStatus(), nidas::dynld::isff::GOESXmtr::getName(), and NSECS_PER_SEC.
Referenced by doSelfTest(), getSelfTestResults(), getXmtrClock(), getXmtrId(), query(), reset(), setXmtrClock(), setXmtrId(), and testTransmitSE120().
|
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 | |
) |
Queue a sample for writing to a GOES transmitter.
References nidas::dynld::isff::GOES::float_encode_4x6(), nidas::core::FLOAT_ST, nidas::core::SampleT< DataT >::getConstDataPtr(), and nidas::core::SampleT< DataT >::getDataLength().
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 | |
) |
|
static |
void SE_GOESXmtr::wakeup | ( | ) | ||
throw | ( | nidas::util::IOException | ||
) |
Raise RTS to wake up transmitter.
References nidas::dynld::isff::GOESXmtr::_port, nidas::util::SerialPort::clearModemBits(), nidas::util::SerialPort::getModemStatus(), nidas::dynld::isff::GOESXmtr::getName(), NSECS_PER_SEC, and nidas::util::SerialPort::setModemBits().
Referenced by checkStatus(), doSelfTest(), getXmtrClock(), getXmtrId(), query(), reset(), setXmtrClock(), setXmtrId(), and testTransmitSE120().
|
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.
|
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.
|
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().
|
private |
Actual id read from transmitter.
Referenced by checkId(), getXmtrId(), and setXmtrId().
|
private |
Most recent value for GOES clock difference: GOES clock - system clock.
Referenced by checkClock().
|
staticprivate |
|
private |
Referenced by checkClock(), getSelfTestResults(), and getSelfTestStatusString().
|
private |
Referenced by init().
|
private |
Referenced by getSelfTestResults().
|
private |
|
protectedinherited |
|
private |
|
private |
Referenced by getSelfTestResults(), and getSelfTestStatusString().
|
private |
Referenced by checkStatus().
|
private |
|
private |
|
private |
|
private |
|
static |
|
static |
Byte at end of each message sent to or received from transmitter.
Referenced by recv().
|
static |
|
static |
Referenced by checkStatus(), and testTransmitSE120().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Cancel transmission.
|
static |
Display version information, SE120, SE1200.
Referenced by checkStatus().
|
static |
Xmtr detected an error in msg it rcvd.
|
static |
SE110.
|
static |
Get the transmitter's id.
Referenced by getXmtrId().
|
static |
SE1200 Only, grabs status info.
|
static |
Get Transmitter time-of-day.
Referenced by getXmtrClock().
|
static |
|
static |
|
static |
|
static |
|
static |
Referenced by query().
|
static |
Referenced by reset().
|
static |
Referenced by getSelfTestResults().
|
static |
Referenced by doSelfTest(), and reset().
|
static |
|
static |
SE110.
|
static |
Sets Transmitter id in either ram or eeprom.
Referenced by setXmtrId().
|
static |
Load Transmitter time-of-day.
Referenced by setXmtrClock().
|
static |
SE120, SE1200.
|
static |
Referenced by checkClock().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Transmit data, SE110 only.
|
static |
Transmit, SE120, SE1200.
Referenced by testTransmitSE120().
|
static |
Referenced by getSelfTestStatusString().
|
static |
Byte at beginning of each message sent to or received from transmitter.
Referenced by recv().
|
static |
|
static |