$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #ifndef _ots_OtsUDPHardware_h_ 00002 #define _ots_OtsUDPHardware_h_ 00003 00004 #include "otsdaq-components/DAQHardware/FrontEndHardwareBase.h" 00005 #include "otsdaq-core/NetworkUtilities/TransceiverSocket.h" 00006 00007 namespace ots 00008 { 00009 class OtsUDPHardware : public TransceiverSocket, public FrontEndHardwareBase 00010 { 00011 public: 00012 OtsUDPHardware(std::string hostIPAddress, 00013 unsigned int hostPort, 00014 std::string boardIPAddress, 00015 unsigned int boardPort, 00016 unsigned int version = -1, 00017 bool verbose = false); 00018 virtual ~OtsUDPHardware(void); 00019 00020 virtual void write(const std::string& sendBuffer) throw(std::runtime_error); 00021 virtual void write(const std::vector<std::string>& sendBuffers) throw( 00022 std::runtime_error); 00023 virtual void writeAndAcknowledge(const std::string& sendBuffer, 00024 int timeoutSeconds = -1) throw(std::runtime_error); 00025 virtual void writeAndAcknowledge(const std::vector<std::string>& sendBuffers, 00026 int timeoutSeconds = -1) throw(std::runtime_error); 00027 virtual void read(const std::string& sendBuffer, 00028 std::string& receiveBuffer, 00029 int timeoutSeconds = -1) throw(std::runtime_error); 00030 virtual void read(const std::vector<std::string>& sendBuffers, 00031 std::vector<std::string>& receiveBuffers, 00032 int timeoutSeconds = -1) throw(std::runtime_error); 00033 00034 virtual int flushRead() throw(std::runtime_error) { return clearReadSocket(); } 00035 00036 void read(const std::string& sendBuffer, 00037 uint64_t& receiveQuadWord, 00038 int timeoutSeconds = -1) throw(std::runtime_error); 00039 void read(const std::string& sendBuffer, 00040 std::vector<uint64_t>& receiveQuadWords, 00041 int timeoutSeconds = -1) throw(std::runtime_error); 00042 void read(const std::vector<std::string>& sendBuffers, 00043 std::vector<std::vector<uint64_t> >& receiveQuadWordsVector, 00044 int timeoutSeconds = -1) throw(std::runtime_error); 00045 int clearReadSocket(); 00046 // 00047 // virtual int write(uint64_t address, const std::string& value){return 0;} 00048 // virtual int read (uint64_t address, std::string& value){return 0;} 00049 00050 protected: 00051 OtsUDPHardware(std::string boardIPAddress, 00052 unsigned int boardPort, 00053 unsigned int version = -1, 00054 bool verbose = false); 00055 Socket OtsUDPBoard_; 00056 std::string acknowledgment_; 00057 bool verbose_; 00058 }; 00059 } 00060 00061 #endif