1 #ifndef artdaq_ots_Generators_UDPTFGTest_hh
2 #define artdaq_ots_Generators_UDPTFGTest_hh
16 #include "artdaq-core/Data/Fragment.hh"
17 #include "artdaq/Generators/CommandableFragmentGenerator.hh"
18 #include "fhiclcpp/fwd.h"
20 #include <arpa/inet.h>
21 #include <netinet/in.h>
22 #include <sys/socket.h>
23 #include <sys/types.h>
81 class UDPReceiver :
public artdaq::CommandableFragmentGenerator
97 explicit UDPReceiver( fhicl::ParameterSet
const& ps );
104 bool getNext_( artdaq::FragmentPtrs& output )
override;
106 void start()
override;
108 void stop()
override;
110 void stopNoMutex()
override {}
111 void pause()
override;
113 void resume()
override;
115 DataType getDataType( uint8_t byte ) {
return static_cast<DataType>( ( byte & 0xF0 ) >> 4 ); }
127 uint8_t expectedPacketNumber_;
130 struct sockaddr_in si_data_;
137 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.