/* GTUdpReceiver.h */ /* Basic packet info. Datagrams are SEG_SIZE long and the first 32-bit word contains a sequence number. UDP guarentees datagrams are received intact or not at all and the sequence number is therefore sufficient for checking. SEG_SIZE must be less than or equal to max datagram size Events are of variable length and therefore EVT_LEN is deprecated. The first word of the buffer following the sequence number will be the SEP word. The next SEP will be the beginning of the next event. The actual event length (including SEP) is the address of the second SEP minus the address of the first SEP. The number of events in the datagram is BUF_SIZE / and the number of unused bytes at the end of the packet is BUF_SIZE % . Events are in the raw data format from the digitizers, in big-endian (network) byte order. Note that there is no continuation of partial events between buffers. */ #define RECV_PORT 1101 #ifdef ACQ_10CH #define SEG_SIZE (7*1024) #endif // ACQ_10CH #ifdef ACQ_8CH #define SEG_SIZE 1024 #endif // ACQ_8CH #define BUF_SIZE (SEG_SIZE - 4) #define EVT_LEN 25 /* deprecated */ #define SEP 0xAAAAAAAA /* prototypes from GSudpUtil_r.c */ int SetupUdpReceiver(int); int UdpReceiveBuf(char *buf, size_t * nbread, int maxlen); int CloseUdpReceiver();