w11 - cpp 0.794
Backend server for Rlink and w11
Loading...
Searching...
No Matches
RlinkPacketBufSnd.hpp
Go to the documentation of this file.
1// $Id: RlinkPacketBufSnd.hpp 1186 2019-07-12 17:49:59Z mueller $
2// SPDX-License-Identifier: GPL-3.0-or-later
3// Copyright 2014-2018 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4//
5// Revision History:
6// Date Rev Version Comment
7// 2018-12-08 1079 1.2 use ref not ptr for RlinkPort
8// 2017-04-07 868 1.1.2 Dump(): add detail arg
9// 2015-04-11 666 1.1 handle xon/xoff escaping, add (Set)XonEscape()
10// 2014-12-25 621 1.0.1 Reorganize packet send/revd stats
11// 2014-11-14 604 1.0 Initial version
12// 2014-11-02 600 0.1 First draft (re-organize PacketBuf for rlink v4)
13// ---------------------------------------------------------------------------
14
15
20#ifndef included_Retro_RlinkPacketBufSnd
21#define included_Retro_RlinkPacketBufSnd
22
23#include "RlinkPacketBuf.hpp"
24#include "RlinkPort.hpp"
25
26namespace Retro {
27
29 public:
30
33
34 void SetXonEscape(bool xon);
35 bool XonEscape() const;
36
37 void Init();
38
39 void PutWithCrc(uint8_t data);
40 void PutWithCrc(uint16_t data);
41 void PutWithCrc(const uint16_t* pdata, size_t count);
42 void PutCrc();
43
44 void PutRawEsc(uint8_t ec);
45
46 bool SndPacket(RlinkPort& port, RerrMsg& emsg);
47 bool SndOob(RlinkPort& port, uint16_t addr, uint16_t data,
48 RerrMsg& emsg);
49 bool SndKeep(RlinkPort& port, RerrMsg& emsg);
50 bool SndAttn(RlinkPort& port, RerrMsg& emsg);
51 bool SndNak(RlinkPort& port, RerrMsg& emsg);
52 bool SndUnJam(RlinkPort& port, RerrMsg& emsg);
53
54 size_t RawSize() const;
55
56 void Dump(std::ostream& os, int ind=0, const char* text=0,
57 int detail=0) const;
58
59 // statistics counter indices
60 enum stats {
64 };
65
66 protected:
67 bool SndRaw(RlinkPort& port, RerrMsg& emsg);
68
69 protected:
71 std::vector<uint8_t> fRawBuf;
72 };
73
74} // end namespace Retro
75
76#include "RlinkPacketBufSnd.ipp"
77
78#endif
FIXME_docs.
Definition: RerrMsg.hpp:25
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.
size_t RawSize() const
FIXME_docs.
void SetXonEscape(bool xon)
FIXME_docs.
@ kStatNTxPktByt
Tx packet bytes send.
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 XonEscape() const
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.
FIXME_docs.
Definition: RlinkPort.hpp:45
Declaration of class ReventLoop.
Definition: ReventLoop.cpp:47