ngscopeclient v0.2
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
SCPITwinLanTransport Class Reference

A SCPISocketTransport plus a second socket for waveform data. More...

#include <SCPITwinLanTransport.h>

Inheritance diagram for SCPITwinLanTransport:
Inheritance graph
[legend]
Collaboration diagram for SCPITwinLanTransport:
Collaboration graph
[legend]

Public Member Functions

 SCPITwinLanTransport (const std::string &args)
 
virtual std::string GetConnectionString () override
 
unsigned short GetDataPort ()
 
virtual size_t ReadRawData (size_t len, unsigned char *buf, std::function< void(float)> progress=nullptr) override
 
virtual void SendRawData (size_t len, const unsigned char *buf) override
 
const SocketGetSecondarySocket ()
 
- Public Member Functions inherited from SCPISocketTransport
 SCPISocketTransport (const std::string &args)
 
 SCPISocketTransport (const std::string &hostname, unsigned short port)
 
virtual void FlushRXBuffer (void) override
 
virtual bool SendCommand (const std::string &cmd) override
 
virtual std::string ReadReply (bool endOnSemicolon=true, std::function< void(float)> progress=nullptr) override
 
virtual bool IsCommandBatchingSupported () override
 
virtual bool IsConnected () override
 
const std::string & GetHostname ()
 Returns the hostname of the connected instrument.
 
unsigned short GetPort ()
 Returns the port number of the connected instrument.
 
bool SetTimeouts (unsigned int txUs, unsigned int rxUs) override
 Sets timeouts for the connection.
 
- Public Member Functions inherited from SCPITransport
virtual std::string GetName ()=0
 
void SendCommandQueued (const std::string &cmd)
 Pushes a command into the transmit FIFO then returns immediately.
 
std::string SendCommandQueuedWithReply (const std::string &cmd, bool endOnSemicolon=true)
 Sends a command (flushing any pending/queued commands first), then returns the response.
 
void SendCommandImmediate (const std::string &cmd)
 Sends a command (jumping ahead of the queue) which does not require a response.
 
std::string SendCommandImmediateWithReply (const std::string &cmd, bool endOnSemicolon=true)
 Sends a command (jumping ahead of the queue), then returns the response.
 
voidSendCommandImmediateWithRawBlockReply (const std::string &cmd, size_t &len)
 Sends a command (jumping ahead of the queue) which reads a binary block response.
 
bool FlushCommandQueue ()
 Pushes all pending commands from SendCommandQueued() calls and blocks until they are all sent.
 
std::recursive_mutex & GetMutex ()
 
void EnableRateLimiting (std::chrono::milliseconds interval)
 Enables rate limiting. Rate limiting is only applied to the queued command API.
 
void DeduplicateCommand (const std::string &cmd)
 Adds a command to the set of commands which may be deduplicated in the queue.
 

Static Public Member Functions

static std::string GetTransportName ()
 
- Static Public Member Functions inherited from SCPISocketTransport
static std::string GetTransportName ()
 Returns the constant transport name "lan".
 
- Static Public Member Functions inherited from SCPITransport
static void DoAddTransportClass (const std::string &name, CreateProcType proc, EnumEndpointsProcType eproc)
 
static void EnumTransports (std::vector< std::string > &names)
 
static SCPITransportCreateTransport (const std::string &transport, const std::string &args)
 
static std::vector< TransportEndpointEnumEndpoints (const std::string &transport)
 
static std::vector< TransportEndpointEnumTransportEndpoints ()
 

Protected Attributes

unsigned short m_dataport
 
Socket m_secondarysocket
 
- Protected Attributes inherited from SCPISocketTransport
Socket m_socket
 The socket for commands.
 
std::string m_hostname
 IP or hostname of the instrument.
 
unsigned short m_port
 TCP port number of the instrument.
 
- Protected Attributes inherited from SCPITransport
std::mutex m_queueMutex
 
std::recursive_mutex m_netMutex
 
std::list< std::string > m_txQueue
 
std::set< std::string > m_dedupCommands
 
bool m_rateLimitingEnabled
 
std::chrono::system_clock::time_point m_nextCommandReady
 
std::chrono::milliseconds m_rateLimitingInterval
 

Additional Inherited Members

- Public Types inherited from SCPITransport
typedef SCPITransport *(* CreateProcType) (const std::string &args)
 
typedef std::vector< TransportEndpoint >(* EnumEndpointsProcType) ()
 
- Protected Types inherited from SCPITransport
typedef std::map< std::string, CreateProcType > CreateMapType
 
typedef std::map< std::string, EnumEndpointsProcType > EnumEndpointsMapType
 
- Protected Member Functions inherited from SCPISocketTransport
void SharedCtorInit ()
 Helper function that actually opens the socket connection.
 
- Protected Member Functions inherited from SCPITransport
void RateLimitingWait ()
 Block until it's time to send the next command when rate limiting.
 
- Static Protected Attributes inherited from SCPITransport
static CreateMapType m_createprocs
 
static EnumEndpointsMapType m_enumEndpointsProcs
 

Detailed Description

A SCPISocketTransport plus a second socket for waveform data.

Read/WriteRawData methods are directed at the secondary stream, rather than the SCPI socket.

Member Function Documentation

◆ GetConnectionString()

string SCPITwinLanTransport::GetConnectionString ( )
overridevirtual

Reimplemented from SCPISocketTransport.

◆ ReadRawData()

size_t SCPITwinLanTransport::ReadRawData ( size_t  len,
unsigned char buf,
std::function< void(float)>  progress = nullptr 
)
overridevirtual

Reimplemented from SCPISocketTransport.

◆ SendRawData()

void SCPITwinLanTransport::SendRawData ( size_t  len,
const unsigned char buf 
)
overridevirtual

Reimplemented from SCPISocketTransport.


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