DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
BNL_UDP.cpp File Reference
#include "wibmod/WIB1/BNL_UDP.hh"
#include "wibmod/WIB1/BNL_UDP_Exception.hh"
#include <sys/socket.h>
#include <string.h>
#include <errno.h>
#include <string>
#include <fcntl.h>
#include <sstream>
#include <iomanip>
#include <netdb.h>
#include <algorithm>
Include dependency graph for BNL_UDP.cpp:

Go to the source code of this file.

Classes

struct  WIB_packet_t
 

Macros

#define WIB_WR_BASE_PORT   32000
 
#define WIB_RD_BASE_PORT   32001
 
#define WIB_RPLY_BASE_PORT   32002
 
#define WIB_PACKET_KEY   0xDEADBEEF
 
#define WIB_REQUEST_PACKET_TRAILER   0xFFFF
 
#define WIB_RPLY_PACKET_SIZE   12
 
#define TIMEOUT_SECONDS   2
 
#define TIMEOUT_MICROSECONDS   0
 

Functions

static std::string dump_packet (uint8_t *data, size_t size)
 

Macro Definition Documentation

◆ TIMEOUT_MICROSECONDS

#define TIMEOUT_MICROSECONDS   0

Definition at line 28 of file BNL_UDP.cpp.

◆ TIMEOUT_SECONDS

#define TIMEOUT_SECONDS   2

Definition at line 27 of file BNL_UDP.cpp.

◆ WIB_PACKET_KEY

#define WIB_PACKET_KEY   0xDEADBEEF

Definition at line 21 of file BNL_UDP.cpp.

◆ WIB_RD_BASE_PORT

#define WIB_RD_BASE_PORT   32001

Definition at line 18 of file BNL_UDP.cpp.

◆ WIB_REQUEST_PACKET_TRAILER

#define WIB_REQUEST_PACKET_TRAILER   0xFFFF

Definition at line 23 of file BNL_UDP.cpp.

◆ WIB_RPLY_BASE_PORT

#define WIB_RPLY_BASE_PORT   32002

Definition at line 19 of file BNL_UDP.cpp.

◆ WIB_RPLY_PACKET_SIZE

#define WIB_RPLY_PACKET_SIZE   12

Definition at line 25 of file BNL_UDP.cpp.

◆ WIB_WR_BASE_PORT

#define WIB_WR_BASE_PORT   32000

Definition at line 17 of file BNL_UDP.cpp.

Function Documentation

◆ dump_packet()

static std::string dump_packet ( uint8_t * data,
size_t size )
static

Definition at line 37 of file BNL_UDP.cpp.

37 {
38 // printf("Err: %p %zu\n",data,size);
39 std::stringstream ss;
40 for(size_t iWord = 0; iWord < size;iWord++){
41 ss << "0x" << std::hex << std::setfill('0') << std::setw(4) << iWord;
42 ss << ": 0x" << std::hex << std::setfill('0') << std::setw(2) << int(data[iWord]);
43 iWord++;
44 if(iWord < size){
45 ss << std::hex << std::setfill('0') << std::setw(2) << int(data[iWord]);
46 }
47 ss << std::endl;
48 }
49 // printf("%s",ss.str().c_str());
50 return ss.str();
51}
FELIX Initialization std::string initerror FELIX queue timed std::string queuename Unexpected chunk size