38#ifndef CommandLineDriver_h
39#define CommandLineDriver_h
54 std::recursive_mutex m_transportMutex;
64 std::string
ConverseSingle(
const std::string commandString,
bool hasEcho =
true);
77 size_t ConverseMultiple(
const std::string commandString, std::vector<std::string> &readLines,
bool hasEcho =
true, std::function<
void(
float)> progress =
nullptr,
size_t expecedLines = 0);
88 bool ConverseSweep(int64_t &sweepStart, int64_t &sweepStop, int64_t &points,
bool setFreqValues =
false);
98 bool ConverseSweep(int64_t &sweepStart, int64_t &sweepStop,
bool setFreqValues =
false)
101 return ConverseSweep(sweepStart, sweepStop, unused, setFreqValues);
112 std::string
ConverseString(
const std::string commandString, std::function<
void(
float)> progress =
nullptr,
size_t expecedLines = 0);
121 size_t m_maxResponseSize;
122 double m_communicationTimeout;
125 inline static const std::string TRAILER_STRING =
"ch> ";
127 inline static const size_t TRAILER_STRING_LENGTH = TRAILER_STRING.size();
129 inline static const std::string EOL_STRING =
"\r\n";
131 inline static const size_t EOL_STRING_LENGTH = EOL_STRING.size();
Helper class for command line drivers: provides helper methods for command line based communication w...
Definition: CommandLineDriver.h:46
std::string ConverseSingle(const std::string commandString, bool hasEcho=true)
Converse with the device : send a command and read the reply over several lines.
Definition: CommandLineDriver.cpp:81
bool ConverseSweep(int64_t &sweepStart, int64_t &sweepStop, bool setFreqValues=false)
Set and/or read the sweep values from the device.
Definition: CommandLineDriver.h:98
std::string ConverseString(const std::string commandString, std::function< void(float)> progress=nullptr, size_t expecedLines=0)
Base method to converse with the device.
Definition: CommandLineDriver.cpp:101
bool ConverseSweep(int64_t &sweepStart, int64_t &sweepStop, int64_t &points, bool setFreqValues=false)
Set and/or read the sweep values from the device.
Definition: CommandLineDriver.cpp:146
size_t ConverseMultiple(const std::string commandString, std::vector< std::string > &readLines, bool hasEcho=true, std::function< void(float)> progress=nullptr, size_t expecedLines=0)
Converse with the device by sending a command and receiving a single line response.
Definition: CommandLineDriver.cpp:53
std::string DrainTransport()
Consume any pending data from the transport layer.
Definition: CommandLineDriver.cpp:181
An SCPI-based device.
Definition: SCPIDevice.h:37
Abstraction of a transport layer for moving SCPI data between endpoints.
Definition: SCPITransport.h:47