HosrDiretta
Loading...
Searching...
No Matches
DIRETTA::ConnectionBuffer Class Reference

Diretta ConnectionBuffer class. Used for sending and receiving messages. More...

#include <Connection.hpp>

Public Member Functions

 ConnectionBuffer (ACQUA::EthernetSocket *p)
 Constructor Receive Buffer.
 
 ConnectionBuffer (ACQUA::EthernetSocket *p, const ACQUA::IPAddress &i)
 Constructor Send Buffer.
 
 ConnectionBuffer (ACQUA::EthernetSocket *p, const ACQUA::IPAddress &i, int m)
 Constructs a ConnectionBuffer, allocating and initializing its internal buffer and setting the transmission address and mode.
 
 ConnectionBuffer (ACQUA::EthernetSocket *p, std::uint16_t ifno, const ACQUA::MACAddress &src, const ACQUA::MACAddress &dist, uint16_t t, uint8_t po)
 Constructs a ConnectionBuffer for raw mode 3 transmission, allocating and initializing its internal buffer and setting the source and destination MAC addresses, EtherType, and port.
 
 ConnectionBuffer (ACQUA::EthernetSocket *p, const ACQUA::IPAddress &i, MessageID msg, StatusID sts, uint16_t opt0, uint16_t opt1, uint16_t opt2, uint16_t opt3)
 For sending messages.
 
 ConnectionBuffer (ACQUA::EthernetSocket *p, const ACQUA::IPAddress &i, MessageID msg, StatusID sts, std::uint64_t opt)
 For sending messages.
 
 ConnectionBuffer (ACQUA::EthernetSocket *p, const ACQUA::IPAddress &i, MessageID msg, StatusID sts)
 For sending messages.
 
virtual ~ConnectionBuffer ()
 Destructor.
 
virtual void update ()
 Update internal buffer after modifying data.
 
std::uint8_t * get_data ()
 Get pointer to data area.
 
const std::uint8_t * get_data () const
 Get pointer to data area (const)
 
std::uint16_t size_data () const
 Get size of data area (no direttaheadder)
 
void fill (std::uint8_t f)
 Fill data area with specified byte value.
 
void set_str (const std::string &str)
 Set string data into the buffer.
 
void resize (std::uint16_t s)
 resize buffer for data area
 
void resize_real (std::uint16_t s)
 resize buffer for packet size (all header and data)
 
void setTo (const ACQUA::IPAddress &i)
 Set destination address.
 
 operator ACQUA::EthernetBuffer * ()
 Get Reality of Packet Data.
 
bool empty () const
 Check if the buffer is empty (NAC etc no ACK)
 
void set (MessageID, StatusID, std::uint16_t, std::uint16_t, std::uint16_t, std::uint16_t)
 Set message.
 
void set (MessageID, StatusID, std::uint64_t)
 Set message.
 
void set (MessageID, StatusID)
 Set message.
 
void statusUpdate (StatusID, StatusID)
 Update status.
 
MessageID getMessage () const
 Get message ID.
 
StatusID getStatus () const
 Get status.
 
std::uint16_t getOption0 () const
 Get option values 0.
 
std::uint16_t getOption1 () const
 Get option values 1.
 
std::uint16_t getOption2 () const
 Get option values 2.
 
std::uint16_t getOption3 () const
 Get option values 3.
 
std::uint64_t getOption () const
 Get option values 64bit.
 
bool valid () const
 Validate message.
 
void get_str (std::string &) const
 Get string data from the buffer.
 
void get_str (std::list< std::string > &) const
 Get list of strings from the buffer.
 
void get_add_str (ACQUA::IPAddress &, std::string &) const
 Get address and string from the buffer.
 
void clear ()
 Clear buffer.
 

Detailed Description

Diretta ConnectionBuffer class. Used for sending and receiving messages.

Constructor & Destructor Documentation

◆ ConnectionBuffer() [1/2]

DIRETTA::ConnectionBuffer::ConnectionBuffer ( ACQUA::EthernetSocket * p,
const ACQUA::IPAddress & i,
int m )
inline

Constructs a ConnectionBuffer, allocating and initializing its internal buffer and setting the transmission address and mode.

Parameters
pPointer to an ACQUA::EthernetSocket used to allocate the internal buffer.
iThe ACQUA::IPAddress to set as the buffer's destination/address.
mInteger specifying the MS mode to store in the ConnectionBuffer (assigned to MSmode).

◆ ConnectionBuffer() [2/2]

DIRETTA::ConnectionBuffer::ConnectionBuffer ( ACQUA::EthernetSocket * p,
std::uint16_t ifno,
const ACQUA::MACAddress & src,
const ACQUA::MACAddress & dist,
uint16_t t,
uint8_t po )
inline

Constructs a ConnectionBuffer for raw mode 3 transmission, allocating and initializing its internal buffer and setting the source and destination MAC addresses, EtherType, and port.

Parameters
pPointer to an ACQUA::EthernetSocket used to allocate the internal buffer.
ifnoThe interface number to set in the buffer's "to" field.
srcThe source ACQUA::MACAddress to set in the ConnectionBuffer.
distThe destination ACQUA::MACAddress to set in the ConnectionBuffer.
tThe EtherType to set in the ConnectionBuffer.
poThe mode 3 port number to set in the ConnectionBuffer.

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