16 #ifndef PSEN_SCAN_UDP_INTERFACE_H 17 #define PSEN_SCAN_UDP_INTERFACE_H 21 #include <boost/asio.hpp> 22 #include <boost/bind.hpp> 37 const uint32_t& host_udp_port,
45 void close()
override;
47 void write(
const boost::asio::mutable_buffers_1& buffer)
override;
48 std::size_t
read(boost::asio::mutable_buffers_1& buffer,
const std::chrono::steady_clock::duration timeout)
override;
63 #endif // PSEN_SCAN_UDP_INTERFACE_H boost::asio::io_service io_service_
PSENscanUDPInterface(const std::string &scanner_ip, const uint32_t &host_udp_port, const unsigned short scanner_port_write=PSEN_SCAN_PORT_WRITE, const unsigned short scanner_port_read=PSEN_SCAN_PORT_READ)
Abstract base class for the communication interface with the PSENscan scanner.
unsigned short const PSEN_SCAN_PORT_WRITE
std::size_t read(boost::asio::mutable_buffers_1 &buffer, const std::chrono::steady_clock::duration timeout) override
Receive data from the scanner.
bool isUdpMsgAvailable() const
boost::asio::ip::udp::socket socket_write_
boost::asio::ip::udp::endpoint udp_write_endpoint_
boost::asio::ip::udp::endpoint udp_read_endpoint_
virtual ~PSENscanUDPInterface()
void close() override
Closes the connection to the scanner device.
unsigned short const PSEN_SCAN_PORT_READ
boost::asio::ip::udp::socket socket_read_
Class for the UDP communication with the scanner.
void open() override
Opens the connection to the scanner device.
void write(const boost::asio::mutable_buffers_1 &buffer) override
Sends data to the scanner device.