rogue
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
rogue::protocols::xilinx::XvcConnection Class Reference

Manages one TCP client connection speaking the XVC protocol. More...

#include <XvcConnection.h>

Public Member Functions

 XvcConnection (int sd, int wakeFd, JtagDriver *drv, uint64_t maxVecLen=32768)
 Accepts and initializes a new XVC TCP sub-connection.
 
virtual void fill (uint64_t n)
 Ensures at least n bytes are available in RX buffer.
 
virtual void flush ()
 Flushes pending TX buffer bytes to socket.
 
virtual void bump (uint64_t n)
 Marks n RX bytes as consumed.
 
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 count bytes, blocking in select() until either data is available on the peer socket OR the shutdown wakeFd becomes readable.
 
int lastErrno () const
 Returns errno from the most recent readTo() failure (-2 return).
 
virtual ~XvcConnection ()
 Closes this XVC TCP sub-connection.
 

Detailed Description

Manages one TCP client connection speaking the XVC protocol.

XvcConnection parses XVC commands (getinfo, settck, shift) from a connected socket, dispatches JTAG operations through JtagDriver, and sends protocol responses back to the TCP client.

Definition at line 42 of file XvcConnection.h.

Constructor & Destructor Documentation

◆ XvcConnection()

rogue::protocols::xilinx::XvcConnection::XvcConnection ( int  sd,
int  wakeFd,
JtagDriver drv,
uint64_t  maxVecLen = 32768 
)

Accepts and initializes a new XVC TCP sub-connection.

Parameters
sdListening socket descriptor.
wakeFdShutdown self-pipe read fd; when readable, readTo() returns -1 to break out of the blocking select(). Pass -1 to disable the wake path (non-production).
drvDriver used to execute JTAG operations.
maxVecLenMaximum vector length in bytes accepted from client.

Company : SLAC National Accelerator Laboratory

Description:

JTAG support

This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

Definition at line 34 of file XvcConnection.cpp.

◆ ~XvcConnection()

rogue::protocols::xilinx::XvcConnection::~XvcConnection ( )
virtual

Closes this XVC TCP sub-connection.

Definition at line 71 of file XvcConnection.cpp.

Member Function Documentation

◆ allocBufs()

void rogue::protocols::xilinx::XvcConnection::allocBufs ( )
virtual

Allocates/reinitializes internal RX/TX buffers.

Definition at line 164 of file XvcConnection.cpp.

◆ bump()

void rogue::protocols::xilinx::XvcConnection::bump ( uint64_t  n)
virtual

Marks n RX bytes as consumed.

Parameters
nNumber of bytes to consume.

Definition at line 154 of file XvcConnection.cpp.

◆ fill()

void rogue::protocols::xilinx::XvcConnection::fill ( uint64_t  n)
virtual

Ensures at least n bytes are available in RX buffer.

Parameters
nRequired number of bytes.

Definition at line 125 of file XvcConnection.cpp.

◆ flush()

void rogue::protocols::xilinx::XvcConnection::flush ( )
virtual

Flushes pending TX buffer bytes to socket.

Definition at line 195 of file XvcConnection.cpp.

◆ lastErrno()

int rogue::protocols::xilinx::XvcConnection::lastErrno ( ) const
inline

Returns errno from the most recent readTo() failure (-2 return).

Definition at line 118 of file XvcConnection.h.

◆ readTo()

ssize_t rogue::protocols::xilinx::XvcConnection::readTo ( void *  buf,
size_t  count 
)

Reads up to count bytes, blocking in select() until either data is available on the peer socket OR the shutdown wakeFd becomes readable.

Parameters
bufDestination buffer.
countMaximum bytes to read.
Returns
>0 on bytes read; 0 on peer EOF; -1 on shutdown; -2 on select/read error (errno captured in lastErrno()).

Definition at line 75 of file XvcConnection.cpp.

◆ run()

void rogue::protocols::xilinx::XvcConnection::run ( )
virtual

Runs command processing loop for this connection.

Definition at line 219 of file XvcConnection.cpp.


The documentation for this class was generated from the following files: