37#ifndef SCPISocketTransport_h
38#define SCPISocketTransport_h
40#include "../xptools/Socket.h"
54 virtual std::string GetConnectionString()
override;
57 virtual void FlushRXBuffer(
void)
override;
58 virtual bool SendCommand(
const std::string& cmd)
override;
59 virtual std::string ReadReply(
bool endOnSemicolon =
true, std::function<
void(
float)> progress =
nullptr)
override;
60 virtual size_t ReadRawData(
size_t len,
unsigned char* buf, std::function<
void(
float)> progress =
nullptr)
override;
61 virtual void SendRawData(
size_t len,
const unsigned char* buf)
override;
63 virtual bool IsCommandBatchingSupported()
override;
64 virtual bool IsConnected()
override;
Transport that moves SCPI data over a single TCP socket with no framing.
Definition: SCPISocketTransport.h:48
unsigned short GetPort()
Returns the port number of the connected instrument.
Definition: SCPISocketTransport.h:73
void SetTimeouts(unsigned int txUs, unsigned int rxUs)
Sets timeouts for the connection.
Definition: SCPISocketTransport.h:82
Socket m_socket
The socket for commands.
Definition: SCPISocketTransport.h:93
static std::string GetTransportName()
Returns the constant transport name "lan".
Definition: SCPISocketTransport.cpp:128
void SharedCtorInit()
Helper function that actually opens the socket connection.
Definition: SCPISocketTransport.cpp:87
const std::string & GetHostname()
Returns the hostname of the connected instrument.
Definition: SCPISocketTransport.h:69
unsigned short m_port
TCP port number of the instrument.
Definition: SCPISocketTransport.h:99
std::string m_hostname
IP or hostname of the instrument.
Definition: SCPISocketTransport.h:96
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47
Class representing a network socket.
Definition: Socket.h:63