w11 - cpp 0.794
Backend server for Rlink and w11
|
FIXME_docs. More...
#include <RlinkConnect.hpp>
Public Types | |
enum | stats { kStatNExec = 0 , kStatNExecPart , kStatNCmd , kStatNRreg , kStatNRblk , kStatNWreg , kStatNWblk , kStatNLabo , kStatNAttn , kStatNInit , kStatNRblkWord , kStatNWblkWord , kStatNExpData , kStatNExpDone , kStatNExpStat , kStatNNoExpStat , kStatNChkData , kStatNChkDone , kStatNChkStat , kStatNSndOob , kStatNErrMiss , kStatNErrCmd , kStatNErrLen , kStatNErrCrc , kStatNErrNak , kDimStat } |
Public Member Functions | |
RlinkConnect () | |
Default constructor. | |
~RlinkConnect () | |
Destructor. | |
RlinkConnect (const RlinkConnect &)=delete | |
RlinkConnect & | operator= (const RlinkConnect &)=delete |
bool | Open (const std::string &name, RerrMsg &emsg) |
FIXME_docs. | |
void | Close () |
FIXME_docs. | |
bool | IsOpen () const |
FIXME_docs. | |
bool | HasPort () const |
FIXME_docs. | |
RlinkPort & | Port () |
FIXME_docs. | |
const RlinkPort & | Port () const |
FIXME_docs. | |
bool | LinkInit (RerrMsg &emsg) |
FIXME_docs. | |
bool | LinkInitDone () const |
FIXME_docs. | |
RlinkContext & | Context () |
FIXME_docs. | |
void | SetServer (RlinkServer *pserv) |
FIXME_docs. | |
RlinkServer * | Server () const |
FIXME_docs. | |
bool | ServerActive () const |
Indicates whether server is active. | |
bool | ServerActiveInside () const |
Indicates whether server is active and caller is inside server thread. | |
bool | ServerActiveOutside () const |
Indicates whether server is active and caller is outside server thread. | |
void | lock () |
FIXME_docs. | |
bool | try_lock () |
FIXME_docs. | |
void | unlock () |
FIXME_docs. | |
bool | Exec (RlinkCommandList &clist, RerrMsg &emsg) |
FIXME_docs. | |
bool | Exec (RlinkCommandList &clist, RlinkContext &cntx, RerrMsg &emsg) |
FIXME_docs. | |
void | Exec (RlinkCommandList &clist) |
FIXME_docs. | |
void | Exec (RlinkCommandList &clist, RlinkContext &cntx) |
FIXME_docs. | |
int | WaitAttn (const Rtime &timeout, Rtime &twait, uint16_t &apat, RerrMsg &emsg) |
Wait for an attention notify. | |
bool | SndOob (uint16_t addr, uint16_t data, RerrMsg &emsg) |
FIXME_docs. | |
bool | SndAttn (RerrMsg &emsg) |
FIXME_docs. | |
uint32_t | SysId () const |
FIXME_docs. | |
uint32_t | UsrAcc () const |
FIXME_docs. | |
size_t | RbufSize () const |
FIXME_docs. | |
size_t | BlockSizeMax () const |
FIXME_docs. | |
size_t | BlockSizePrudent () const |
FIXME_docs. | |
bool | HasRbmon () const |
FIXME_docs. | |
bool | AddrMapInsert (const std::string &name, uint16_t addr) |
FIXME_docs. | |
bool | AddrMapErase (const std::string &name) |
FIXME_docs. | |
bool | AddrMapErase (uint16_t addr) |
FIXME_docs. | |
void | AddrMapClear () |
FIXME_docs. | |
const RlinkAddrMap & | AddrMap () const |
FIXME_docs. | |
Rstats & | Stats () |
FIXME_docs. | |
Rstats & | SndStats () |
FIXME_docs. | |
Rstats & | RcvStats () |
FIXME_docs. | |
void | SetLogBaseAddr (uint32_t base) |
FIXME_docs. | |
void | SetLogBaseData (uint32_t base) |
FIXME_docs. | |
void | SetLogBaseStat (uint32_t base) |
FIXME_docs. | |
void | SetPrintLevel (uint32_t lvl) |
FIXME_docs. | |
void | SetDumpLevel (uint32_t lvl) |
FIXME_docs. | |
void | SetTraceLevel (uint32_t lvl) |
FIXME_docs. | |
void | SetTimeout (const Rtime &timeout) |
FIXME_docs. | |
uint32_t | LogBaseAddr () const |
FIXME_docs. | |
uint32_t | LogBaseData () const |
FIXME_docs. | |
uint32_t | LogBaseStat () const |
FIXME_docs. | |
uint32_t | PrintLevel () const |
FIXME_docs. | |
uint32_t | DumpLevel () const |
FIXME_docs. | |
uint32_t | TraceLevel () const |
FIXME_docs. | |
const Rtime & | Timeout () const |
FIXME_docs. | |
bool | LogOpen (const std::string &name, RerrMsg &emsg) |
FIXME_docs. | |
void | LogUseStream (std::ostream *pstr, const std::string &name="") |
FIXME_docs. | |
RlogFile & | LogFile () const |
FIXME_docs. | |
const std::shared_ptr< RlogFile > & | LogFileSPtr () const |
FIXME_docs. | |
void | SetLogFileName (const std::string &name) |
FIXME_docs. | |
const std::string & | LogFileName () const |
FIXME_docs. | |
void | Print (std::ostream &os) const |
FIXME_docs. | |
void | Dump (std::ostream &os, int ind=0, const char *text=0, int detail=0) const |
FIXME_docs. | |
void | HandleUnsolicitedData () |
Handle unsolicited data from port. | |
Static Public Attributes | |
static const uint16_t | kRbaddr_RLCNTL = 0xffff |
rlink core reg RLCNTL | |
static const uint16_t | kRbaddr_RLSTAT = 0xfffe |
rlink core reg RLSTAT | |
static const uint16_t | kRbaddr_RLID1 = 0xfffd |
rlink core reg RLID1 | |
static const uint16_t | kRbaddr_RLID0 = 0xfffc |
rlink core reg RLID0 | |
static const uint16_t | kRbaddr_RLUA1 = 0xfffb |
rlink opt. reg RLUA1 | |
static const uint16_t | kRbaddr_RLUA0 = 0xfffa |
rlink opt. reg RLUA0 | |
static const uint16_t | kRbaddr_RMBASE = 0xffe8 |
rlink opt. rbd_rbmon | |
static const uint16_t | kRLCNTL_M_AnEna = kWBit15 |
RLCNTL: an enable. | |
static const uint16_t | kRLCNTL_M_AtoEna = kWBit14 |
RLCNTL: ato enable. | |
static const uint16_t | kRLCNTL_M_AtoVal = 0x00ff |
RLCNTL: ato value. | |
static const uint16_t | kRLSTAT_V_LCmd = 8 |
RLSTAT: lcmd. | |
static const uint16_t | kRLSTAT_B_LCmd = 0x00ff |
RLSTAT: lcmd. | |
static const uint16_t | kRLSTAT_M_BAbo = kWBit07 |
RLSTAT: babo. | |
static const uint16_t | kRLSTAT_M_RBSize = 0x0007 |
RLSTAT: rbuf size. | |
static const uint16_t | kSBCNTL_V_RLMON = 15 |
SBCNTL: rlmon enable bit. | |
static const uint16_t | kSBCNTL_V_RLBMON = 14 |
SBCNTL: rlbmon enable bit. | |
static const uint16_t | kSBCNTL_V_RBMON = 13 |
SBCNTL: rbmon enable bit. | |
static const uint16_t | kRbufBlkDelta =16 |
rbuf needed for rblk or wblk | |
static const uint16_t | kRbufPrudentDelta =512 |
Rbuf space reserve. | |
Static Public Attributes inherited from Retro::Rbits | |
static const uint8_t | kBBit00 = 1u<< 0 |
static const uint8_t | kBBit01 = 1u<< 1 |
static const uint8_t | kBBit02 = 1u<< 2 |
static const uint8_t | kBBit03 = 1u<< 3 |
static const uint8_t | kBBit04 = 1u<< 4 |
static const uint8_t | kBBit05 = 1u<< 5 |
static const uint8_t | kBBit06 = 1u<< 6 |
static const uint8_t | kBBit07 = 1u<< 7 |
static const uint16_t | kWBit00 = 1u<< 0 |
static const uint16_t | kWBit01 = 1u<< 1 |
static const uint16_t | kWBit02 = 1u<< 2 |
static const uint16_t | kWBit03 = 1u<< 3 |
static const uint16_t | kWBit04 = 1u<< 4 |
static const uint16_t | kWBit05 = 1u<< 5 |
static const uint16_t | kWBit06 = 1u<< 6 |
static const uint16_t | kWBit07 = 1u<< 7 |
static const uint16_t | kWBit08 = 1u<< 8 |
static const uint16_t | kWBit09 = 1u<< 9 |
static const uint16_t | kWBit10 = 1u<<10 |
static const uint16_t | kWBit11 = 1u<<11 |
static const uint16_t | kWBit12 = 1u<<12 |
static const uint16_t | kWBit13 = 1u<<13 |
static const uint16_t | kWBit14 = 1u<<14 |
static const uint16_t | kWBit15 = 1u<<15 |
static const uint32_t | kLBit00 = 1u<< 0 |
static const uint32_t | kLBit01 = 1u<< 1 |
static const uint32_t | kLBit02 = 1u<< 2 |
static const uint32_t | kLBit03 = 1u<< 3 |
static const uint32_t | kLBit04 = 1u<< 4 |
static const uint32_t | kLBit05 = 1u<< 5 |
static const uint32_t | kLBit06 = 1u<< 6 |
static const uint32_t | kLBit07 = 1u<< 7 |
static const uint32_t | kLBit08 = 1u<< 8 |
static const uint32_t | kLBit09 = 1u<< 9 |
static const uint32_t | kLBit10 = 1u<<10 |
static const uint32_t | kLBit11 = 1u<<11 |
static const uint32_t | kLBit12 = 1u<<12 |
static const uint32_t | kLBit13 = 1u<<13 |
static const uint32_t | kLBit14 = 1u<<14 |
static const uint32_t | kLBit15 = 1u<<15 |
static const uint32_t | kLBit16 = 1u<<16 |
static const uint32_t | kLBit17 = 1u<<17 |
static const uint32_t | kLBit18 = 1u<<18 |
static const uint32_t | kLBit19 = 1u<<19 |
static const uint32_t | kLBit20 = 1u<<20 |
static const uint32_t | kLBit21 = 1u<<21 |
static const uint32_t | kLBit22 = 1u<<22 |
static const uint32_t | kLBit23 = 1u<<23 |
static const uint32_t | kLBit24 = 1u<<24 |
static const uint32_t | kLBit25 = 1u<<25 |
static const uint32_t | kLBit26 = 1u<<26 |
static const uint32_t | kLBit27 = 1u<<27 |
static const uint32_t | kLBit28 = 1u<<28 |
static const uint32_t | kLBit29 = 1u<<29 |
static const uint32_t | kLBit30 = 1u<<30 |
static const uint32_t | kLBit31 = 1u<<31 |
Protected Member Functions | |
bool | ExecPart (RlinkCommandList &clist, size_t ibeg, size_t iend, RerrMsg &emsg) |
FIXME_docs. | |
void | EncodeRequest (RlinkCommandList &clist, size_t ibeg, size_t iend) |
FIXME_docs. | |
int | DecodeResponse (RlinkCommandList &clist, size_t ibeg, size_t iend) |
FIXME_docs. | |
bool | DecodeAttnNotify (uint16_t &apat) |
Decodes an attention notify packet. | |
bool | ReadResponse (const Rtime &timeout, RerrMsg &emsg) |
Read data from port until complete response packet seen. | |
void | AcceptResponse () |
Accept response packet received with ReadResponse(). | |
void | ProcessUnsolicitedData () |
Process data still pending in the input buffer. | |
void | ProcessAttnNotify () |
Process attention notify packets. | |
void | BadPort (const char *meth) |
Port not connected or not open abort. | |
Protected Attributes | |
RlinkPort::port_uptr_t | fupPort |
uptr to port | |
bool | fLinkInitDeferred |
noinit attr seen on Open | |
bool | fLinkInitDone |
LinkInit done. | |
RlinkServer * | fpServ |
ptr to server (optional) | |
uint8_t | fSeqNumber [8] |
command sequence number | |
RlinkPacketBufSnd | fSndPkt |
send packet buffer | |
RlinkPacketBufRcv | fRcvPkt |
receive packet buffer | |
RlinkContext | fContext |
default context | |
RlinkAddrMap | fAddrMap |
name<->address mapping | |
Rstats | fStats |
statistics | |
uint32_t | fLogBaseAddr |
log: base for addr | |
uint32_t | fLogBaseData |
log: base for data | |
uint32_t | fLogBaseStat |
log: base for stat | |
uint32_t | fPrintLevel |
print 0=off,1=err,2=chk,3=all | |
uint32_t | fDumpLevel |
dump 0=off,1=err,2=chk,3=all | |
uint32_t | fTraceLevel |
trace 0=off,1=buf,2=char | |
Rtime | fTimeout |
response timeout | |
std::shared_ptr< RlogFile > | fspLog |
log file ptr | |
std::recursive_mutex | fConnectMutex |
mutex to lock whole connect | |
uint16_t | fAttnNotiPatt |
attn notifier pattern | |
Rtime | fTsLastAttnNoti |
time stamp last attn notify | |
uint32_t | fSysId |
SYSID of connected device. | |
uint32_t | fUsrAcc |
USR_ACCESS of connected device. | |
size_t | fRbufSize |
Rbuf size (in bytes) | |
bool | fHasRbmon |
has rbd_rbmon (rbus monitor) | |
FIXME_docs.
Definition at line 76 of file RlinkConnect.hpp.
Enumerator | |
---|---|
kStatNExec | Exec() calls. |
kStatNExecPart | ExecPart() calls. |
kStatNCmd | commands executed |
kStatNRreg | rreg commands |
kStatNRblk | rblk commands |
kStatNWreg | wreg commands |
kStatNWblk | wblk commands |
kStatNLabo | labo commands |
kStatNAttn | attn commands |
kStatNInit | init commands |
kStatNRblkWord | words rcvd with rblk |
kStatNWblkWord | words send with wblk |
kStatNExpData | expect for data defined |
kStatNExpDone | expect for done defined |
kStatNExpStat | expect for stat explicit |
kStatNNoExpStat | no expect for stat |
kStatNChkData | expect data failed |
kStatNChkDone | expect done failed |
kStatNChkStat | expect stat failed |
kStatNSndOob | SndOob() calls. |
kStatNErrMiss | decode: missing data |
kStatNErrCmd | decode: command mismatch |
kStatNErrLen | decode: length mismatch |
kStatNErrCrc | decode: crc mismatch |
kStatNErrNak | decode: nak seen |
kDimStat |
Definition at line 196 of file RlinkConnect.hpp.
Retro::RlinkConnect::RlinkConnect | ( | ) |
Default constructor.
Definition at line 100 of file RlinkConnect.cpp.
References Retro::Rstats::Define(), fContext, fStats, Retro::RlinkCommand::kStat_M_RbErr, Retro::RlinkCommand::kStat_M_RbNak, Retro::RlinkCommand::kStat_M_RbTout, kStatNAttn, kStatNChkData, kStatNChkDone, kStatNChkStat, kStatNCmd, kStatNErrCmd, kStatNErrCrc, kStatNErrLen, kStatNErrMiss, kStatNErrNak, kStatNExec, kStatNExecPart, kStatNExpData, kStatNExpDone, kStatNExpStat, kStatNInit, kStatNLabo, kStatNNoExpStat, kStatNRblk, kStatNRblkWord, kStatNRreg, kStatNSndOob, kStatNWblk, kStatNWblkWord, kStatNWreg, and Retro::RlinkContext::SetStatus().
Retro::RlinkConnect::~RlinkConnect | ( | ) |
Destructor.
Definition at line 162 of file RlinkConnect.cpp.
References Retro::Rtools::Catch2Cerr(), and Close().
|
delete |
|
delete |
bool Retro::RlinkConnect::Open | ( | const std::string & | name, |
RerrMsg & | emsg | ||
) |
FIXME_docs.
Definition at line 170 of file RlinkConnect.cpp.
References Close(), fLinkInitDone, fRbufSize, fSndPkt, fspLog, fSysId, fTraceLevel, fupPort, fUsrAcc, HasPort(), LinkInit(), Retro::RlinkPortFactory::Open(), Port(), Retro::RlinkPort::SetLogFile(), Retro::RlinkPort::SetTraceLevel(), and Retro::RlinkPacketBufSnd::SetXonEscape().
void Retro::RlinkConnect::Close | ( | ) |
FIXME_docs.
Definition at line 200 of file RlinkConnect.cpp.
References fpServ, fSndPkt, fupPort, HasPort(), IsOpen(), Port(), Retro::RlinkPacketBufSnd::SndKeep(), and Retro::RlinkServer::Stop().
Referenced by Retro::RtclRlinkConnect::M_close(), Open(), and ~RlinkConnect().
|
inline |
FIXME_docs.
Definition at line 37 of file RlinkConnect.ipp.
References fupPort.
Referenced by Close(), Exec(), ExecPart(), HandleUnsolicitedData(), Retro::RtclRlinkConnect::M_open(), ReadResponse(), SndAttn(), SndOob(), and WaitAttn().
|
inline |
FIXME_docs.
Definition at line 45 of file RlinkConnect.ipp.
References fupPort.
Referenced by Close(), Dump(), Open(), and SetTraceLevel().
|
inline |
FIXME_docs.
Definition at line 53 of file RlinkConnect.ipp.
References fupPort.
Referenced by Close(), Dump(), ExecPart(), HandleUnsolicitedData(), Retro::RtclRlinkConnect::M_open(), Open(), ReadResponse(), SetTraceLevel(), SndAttn(), SndOob(), and WaitAttn().
|
inline |
bool Retro::RlinkConnect::LinkInit | ( | RerrMsg & | emsg | ) |
FIXME_docs.
Definition at line 219 of file RlinkConnect.cpp.
References AddrMapInsert(), Retro::RlinkCommandList::AddRreg(), Exec(), fHasRbmon, fLinkInitDone, fRbufSize, fSysId, fUsrAcc, kRbaddr_RLCNTL, kRbaddr_RLID0, kRbaddr_RLID1, kRbaddr_RLSTAT, kRbaddr_RLUA0, kRbaddr_RLUA1, kRbaddr_RMBASE, kRLSTAT_M_RBSize, Retro::RlinkCommand::kStat_M_RbErr, Retro::RlinkCommand::kStat_M_RbNak, Retro::RlinkCommand::kStat_M_RbTout, and Retro::RlinkCommandList::SetLastExpectStatus().
Referenced by Open().
|
inline |
FIXME_docs.
Definition at line 69 of file RlinkConnect.ipp.
References fLinkInitDone.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 77 of file RlinkConnect.ipp.
References fContext.
Referenced by Retro::RtclRlinkConnect::M_errcnt(), Retro::RtclRlinkConnect::M_rawrblk(), Retro::RtclRw11Cpu::M_wtcpu(), Retro::RtclRlinkConnect::M_wtlam(), and Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
|
inline |
bool Retro::RlinkConnect::ServerActive | ( | ) | const |
Indicates whether server is active.
true
if server active. Definition at line 283 of file RlinkConnect.cpp.
References fpServ, and Retro::RlinkServer::IsActive().
Referenced by ProcessAttnNotify().
bool Retro::RlinkConnect::ServerActiveInside | ( | ) | const |
Indicates whether server is active and caller is inside server thread.
true
if server active and method is called from server thread. Definition at line 294 of file RlinkConnect.cpp.
References fpServ, and Retro::RlinkServer::IsActiveInside().
Referenced by HandleUnsolicitedData().
bool Retro::RlinkConnect::ServerActiveOutside | ( | ) | const |
Indicates whether server is active and caller is outside server thread.
true
if server active and method is called from a thread other than the server thread. Definition at line 306 of file RlinkConnect.cpp.
References fpServ, and Retro::RlinkServer::IsActiveOutside().
Referenced by Exec(), and WaitAttn().
void Retro::RlinkConnect::lock | ( | ) |
FIXME_docs.
Definition at line 314 of file RlinkConnect.cpp.
References fConnectMutex.
Referenced by Exec(), HandleUnsolicitedData(), SndAttn(), SndOob(), and WaitAttn().
bool Retro::RlinkConnect::try_lock | ( | ) |
void Retro::RlinkConnect::unlock | ( | ) |
|
inline |
FIXME_docs.
Definition at line 101 of file RlinkConnect.ipp.
References Exec(), and fContext.
Referenced by Retro::RlinkServer::Exec(), Exec(), LinkInit(), and Retro::Rw11Cpu::SetupOpt().
bool Retro::RlinkConnect::Exec | ( | RlinkCommandList & | clist, |
RlinkContext & | cntx, | ||
RerrMsg & | emsg | ||
) |
FIXME_docs.
Definition at line 340 of file RlinkConnect.cpp.
References AddrMap(), Retro::RlinkCommand::ClearFlagBit(), Retro::RlinkCommandList::ClearLaboIndex(), Retro::RlinkCommand::Command(), Retro::RlinkCommandList::Dump(), ExecPart(), Retro::RlinkCommand::ExpectStatusSet(), fDumpLevel, fLogBaseAddr, fLogBaseData, fLogBaseStat, fPrintLevel, fspLog, fStats, Retro::Rstats::Inc(), Retro::RlinkContext::IncErrorCount(), IsOpen(), Retro::RlinkCommand::kCmdAttn, Retro::RlinkCommand::kCmdInit, Retro::RlinkCommand::kFlagChkData, Retro::RlinkCommand::kFlagChkDone, Retro::RlinkCommand::kFlagChkStat, Retro::RlinkCommand::kFlagDone, Retro::RlinkCommand::kFlagErrDec, Retro::RlinkCommand::kFlagErrNak, Retro::RlinkCommand::kFlagInit, Retro::RlinkCommand::kFlagLabo, Retro::RlinkCommand::kFlagPktBeg, Retro::RlinkCommand::kFlagPktEnd, Retro::RlinkCommand::kFlagSend, kStatNExec, lock(), Retro::RlinkCommandList::Print(), ServerActiveOutside(), Retro::RlinkCommand::SetExpectStatusDefault(), Retro::RlinkCommandList::Size(), Retro::RlinkContext::StatusMask(), Retro::RlinkContext::StatusValue(), and Retro::RlinkCommand::TestFlagAny().
|
inline |
void Retro::RlinkConnect::Exec | ( | RlinkCommandList & | clist, |
RlinkContext & | cntx | ||
) |
FIXME_docs.
Definition at line 440 of file RlinkConnect.cpp.
References Retro::RlinkCommandList::Dump(), Exec(), and fspLog.
int Retro::RlinkConnect::WaitAttn | ( | const Rtime & | timeout, |
Rtime & | twait, | ||
uint16_t & | apat, | ||
RerrMsg & | emsg | ||
) |
Wait for an attention notify.
First checks whether there are received and not yet harvested notifies. In that case the cummulative pattern of these pending notifies is returned in apat, and a 0 return value.
If a positive timeout is specified the method waits this long for a valid and non-zero attention notify.
timeout | maximal time to wait. Must be non-negative. A zero timeout can be used to only harvest pending notifies without waiting for new ones. | |
[out] | twait | wait time |
[out] | apat | cummulative attention pattern |
[out] | emsg | contains error description (mainly from port layer) |
Rexception | if called outside of an active server |
false
. Definition at line 484 of file RlinkConnect.cpp.
References Retro::RlinkPacketBufRcv::AcceptPacket(), BadPort(), Retro::Rtime::Clear(), fAttnNotiPatt, fRcvPkt, fspLog, Retro::Rtime::GetClock(), IsOpen(), Retro::Rtime::IsPositive(), Retro::RlinkPort::kErr, Retro::RlinkPacketBufRcv::kPktAttn, Retro::RlinkPacketBufRcv::kPktPend, Retro::RlinkPort::kTout, lock(), Retro::RlinkPacketBufRcv::PacketState(), Port(), ProcessAttnNotify(), Retro::RlinkPacketBufRcv::ProcessData(), Retro::RlinkPacketBufRcv::ReadData(), and ServerActiveOutside().
Referenced by Retro::RtclRw11Cpu::M_wtcpu(), and Retro::RtclRlinkConnect::M_wtlam().
bool Retro::RlinkConnect::SndOob | ( | uint16_t | addr, |
uint16_t | data, | ||
RerrMsg & | emsg | ||
) |
FIXME_docs.
Definition at line 543 of file RlinkConnect.cpp.
References BadPort(), fSndPkt, fStats, Retro::Rstats::Inc(), IsOpen(), kStatNSndOob, lock(), Port(), and Retro::RlinkPacketBufSnd::SndOob().
bool Retro::RlinkConnect::SndAttn | ( | RerrMsg & | emsg | ) |
FIXME_docs.
Definition at line 554 of file RlinkConnect.cpp.
References BadPort(), fSndPkt, IsOpen(), lock(), Port(), and Retro::RlinkPacketBufSnd::SndAttn().
|
inline |
FIXME_docs.
Definition at line 116 of file RlinkConnect.ipp.
References fSysId.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 123 of file RlinkConnect.ipp.
References fUsrAcc.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 130 of file RlinkConnect.ipp.
References fRbufSize.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 137 of file RlinkConnect.ipp.
References fRbufSize, and kRbufBlkDelta.
Referenced by Retro::Rw11Cpu::AddRMem(), Retro::Rw11Cpu::AddWMem(), Retro::RtclRw11Cpu::M_ldasm(), and Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 144 of file RlinkConnect.ipp.
References fRbufSize, and kRbufPrudentDelta.
Referenced by Retro::Rw11Cpu::MemRead(), Retro::Rw11Cpu::MemWrite(), Retro::RtclRlinkConnect::RtclRlinkConnect(), Retro::Rw11Rdma::SetChunkSize(), and Retro::Rw11Rdma::SetupRdma().
|
inline |
FIXME_docs.
Definition at line 151 of file RlinkConnect.ipp.
References fHasRbmon.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 159 of file RlinkConnect.ipp.
References fAddrMap, and Retro::RlinkAddrMap::Insert().
Referenced by Retro::Rw11Cpu::AllIAddrMapInsert(), Retro::Rw11Cpu::AllRAddrMapInsert(), LinkInit(), and Retro::RtclRlinkConnect::M_amap().
|
inline |
FIXME_docs.
Definition at line 167 of file RlinkConnect.ipp.
References Retro::RlinkAddrMap::Erase(), and fAddrMap.
|
inline |
FIXME_docs.
Definition at line 175 of file RlinkConnect.ipp.
References Retro::RlinkAddrMap::Erase(), and fAddrMap.
|
inline |
FIXME_docs.
Definition at line 183 of file RlinkConnect.ipp.
References Retro::RlinkAddrMap::Clear(), and fAddrMap.
Referenced by Retro::RtclRlinkConnect::M_amap().
|
inline |
FIXME_docs.
Definition at line 191 of file RlinkConnect.ipp.
References fAddrMap.
Referenced by Exec(), Retro::RtclRlinkConnect::M_amap(), and Retro::RtclRw11Cpu::M_rmap().
|
inline |
|
inline |
FIXME_docs.
Definition at line 207 of file RlinkConnect.ipp.
References fSndPkt, and Retro::RlinkPacketBuf::Stats().
|
inline |
FIXME_docs.
Definition at line 215 of file RlinkConnect.ipp.
References fRcvPkt, and Retro::RlinkPacketBuf::Stats().
void Retro::RlinkConnect::SetLogBaseAddr | ( | uint32_t | base | ) |
FIXME_docs.
Definition at line 564 of file RlinkConnect.cpp.
References fLogBaseAddr.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
void Retro::RlinkConnect::SetLogBaseData | ( | uint32_t | base | ) |
FIXME_docs.
Definition at line 576 of file RlinkConnect.cpp.
References fLogBaseData.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
void Retro::RlinkConnect::SetLogBaseStat | ( | uint32_t | base | ) |
FIXME_docs.
Definition at line 588 of file RlinkConnect.cpp.
References fLogBaseStat.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
void Retro::RlinkConnect::SetPrintLevel | ( | uint32_t | lvl | ) |
FIXME_docs.
Definition at line 600 of file RlinkConnect.cpp.
References fPrintLevel.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
void Retro::RlinkConnect::SetDumpLevel | ( | uint32_t | lvl | ) |
FIXME_docs.
Definition at line 609 of file RlinkConnect.cpp.
References fDumpLevel.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
void Retro::RlinkConnect::SetTraceLevel | ( | uint32_t | lvl | ) |
FIXME_docs.
Definition at line 618 of file RlinkConnect.cpp.
References fTraceLevel, HasPort(), Port(), and Retro::RlinkPort::SetTraceLevel().
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
void Retro::RlinkConnect::SetTimeout | ( | const Rtime & | timeout | ) |
FIXME_docs.
Definition at line 628 of file RlinkConnect.cpp.
References fTimeout, and Retro::Rtime::IsPositive().
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 223 of file RlinkConnect.ipp.
References fLogBaseAddr.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 231 of file RlinkConnect.ipp.
References fLogBaseData.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 239 of file RlinkConnect.ipp.
References fLogBaseStat.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 247 of file RlinkConnect.ipp.
References fPrintLevel.
Referenced by Retro::RtclRlinkConnect::M_default(), and Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 255 of file RlinkConnect.ipp.
References fDumpLevel.
Referenced by Retro::RtclRlinkConnect::M_default(), and Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 263 of file RlinkConnect.ipp.
References fTraceLevel.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 271 of file RlinkConnect.ipp.
References fTimeout.
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
bool Retro::RlinkConnect::LogOpen | ( | const std::string & | name, |
RerrMsg & | emsg | ||
) |
FIXME_docs.
Definition at line 640 of file RlinkConnect.cpp.
References fspLog.
Referenced by SetLogFileName().
void Retro::RlinkConnect::LogUseStream | ( | std::ostream * | pstr, |
const std::string & | name = "" |
||
) |
|
inline |
FIXME_docs.
Definition at line 279 of file RlinkConnect.ipp.
References fspLog.
Referenced by LogFileName(), Retro::RtclRlinkConnect::M_default(), and Retro::RtclRlinkConnect::M_log().
|
inline |
void Retro::RlinkConnect::SetLogFileName | ( | const std::string & | name | ) |
FIXME_docs.
Definition at line 661 of file RlinkConnect.cpp.
References LogOpen(), and Retro::RerrMsg::Text().
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
|
inline |
FIXME_docs.
Definition at line 295 of file RlinkConnect.ipp.
References LogFile(), and Retro::RlogFile::Name().
Referenced by Retro::RtclRlinkConnect::RtclRlinkConnect().
void Retro::RlinkConnect::Print | ( | std::ostream & | os | ) | const |
FIXME_docs.
Definition at line 674 of file RlinkConnect.cpp.
Referenced by Retro::RtclRlinkConnect::M_print().
void Retro::RlinkConnect::Dump | ( | std::ostream & | os, |
int | ind = 0 , |
||
const char * | text = 0 , |
||
int | detail = 0 |
||
) | const |
FIXME_docs.
Definition at line 683 of file RlinkConnect.cpp.
References Retro::RlinkAddrMap::Dump(), Retro::RlinkContext::Dump(), Retro::RlinkPacketBufRcv::Dump(), Retro::RlinkPacketBufSnd::Dump(), Retro::RlinkPort::Dump(), Retro::Rstats::Dump(), fAddrMap, fAttnNotiPatt, fContext, fDumpLevel, fLinkInitDeferred, fLinkInitDone, fLogBaseAddr, fLogBaseData, fLogBaseStat, fPrintLevel, fpServ, fRbufSize, fRcvPkt, fSeqNumber, fSndPkt, fspLog, fStats, fSysId, fTraceLevel, fTsLastAttnNoti, fupPort, fUsrAcc, HasPort(), Port(), and Retro::RosPrintf().
Referenced by Retro::RtclRlinkConnect::M_dump().
void Retro::RlinkConnect::HandleUnsolicitedData | ( | ) |
Handle unsolicited data from port.
Called by RlinkServer to process unsolicited input data. Will read all pending data from input port and process it with ProcessUnsolicitedData().
Rexception | if not called from inside of an active server |
true
. Definition at line 735 of file RlinkConnect.cpp.
References BadPort(), fRcvPkt, fspLog, IsOpen(), lock(), Port(), ProcessUnsolicitedData(), Retro::RlinkPacketBufRcv::ReadData(), and ServerActiveInside().
|
protected |
FIXME_docs.
Definition at line 757 of file RlinkConnect.cpp.
References AcceptResponse(), DecodeResponse(), Retro::RlinkCommandList::Dump(), EncodeRequest(), fSndPkt, fStats, fTimeout, Retro::Rstats::Inc(), IsOpen(), kStatNExecPart, Port(), ReadResponse(), Retro::RlinkCommandList::Size(), and Retro::RlinkPacketBufSnd::SndPacket().
Referenced by Exec().
|
protected |
FIXME_docs.
Definition at line 791 of file RlinkConnect.cpp.
References Retro::RlinkCommand::Address(), Retro::RlinkCommand::BlockPointer(), Retro::RlinkCommand::BlockSize(), Retro::RlinkCommand::ClearFlagBit(), Retro::RlinkCommand::Command(), Retro::RlinkCommand::Data(), fSeqNumber, fSndPkt, fStats, Retro::Rstats::Inc(), Retro::RlinkPacketBufSnd::Init(), Retro::RlinkCommand::kCmdAttn, Retro::RlinkCommand::kCmdInit, Retro::RlinkCommand::kCmdLabo, Retro::RlinkCommand::kCmdRblk, Retro::RlinkCommand::kCmdRreg, Retro::RlinkCommand::kCmdWblk, Retro::RlinkCommand::kCmdWreg, Retro::RlinkCommand::kFlagPktBeg, Retro::RlinkCommand::kFlagPktEnd, Retro::RlinkCommand::kFlagSend, kStatNAttn, kStatNCmd, kStatNInit, kStatNLabo, kStatNRblk, kStatNRblkWord, kStatNRreg, kStatNWblk, kStatNWblkWord, kStatNWreg, Retro::RlinkPacketBufSnd::PutCrc(), Retro::RlinkPacketBufSnd::PutWithCrc(), Retro::RlinkCommand::Request(), Retro::RlinkCommand::SetFlagBit(), Retro::RlinkCommand::SetRcvSize(), and Retro::RlinkCommand::SetSeqNumber().
Referenced by ExecPart().
|
protected |
FIXME_docs.
Definition at line 875 of file RlinkConnect.cpp.
References Retro::RlinkCommand::BlockDone(), Retro::RlinkCommand::BlockPointer(), Retro::RlinkCommand::BlockSize(), Retro::RlinkPacketBufRcv::CheckCrc(), Retro::RlinkPacketBufRcv::CheckNak(), Retro::RlinkPacketBufRcv::CheckSize(), Retro::RlinkCommand::Command(), Retro::RlinkCommand::Data(), Retro::RlinkCommand::Expect(), Retro::RlinkCommand::ExpectStatusSet(), fRcvPkt, fspLog, fStats, Retro::RlinkPacketBufRcv::GetWithCrc(), Retro::RlinkCommand::HasExpect(), Retro::Rstats::Inc(), Retro::RlinkCommand::kCmdAttn, Retro::RlinkCommand::kCmdInit, Retro::RlinkCommand::kCmdLabo, Retro::RlinkCommand::kCmdRblk, Retro::RlinkCommand::kCmdRreg, Retro::RlinkCommand::kCmdWblk, Retro::RlinkCommand::kCmdWreg, Retro::RlinkCommand::kFlagChkData, Retro::RlinkCommand::kFlagChkDone, Retro::RlinkCommand::kFlagChkStat, Retro::RlinkCommand::kFlagDone, Retro::RlinkCommand::kFlagErrDec, Retro::RlinkCommand::kFlagErrNak, Retro::RlinkCommand::kFlagLabo, Retro::RlinkPacketBuf::kNcCcrc, Retro::RlinkPacketBuf::kNcCmd, Retro::RlinkPacketBuf::kNcCnt, Retro::RlinkPacketBuf::kNcDcrc, Retro::RlinkPacketBuf::kNcFrame, Retro::RlinkPacketBuf::kNcInval, Retro::RlinkPacketBuf::kNcRtOvlf, Retro::RlinkPacketBuf::kNcRtWblk, Retro::RlinkPacketBuf::kNcUnused, kStatNChkData, kStatNChkDone, kStatNChkStat, kStatNErrCmd, kStatNErrCrc, kStatNErrLen, kStatNErrMiss, kStatNErrNak, kStatNExpData, kStatNExpDone, kStatNExpStat, kStatNNoExpStat, Retro::RlinkCommandList::LaboActive(), Retro::RlinkPacketBufRcv::NakCode(), Retro::RlinkCommand::RcvSize(), Retro::RlinkCommand::Request(), Retro::RlinkCommand::SetBlockDone(), Retro::RlinkCommand::SetData(), Retro::RlinkCommand::SetFlagBit(), Retro::RlinkCommandList::SetLaboIndex(), Retro::RlinkCommand::SetStatus(), Retro::RlinkCommand::StatusCheck(), and Retro::RlinkCommand::StatusIsChecked().
Referenced by ExecPart().
|
protected |
Decodes an attention notify packet.
[out] | apat | attention pattern, can be zero |
true
if decode without errors, false
otherwise Definition at line 1047 of file RlinkConnect.cpp.
References Retro::RlinkPacketBufRcv::CheckCrc(), Retro::RlinkPacketBufRcv::CheckSize(), fRcvPkt, fspLog, fStats, Retro::RlinkPacketBufRcv::GetWithCrc(), Retro::Rstats::Inc(), kStatNErrCrc, and kStatNErrMiss.
Referenced by ProcessAttnNotify().
Read data from port until complete response packet seen.
Any spurious data or corrupt packages, e.g. with framing errors, are logged and discarded.
If an attention notify packet is detected it will handled with ProcessAttnNotify().
The method returns true
if a complete response packet is received. The caller will usually use DecodeResponse() and must accept the packet with AcceptResponse() afterwards.
The method returns false
if
An appropriate log message is generated, any partial input packet discarded.
timeout | maximal time to wait for input in sec. Must be > 0. | |
[out] | emsg | contains error description (mainly from port layer) |
true
if complete response packet receivedDefinition at line 1099 of file RlinkConnect.cpp.
References Retro::RlinkPacketBufRcv::AcceptPacket(), BadPort(), fRcvPkt, fspLog, Retro::Rtime::GetClock(), IsOpen(), Retro::RlinkPacketBufRcv::kPktAttn, Retro::RlinkPacketBufRcv::kPktPend, Retro::RlinkPacketBufRcv::kPktResp, Retro::RlinkPacketBufRcv::PacketState(), Port(), ProcessAttnNotify(), Retro::RlinkPacketBufRcv::ProcessData(), and Retro::RlinkPacketBufRcv::ReadData().
Referenced by ExecPart().
|
protected |
Accept response packet received with ReadResponse().
The packet buffer is cleared, and any still buffered input data is processed with ProcessUnsolicitedData().
Definition at line 1147 of file RlinkConnect.cpp.
References Retro::RlinkPacketBufRcv::AcceptPacket(), fRcvPkt, and ProcessUnsolicitedData().
Referenced by ExecPart().
|
protected |
Process data still pending in the input buffer.
If an attention notify packet is detected it will handled with ProcessAttnNotify(). If a response or corrupted packet is seen it will be logged and discarded.
Definition at line 1162 of file RlinkConnect.cpp.
References Retro::RlinkPacketBufRcv::AcceptPacket(), fRcvPkt, fspLog, Retro::RlinkPacketBufRcv::kPktAttn, Retro::RlinkPacketBufRcv::kPktPend, Retro::RlinkPacketBufRcv::PacketState(), ProcessAttnNotify(), and Retro::RlinkPacketBufRcv::ProcessData().
Referenced by AcceptResponse(), and HandleUnsolicitedData().
|
protected |
Process attention notify packets.
The packets is decoded with DecodeAttnNotify(). If the packet is valid and contains a non-zero attention pattern the pattern is ored to the attention notify pattern which can later be inquired with HarvestAttnNotifies(). Corrupt packets are logged and discarded. Notifies with a zero pattern are silently ignored.
Definition at line 1188 of file RlinkConnect.cpp.
References Retro::RlinkPacketBufRcv::AcceptPacket(), DecodeAttnNotify(), fAttnNotiPatt, fPrintLevel, fpServ, fRcvPkt, fspLog, fTsLastAttnNoti, Retro::Rtime::IsPositive(), Retro::RosPrintf(), ServerActive(), and Retro::RlinkServer::SignalAttnNotify().
Referenced by ProcessUnsolicitedData(), ReadResponse(), and WaitAttn().
|
protected |
Port not connected or not open abort.
Definition at line 1234 of file RlinkConnect.cpp.
Referenced by HandleUnsolicitedData(), ReadResponse(), SndAttn(), SndOob(), and WaitAttn().
|
static |
rlink core reg RLCNTL
Definition at line 168 of file RlinkConnect.hpp.
Referenced by LinkInit(), and Retro::RlinkServer::StartOrResume().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
RLCNTL: an enable.
Definition at line 176 of file RlinkConnect.hpp.
Referenced by Retro::RlinkServer::StartOrResume().
|
static |
RLCNTL: ato enable.
Definition at line 177 of file RlinkConnect.hpp.
|
static |
RLCNTL: ato value.
Definition at line 178 of file RlinkConnect.hpp.
|
static |
RLSTAT: lcmd.
Definition at line 180 of file RlinkConnect.hpp.
|
static |
RLSTAT: lcmd.
Definition at line 181 of file RlinkConnect.hpp.
|
static |
RLSTAT: babo.
Definition at line 182 of file RlinkConnect.hpp.
|
static |
|
static |
SBCNTL: rlmon enable bit.
Definition at line 185 of file RlinkConnect.hpp.
Referenced by Retro::RtclRlinkConnect::M_oob().
|
static |
SBCNTL: rlbmon enable bit.
Definition at line 186 of file RlinkConnect.hpp.
Referenced by Retro::RtclRlinkConnect::M_oob().
|
static |
SBCNTL: rbmon enable bit.
Definition at line 187 of file RlinkConnect.hpp.
Referenced by Retro::RtclRlinkConnect::M_oob().
|
static |
rbuf needed for rblk or wblk
Definition at line 191 of file RlinkConnect.hpp.
Referenced by BlockSizeMax().
|
static |
Rbuf space reserve.
Definition at line 193 of file RlinkConnect.hpp.
Referenced by BlockSizePrudent().
|
protected |
|
protected |
|
protected |
LinkInit done.
Definition at line 243 of file RlinkConnect.hpp.
Referenced by Dump(), LinkInit(), LinkInitDone(), and Open().
|
protected |
ptr to server (optional)
Definition at line 244 of file RlinkConnect.hpp.
Referenced by Close(), Dump(), ProcessAttnNotify(), Server(), ServerActive(), ServerActiveInside(), ServerActiveOutside(), and SetServer().
|
protected |
command sequence number
Definition at line 245 of file RlinkConnect.hpp.
Referenced by Dump(), and EncodeRequest().
|
protected |
send packet buffer
Definition at line 246 of file RlinkConnect.hpp.
Referenced by Close(), Dump(), EncodeRequest(), ExecPart(), Open(), SndAttn(), SndOob(), and SndStats().
|
protected |
receive packet buffer
Definition at line 247 of file RlinkConnect.hpp.
Referenced by AcceptResponse(), DecodeAttnNotify(), DecodeResponse(), Dump(), HandleUnsolicitedData(), ProcessAttnNotify(), ProcessUnsolicitedData(), RcvStats(), ReadResponse(), and WaitAttn().
|
protected |
default context
Definition at line 248 of file RlinkConnect.hpp.
Referenced by Context(), Dump(), Exec(), and RlinkConnect().
|
protected |
name<->address mapping
Definition at line 249 of file RlinkConnect.hpp.
Referenced by AddrMap(), AddrMapClear(), AddrMapErase(), AddrMapInsert(), and Dump().
|
protected |
statistics
Definition at line 250 of file RlinkConnect.hpp.
Referenced by DecodeAttnNotify(), DecodeResponse(), Dump(), EncodeRequest(), Exec(), ExecPart(), RlinkConnect(), SndOob(), and Stats().
|
protected |
log: base for addr
Definition at line 251 of file RlinkConnect.hpp.
Referenced by Dump(), Exec(), LogBaseAddr(), and SetLogBaseAddr().
|
protected |
log: base for data
Definition at line 252 of file RlinkConnect.hpp.
Referenced by Dump(), Exec(), LogBaseData(), and SetLogBaseData().
|
protected |
log: base for stat
Definition at line 253 of file RlinkConnect.hpp.
Referenced by Dump(), Exec(), LogBaseStat(), and SetLogBaseStat().
|
protected |
print 0=off,1=err,2=chk,3=all
Definition at line 254 of file RlinkConnect.hpp.
Referenced by Dump(), Exec(), PrintLevel(), ProcessAttnNotify(), and SetPrintLevel().
|
protected |
dump 0=off,1=err,2=chk,3=all
Definition at line 255 of file RlinkConnect.hpp.
Referenced by Dump(), DumpLevel(), Exec(), and SetDumpLevel().
|
protected |
trace 0=off,1=buf,2=char
Definition at line 256 of file RlinkConnect.hpp.
Referenced by Dump(), Open(), SetTraceLevel(), and TraceLevel().
|
protected |
response timeout
Definition at line 257 of file RlinkConnect.hpp.
Referenced by ExecPart(), SetTimeout(), and Timeout().
|
protected |
log file ptr
Definition at line 258 of file RlinkConnect.hpp.
Referenced by DecodeAttnNotify(), DecodeResponse(), Dump(), Exec(), HandleUnsolicitedData(), LogFile(), LogFileSPtr(), LogOpen(), LogUseStream(), Open(), ProcessAttnNotify(), ProcessUnsolicitedData(), ReadResponse(), and WaitAttn().
|
protected |
mutex to lock whole connect
Definition at line 259 of file RlinkConnect.hpp.
Referenced by lock(), try_lock(), and unlock().
|
protected |
attn notifier pattern
Definition at line 260 of file RlinkConnect.hpp.
Referenced by Dump(), ProcessAttnNotify(), and WaitAttn().
|
protected |
time stamp last attn notify
Definition at line 261 of file RlinkConnect.hpp.
Referenced by Dump(), and ProcessAttnNotify().
|
protected |
SYSID of connected device.
Definition at line 262 of file RlinkConnect.hpp.
Referenced by Dump(), LinkInit(), Open(), and SysId().
|
protected |
USR_ACCESS of connected device.
Definition at line 263 of file RlinkConnect.hpp.
Referenced by Dump(), LinkInit(), Open(), and UsrAcc().
|
protected |
Rbuf size (in bytes)
Definition at line 264 of file RlinkConnect.hpp.
Referenced by BlockSizeMax(), BlockSizePrudent(), Dump(), LinkInit(), Open(), and RbufSize().
|
protected |
has rbd_rbmon (rbus monitor)
Definition at line 265 of file RlinkConnect.hpp.
Referenced by HasRbmon(), and LinkInit().