mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-17 16:43:45 +01:00
ctb readout works with receiver for digital readout, allocate ram in server only if 1g udp, free addr info only when setting new udp detals upon configuring ,brough readout flags to receiver
This commit is contained in:
@@ -22,7 +22,6 @@ extern int nframes;
|
||||
extern char* ramValues;
|
||||
|
||||
#define UDP_PACKET_HEADER_VERSION (0x1)
|
||||
#define UDP_PACKET_DATA_BYTES (1344)
|
||||
|
||||
|
||||
uint32_t udpPacketNumber = 0;
|
||||
|
||||
@@ -62,6 +62,7 @@ int setUDPDestinationDetails(const char* ip, unsigned short int port) {
|
||||
}
|
||||
|
||||
int createUDPSocket() {
|
||||
FILE_LOG(logDEBUG2, ("Creating UDP Socket\n"));
|
||||
if (!strlen(udpDestinationIp)) {
|
||||
FILE_LOG(logERROR, ("No destination UDP ip specified.\n"));
|
||||
return FAIL;
|
||||
@@ -107,10 +108,9 @@ int sendUDPPacket(const char* buf, int length) {
|
||||
}
|
||||
|
||||
void closeUDPSocket() {
|
||||
close(udpSockfd);
|
||||
udpSockfd = -1;
|
||||
if (udpServerAddrInfo) {
|
||||
freeaddrinfo(udpServerAddrInfo);
|
||||
udpServerAddrInfo = 0;
|
||||
if (udpSockfd != -1) {
|
||||
FILE_LOG(logINFO, ("Udp client socket closed\n"));
|
||||
close(udpSockfd);
|
||||
udpSockfd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2272,10 +2272,21 @@ int configure_mac(int file_des) {
|
||||
|
||||
#endif
|
||||
ret = configureMAC(dstIp, dstMac, srcMac, srcIp, dstPort, dstPort2);
|
||||
#if defined(CHIPTESTBOARDD) || defined(MOENCHD)
|
||||
if (ret != OK) {
|
||||
if (ret == FAIL)
|
||||
sprintf(mess,"Could not configure mac because of incorrect udp 1G destination IP and port\n");
|
||||
else if (ret == -1)
|
||||
sprintf(mess, "Could not allocate RAM\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
}
|
||||
#else
|
||||
if (ret == FAIL) {
|
||||
sprintf(mess,"Configure Mac failed\n");
|
||||
FILE_LOG(logERROR,(mess));
|
||||
} else {
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
FILE_LOG(logINFO, ("\tConfigure MAC successful\n"));
|
||||
}
|
||||
#if defined(EIGERD) || defined (JUNGFRAUD)
|
||||
|
||||
Reference in New Issue
Block a user