ABS SCPI Driver 0.2.0
ABS SCPI driver library
|
UDP driver. More...
#include <UdpDriver.h>
UDP driver.
Public Member Functions | |
UdpDriver () | |
CTOR. | |
~UdpDriver () | |
DTOR. | |
ErrorCode | Open (std::string_view ip) |
Open a socket for communication with the ABS. | |
ErrorCode | Open (std::string_view local_ip, std::string_view target_ip) |
Open a socket for communication with the ABS bound to a specific local IP address. | |
void | Close () noexcept |
Close the socket. | |
ErrorCode | Write (std::string_view data, unsigned int timeout_ms) const |
Send data over UDP. | |
Result< std::string > | ReadLine (unsigned int timeout_ms) const |
Read a line over UDP. | |
Public Member Functions inherited from CommDriver | |
virtual void | SetDeviceID (unsigned int id) |
Set the target device ID. | |
virtual unsigned int | GetDeviceID () const |
Get the target device ID. | |
virtual bool | IsSendOnly () const |
Determines whether a driver is send-only in the average case. | |
ErrorCode Open | ( | std::string_view | ip | ) |
Open a socket for communication with the ABS.
[in] | ip | device IP address |
ErrorCode Open | ( | std::string_view | local_ip, |
std::string_view | target_ip | ||
) |
Open a socket for communication with the ABS bound to a specific local IP address.
Prefer this function if you have more than one NIC.
[in] | local_ip | local interface IP to bind to |
[in] | target_ip | device IP address |
|
virtual |
Read a line over UDP.
[in] | timeout_ms | read timeout in milliseconds |
Implements CommDriver.
|
virtual |
Send data over UDP.
[in] | data | data to send |
[in] | timeout_ms | send timeout in milliseconds |
Implements CommDriver.