XvcConnection
The class description is shown below:
-
class XvcConnection
Manages one TCP client connection speaking the XVC protocol.
XvcConnectionparses XVC commands (getinfo,settck,shift) from a connected socket, dispatches JTAG operations throughJtagDriver, and sends protocol responses back to the TCP client.Public Functions
-
XvcConnection(int sd, JtagDriver *drv, uint64_t maxVecLen_ = 32768)
Accepts and initializes a new XVC TCP sub-connection.
- Parameters:
sd – Listening socket descriptor.
drv – Driver used to execute JTAG operations.
maxVecLen_ – Maximum vector length in bytes accepted from client.
-
virtual void fill(uint64_t n)
Ensures at least
nbytes are available in RX buffer.- Parameters:
n – Required number of bytes.
-
virtual void flush()
Flushes pending TX buffer bytes to socket.
-
virtual void bump(uint64_t n)
Marks
nRX bytes as consumed.- Parameters:
n – Number of bytes to consume.
-
virtual void allocBufs()
Allocates/reinitializes internal RX/TX buffers.
-
virtual void run()
Runs command processing loop for this connection.
-
ssize_t readTo(void *buf, size_t count)
Reads up to
countbytes with timeout.- Parameters:
buf – Destination buffer.
count – Maximum bytes to read.
- Returns:
Number of bytes read, or
0on timeout/no data.
-
virtual ~XvcConnection()
Closes this XVC TCP sub-connection.
-
XvcConnection(int sd, JtagDriver *drv, uint64_t maxVecLen_ = 32768)