1 #ifndef _ots_OtsUDPHardware_h_
2 #define _ots_OtsUDPHardware_h_
4 #include "otsdaq-components/DAQHardware/FrontEndHardwareBase.h"
5 #include "otsdaq-core/NetworkUtilities/TransceiverSocket.h"
13 unsigned int hostPort,
14 std::string boardIPAddress,
15 unsigned int boardPort,
16 unsigned int version = -1,
17 bool verbose =
false);
20 virtual void write(
const std::string& sendBuffer)
throw(std::runtime_error);
21 virtual void write(
const std::vector<std::string>& sendBuffers)
throw(
23 virtual void writeAndAcknowledge(
const std::string& sendBuffer,
24 int timeoutSeconds = -1)
throw(std::runtime_error);
25 virtual void writeAndAcknowledge(
const std::vector<std::string>& sendBuffers,
26 int timeoutSeconds = -1)
throw(std::runtime_error);
27 virtual void read(
const std::string& sendBuffer,
28 std::string& receiveBuffer,
29 int timeoutSeconds = -1)
throw(std::runtime_error);
30 virtual void read(
const std::vector<std::string>& sendBuffers,
31 std::vector<std::string>& receiveBuffers,
32 int timeoutSeconds = -1)
throw(std::runtime_error);
34 virtual int flushRead()
throw(std::runtime_error) {
return clearReadSocket(); }
36 void read(
const std::string& sendBuffer,
37 uint64_t& receiveQuadWord,
38 int timeoutSeconds = -1)
throw(std::runtime_error);
39 void read(
const std::string& sendBuffer,
40 std::vector<uint64_t>& receiveQuadWords,
41 int timeoutSeconds = -1)
throw(std::runtime_error);
42 void read(
const std::vector<std::string>& sendBuffers,
43 std::vector<std::vector<uint64_t> >& receiveQuadWordsVector,
44 int timeoutSeconds = -1)
throw(std::runtime_error);
45 int clearReadSocket();
52 unsigned int boardPort,
53 unsigned int version = -1,
54 bool verbose =
false);
56 std::string acknowledgment_;