1 #ifndef artdaq_ots_Generators_UDPTFGTest_hh
2 #define artdaq_ots_Generators_UDPTFGTest_hh
16 #include "fhiclcpp/fwd.h"
17 #include "artdaq-core/Data/Fragment.hh"
18 #include "artdaq/Generators/CommandableFragmentGenerator.hh"
20 #include <arpa/inet.h>
21 #include <netinet/in.h>
22 #include <sys/types.h>
23 #include <sys/socket.h>
82 class UDPReceiver :
public artdaq::CommandableFragmentGenerator
98 explicit UDPReceiver(fhicl::ParameterSet
const& ps);
106 bool getNext_(artdaq::FragmentPtrs& output)
override;
108 void start()
override;
110 void stop()
override;
112 void stopNoMutex()
override {}
113 void pause()
override;
115 void resume()
override;
117 DataType getDataType(uint8_t byte) {
return static_cast<DataType>((byte & 0xF0) >> 4); }
129 uint8_t expectedPacketNumber_;
132 struct sockaddr_in si_data_;
139 std::string rawPath_;
CommandType type
The type of this CommandPacket.
uint8_t dataSize
How many words of data are in the packet.
ReturnCode
Enumeration describing status codes that indicate current sender position in the stream.
An artdaq::CommandableFragmentGenerator which receives data in the form of UDP datagrams.
std::list< packetBuffer_t > packetBuffer_list_t
A std::list of packetbuffer_t objects.
CommandType
Enumeration describing valid command types.
uint64_t address
The destination of the CommandPacket.
DataType
Enumeration describing potential data types.
std::array< uint8_t, 1500 > packetBuffer_t
An array of 1500 bytes (MTU length)
UDPReceiver(fhicl::ParameterSet const &ps)
UDPReceiver Constructor.
Struct defining UDP packet used for communicating with data receiver.
uint64_t data[182]
The data for the CommandPacket.