77 const uint16_t* pend = pdata + count;
97 for (
size_t i=0; i<ni; i++) {
126 bool sndok =
SndRaw(port, emsg);
142 fRawBuf.push_back(uint8_t( addr & 0x000f));
143 fRawBuf.push_back(uint8_t((addr>>4) & 0x000f));
144 fRawBuf.push_back(uint8_t( data & 0x000f));
145 fRawBuf.push_back(uint8_t((data>>4) & 0x000f));
146 fRawBuf.push_back(uint8_t((data>>8) & 0x000f));
147 fRawBuf.push_back(uint8_t((data>>12) & 0x000f));
151 return SndRaw(port, emsg);
165 return SndRaw(port, emsg);
177 return SndRaw(port, emsg);
189 return SndRaw(port, emsg);
201 return SndRaw(port, emsg);
211 os << bl << (text?text:
"--") <<
"RlinkPacketBufSnd @ " <<
this << endl;
215 size_t rawbufsize =
fRawBuf.size();
216 os << bl <<
" fRawBuf(size): " <<
RosPrintf(rawbufsize,
"d",4);
217 size_t ncol = max(1, (80-ind-4-6)/(2+1));
218 for (
size_t i=0; i<rawbufsize; i++) {
219 if (i%ncol == 0) os <<
"\n" << bl <<
" " <<
RosPrintf(i,
"d",4) <<
": ";
234 size_t rawbufsize =
fRawBuf.size();
236 if (irc < 0)
return false;
237 if (
size_t(irc) != rawbufsize) {
238 emsg.
Init(
"RlinkPacketBufSnd::SndRaw()",
"failed to write all data");
void Init(const std::string &meth, const std::string &text)
FIXME_docs.
bool fXonEscape
escape XON/XOFF
std::vector< uint8_t > fRawBuf
raw data buffer
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
void PutWithCrc(uint8_t data)
FIXME_docs.
bool SndNak(RlinkPort &port, RerrMsg &emsg)
FIXME_docs.
@ kStatNTxPktByt
Tx packet bytes send.
@ kStatNTxEsc
Tx esc escapes.
@ kStatNTxXEsc
Tx xon escapes.
~RlinkPacketBufSnd()
Destructor.
RlinkPacketBufSnd()
Default constructor.
bool SndOob(RlinkPort &port, uint16_t addr, uint16_t data, RerrMsg &emsg)
FIXME_docs.
bool SndKeep(RlinkPort &port, RerrMsg &emsg)
FIXME_docs.
void PutRawEsc(uint8_t ec)
FIXME_docs.
bool SndPacket(RlinkPort &port, RerrMsg &emsg)
FIXME_docs.
bool SndUnJam(RlinkPort &port, RerrMsg &emsg)
FIXME_docs.
bool SndAttn(RlinkPort &port, RerrMsg &emsg)
FIXME_docs.
bool SndRaw(RlinkPort &port, RerrMsg &emsg)
FIXME_docs.
static const uint8_t kEcXon
VHDL def ec_xon 100.
static const uint8_t kSymEsc
VHDL def escape 1100 1010.
size_t PktSize() const
FIXME_docs.
static const uint8_t kEcEsc
VHDL def ec_esc 111.
RlinkCrc16 fCrc
crc accumulator
static const uint8_t kEcSop
VHDL def ec_sop 000.
std::vector< uint8_t > fPktBuf
packet buffer
static const uint8_t kEcNak
VHDL def ec_nak 010.
static const uint8_t kEcAttn
VHDL def ec_attn 011.
uint32_t fFlags
request/response flags
static const uint8_t kEcXoff
VHDL def ec_xoff 101.
static const uint8_t kSymXon
VHDL def xon 0001 0001.
static const uint8_t kEcEop
VHDL def ec_eop 001.
static const uint8_t kSymXoff
VHDL def xoff 0001 0011.
void Dump(std::ostream &os, int ind=0, const char *text=0, int detail=0) const
FIXME_docs.
virtual int Write(const uint8_t *buf, size_t size, RerrMsg &emsg)
FIXME_docs.
I/O appicator to generate fill characters.
void Inc(size_t ind, double val=1.)
FIXME_docs.
void Define(size_t ind, const std::string &name, const std::string &text)
FIXME_docs.
RosPrintfS< bool > RosPrintf(bool value, const char *form=0, int width=0, int prec=0)
Creates a print object for the formatted output of a bool value.
Declaration of class ReventLoop.