rohdeschwarz::busses::socket::Socket example
This example demonstrates basic use of the rohdeschwarz::busses::socket::Socket class.
#include <iostream>
{
if (instrument.
openTcp(
"localhost"))
{
#ifndef NDEBUG
std::cout << "connected: " << id << std::endl;
#endif
}
else
{
#ifndef NDEBUG
std::cout << "error: connection to localhost failed" << std::endl;
#endif
}
return 0;
}
Object-oriented R&S Instrument control.
std::string id()
Queries instrument ID string.
bool openTcp(std::string host, unsigned int timeout_ms=2000)
Open tcp socket connection to an instrument.
rohdeschwarz helper function definition
rohdeschwarz::instruments::Instrument definition
boost::system::system_error system_error
System error exception.
std::string trim(const std::string &text)
Trims whitespace beginning and end of string.
rohdeschwarz::busses::socket::Socket class definition
rohdeschwarz::busses::socket::system_error system_error
rohdeschwarz::instruments::Instrument Instrument
Definition in file main.cpp.