w11 - cpp 0.794
Backend server for Rlink and w11
|
FIXME_docs. More...
#include <RlinkPort.hpp>
Public Types | |
enum | stats { kStatNPortWrite = 0 , kStatNPortRead , kStatNPortTxByt , kStatNPortRxByt , kStatNPortRawWrite , kStatNPortRawRead , kDimStat } |
typedef std::unique_ptr< RlinkPort > | port_uptr_t |
Public Member Functions | |
RlinkPort () | |
Default constructor. | |
virtual | ~RlinkPort () |
Destructor. | |
RlinkPort (const RlinkPort &)=delete | |
RlinkPort & | operator= (const RlinkPort &)=delete |
virtual bool | Open (const std::string &url, RerrMsg &emsg)=0 |
virtual void | Close () |
FIXME_docs. | |
virtual int | Read (uint8_t *buf, size_t size, const Rtime &timeout, RerrMsg &emsg) |
FIXME_docs. | |
virtual int | Write (const uint8_t *buf, size_t size, RerrMsg &emsg) |
FIXME_docs. | |
virtual bool | PollRead (const Rtime &timeout) |
FIXME_docs. | |
int | RawRead (uint8_t *buf, size_t size, bool exactsize, const Rtime &timeout, Rtime &tused, RerrMsg &emsg) |
FIXME_docs. | |
int | RawWrite (const uint8_t *buf, size_t size, RerrMsg &emsg) |
FIXME_docs. | |
bool | IsOpen () const |
FIXME_docs. | |
const RparseUrl & | Url () const |
FIXME_docs. | |
bool | XonEnable () const |
FIXME_docs. | |
int | FdRead () const |
FIXME_docs. | |
int | FdWrite () const |
FIXME_docs. | |
void | SetLogFile (const std::shared_ptr< RlogFile > &splog) |
FIXME_docs. | |
void | SetTraceLevel (uint32_t level) |
FIXME_docs. | |
uint32_t | TraceLevel () const |
FIXME_docs. | |
Rstats & | Stats () |
FIXME_docs. | |
virtual void | Dump (std::ostream &os, int ind=0, const char *text=0, int detail=0) const |
FIXME_docs. | |
Static Public Attributes | |
static const int | kEof = 0 |
return code: end-of-file | |
static const int | kTout = -1 |
return code: time out | |
static const int | kErr = -2 |
return code: IO error | |
Protected Member Functions | |
void | CloseFd (int &fd) |
FIXME_docs. | |
Protected Attributes | |
bool | fIsOpen |
is open flag | |
RparseUrl | fUrl |
parsed url | |
bool | fXon |
xon attribute set | |
int | fFdRead |
fd for read | |
int | fFdWrite |
fd for write | |
std::shared_ptr< RlogFile > | fspLog |
log file ptr | |
uint32_t | fTraceLevel |
trace level | |
Rtime | fTsLastRead |
time stamp last write | |
Rtime | fTsLastWrite |
time stamp last write | |
Rstats | fStats |
statistics | |
FIXME_docs.
Definition at line 45 of file RlinkPort.hpp.
typedef std::unique_ptr<RlinkPort> Retro::RlinkPort::port_uptr_t |
Definition at line 47 of file RlinkPort.hpp.
Enumerator | |
---|---|
kStatNPortWrite | |
kStatNPortRead | |
kStatNPortTxByt | |
kStatNPortRxByt | |
kStatNPortRawWrite | |
kStatNPortRawRead | |
kDimStat |
Definition at line 91 of file RlinkPort.hpp.
Retro::RlinkPort::RlinkPort | ( | ) |
Default constructor.
Definition at line 67 of file RlinkPort.cpp.
References Retro::Rstats::Define(), fStats, kStatNPortRawRead, kStatNPortRawWrite, kStatNPortRead, kStatNPortRxByt, kStatNPortTxByt, and kStatNPortWrite.
|
virtual |
|
delete |
|
pure virtual |
Implemented in Retro::RlinkPortCuff, Retro::RlinkPortFifo, and Retro::RlinkPortTerm.
|
virtual |
FIXME_docs.
Reimplemented in Retro::RlinkPortCuff, and Retro::RlinkPortTerm.
Definition at line 98 of file RlinkPort.cpp.
References Retro::RparseUrl::Clear(), CloseFd(), fFdRead, fFdWrite, fIsOpen, fUrl, and IsOpen().
Referenced by Retro::RlinkPortCuff::Close(), Retro::RlinkPortTerm::Close(), Retro::RlinkPortFifo::Open(), and ~RlinkPort().
|
virtual |
FIXME_docs.
Definition at line 115 of file RlinkPort.cpp.
References fFdRead, fspLog, fStats, fTraceLevel, fTsLastRead, fTsLastWrite, Retro::Rstats::Inc(), Retro::RerrMsg::InitErrno(), IsOpen(), Retro::Rtime::IsPositive(), kErr, kStatNPortRead, kStatNPortRxByt, kTout, Retro::RerrMsg::Message(), PollRead(), and Retro::RosPrintf().
Referenced by RawRead(), and Retro::RlinkPacketBufRcv::ReadData().
|
virtual |
FIXME_docs.
Definition at line 166 of file RlinkPort.cpp.
References fFdWrite, fspLog, fStats, fTraceLevel, fTsLastRead, fTsLastWrite, Retro::Rstats::Inc(), Retro::RerrMsg::InitErrno(), IsOpen(), Retro::Rtime::IsPositive(), kErr, kStatNPortTxByt, kStatNPortWrite, Retro::RerrMsg::Message(), and Retro::RosPrintf().
Referenced by Retro::RlinkPortTerm::Open(), RawWrite(), and Retro::RlinkPacketBufSnd::SndRaw().
|
virtual |
FIXME_docs.
Definition at line 218 of file RlinkPort.cpp.
References fFdRead, Retro::Rtime::IsNegative(), IsOpen(), and Retro::Rtime::ToMSec().
Referenced by Read().
int Retro::RlinkPort::RawRead | ( | uint8_t * | buf, |
size_t | size, | ||
bool | exactsize, | ||
const Rtime & | timeout, | ||
Rtime & | tused, | ||
RerrMsg & | emsg | ||
) |
FIXME_docs.
Definition at line 249 of file RlinkPort.cpp.
References Retro::Rtime::Clear(), fStats, Retro::Rtime::GetClock(), Retro::Rstats::Inc(), Retro::Rtime::IsPositive(), kStatNPortRawRead, and Read().
Referenced by Retro::RtclRlinkPort::DoRawRblk(), and Retro::RtclRlinkPort::DoRawRead().
int Retro::RlinkPort::RawWrite | ( | const uint8_t * | buf, |
size_t | size, | ||
RerrMsg & | emsg | ||
) |
FIXME_docs.
Definition at line 279 of file RlinkPort.cpp.
References fStats, Retro::Rstats::Inc(), kStatNPortRawWrite, and Write().
Referenced by Retro::RtclRlinkPort::DoRawWblk().
|
inline |
FIXME_docs.
Definition at line 27 of file RlinkPort.ipp.
References fIsOpen.
Referenced by Close(), Retro::RlinkPortCuff::Close(), Retro::RlinkPortTerm::Close(), Retro::RlinkPortCuff::Open(), Retro::RlinkPortFifo::Open(), PollRead(), Read(), Write(), ~RlinkPort(), and Retro::RlinkPortCuff::~RlinkPortCuff().
|
inline |
FIXME_docs.
Definition at line 35 of file RlinkPort.ipp.
References fUrl.
Referenced by Retro::RtclRlinkConnect::M_open().
|
inline |
|
inline |
|
inline |
|
inline |
FIXME_docs.
Definition at line 67 of file RlinkPort.ipp.
References fspLog.
Referenced by Retro::RlinkConnect::Open().
|
inline |
FIXME_docs.
Definition at line 76 of file RlinkPort.ipp.
References fTraceLevel.
Referenced by Retro::RlinkConnect::Open(), Retro::RlinkConnect::SetTraceLevel(), and Retro::RtclRlinkPort::SetupGetSet().
|
inline |
FIXME_docs.
Definition at line 85 of file RlinkPort.ipp.
References fTraceLevel.
Referenced by Retro::RtclRlinkPort::SetupGetSet().
|
inline |
|
virtual |
FIXME_docs.
Reimplemented in Retro::RlinkPortTerm.
Definition at line 288 of file RlinkPort.cpp.
References Retro::RparseUrl::Dump(), Retro::Rstats::Dump(), fFdRead, fFdWrite, fIsOpen, fspLog, fStats, fTraceLevel, fTsLastRead, fTsLastWrite, fUrl, fXon, and Retro::RosPrintf().
Referenced by Retro::RlinkConnect::Dump(), and Retro::RlinkPortTerm::Dump().
|
protected |
FIXME_docs.
Definition at line 310 of file RlinkPort.cpp.
Referenced by Retro::RlinkPortCuff::Cleanup(), and Close().
|
static |
return code: end-of-file
Definition at line 86 of file RlinkPort.hpp.
Referenced by Retro::RtclRlinkPort::DoRawRblk(), Retro::RtclRlinkPort::DoRawRead(), and Retro::RlinkPacketBufRcv::ReadData().
|
static |
return code: time out
Definition at line 87 of file RlinkPort.hpp.
Referenced by Retro::RtclRlinkPort::DoRawRblk(), Retro::RtclRlinkPort::DoRawRead(), Read(), Retro::RlinkPacketBufRcv::ReadData(), and Retro::RlinkConnect::WaitAttn().
|
static |
return code: IO error
Definition at line 88 of file RlinkPort.hpp.
Referenced by Read(), Retro::RlinkConnect::WaitAttn(), and Write().
|
protected |
is open flag
Definition at line 105 of file RlinkPort.hpp.
Referenced by Close(), Dump(), IsOpen(), Retro::RlinkPortCuff::Open(), Retro::RlinkPortFifo::Open(), and Retro::RlinkPortTerm::Open().
|
protected |
parsed url
Definition at line 106 of file RlinkPort.hpp.
Referenced by Close(), Dump(), Retro::RlinkPortCuff::Open(), Retro::RlinkPortFifo::Open(), Retro::RlinkPortTerm::Open(), Retro::RlinkPortCuff::TraceOn(), and Url().
|
protected |
xon attribute set
Definition at line 107 of file RlinkPort.hpp.
Referenced by Dump(), Retro::RlinkPortFifo::Open(), Retro::RlinkPortTerm::Open(), and XonEnable().
|
protected |
fd for read
Definition at line 108 of file RlinkPort.hpp.
Referenced by Retro::RlinkPortCuff::Cleanup(), Close(), Dump(), FdRead(), Retro::RlinkPortCuff::Open(), Retro::RlinkPortFifo::Open(), Retro::RlinkPortTerm::Open(), PollRead(), and Read().
|
protected |
fd for write
Definition at line 109 of file RlinkPort.hpp.
Referenced by Retro::RlinkPortCuff::Cleanup(), Close(), Retro::RlinkPortTerm::Close(), Dump(), FdWrite(), Retro::RlinkPortCuff::Open(), Retro::RlinkPortFifo::Open(), Retro::RlinkPortTerm::Open(), and Write().
|
protected |
log file ptr
Definition at line 110 of file RlinkPort.hpp.
Referenced by Dump(), Read(), SetLogFile(), and Write().
|
protected |
trace level
Definition at line 111 of file RlinkPort.hpp.
Referenced by Dump(), Read(), SetTraceLevel(), TraceLevel(), and Write().
|
protected |
time stamp last write
Definition at line 112 of file RlinkPort.hpp.
|
protected |
time stamp last write
Definition at line 113 of file RlinkPort.hpp.
|
protected |
statistics
Definition at line 114 of file RlinkPort.hpp.
Referenced by Dump(), Retro::RlinkPortCuff::PollfdAdd(), Retro::RlinkPortCuff::PollfdRemove(), RawRead(), RawWrite(), Read(), RlinkPort(), Retro::RlinkPortCuff::RlinkPortCuff(), Stats(), Retro::RlinkPortCuff::USBReadDone(), Retro::RlinkPortCuff::USBWriteDone(), and Write().