mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-16 06:47:14 +02:00
merge from 3.0.1: eiger server detip and mac client updated back
This commit is contained in:
@ -6916,8 +6916,41 @@ int slsDetector::configureMAC(){
|
||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
|
||||
}
|
||||
else
|
||||
else {
|
||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||
if (thisDetector->myDetectorType == EIGER) {
|
||||
//rewrite detectormac, detector ip
|
||||
char arg[2][50];
|
||||
memset(arg,0,sizeof(arg));
|
||||
uint64_t idetectormac = 0;
|
||||
uint32_t idetectorip = 0;
|
||||
controlSocket->ReceiveDataOnly(arg,sizeof(arg));
|
||||
sscanf(arg[0], "%lx", &idetectormac);
|
||||
sscanf(arg[1], "%x", &idetectorip);
|
||||
sprintf(arg[0],"%02x:%02x:%02x:%02x:%02x:%02x",
|
||||
(unsigned int)((idetectormac>>40)&0xFF),
|
||||
(unsigned int)((idetectormac>>32)&0xFF),
|
||||
(unsigned int)((idetectormac>>24)&0xFF),
|
||||
(unsigned int)((idetectormac>>16)&0xFF),
|
||||
(unsigned int)((idetectormac>>8)&0xFF),
|
||||
(unsigned int)((idetectormac>>0)&0xFF));
|
||||
sprintf(arg[1],"%d.%d.%d.%d",
|
||||
(idetectorip>>24)&0xff,
|
||||
(idetectorip>>16)&0xff,
|
||||
(idetectorip>>8)&0xff,
|
||||
(idetectorip)&0xff);
|
||||
if (strcasecmp(arg[0],thisDetector->detectorMAC)) {
|
||||
memset(thisDetector->detectorMAC, 0, MAX_STR_LENGTH);
|
||||
strcpy(thisDetector->detectorMAC, arg[0]);
|
||||
cprintf(RESET,"%d: Detector MAC updated to %s\n", detId, thisDetector->detectorMAC);
|
||||
}
|
||||
if (strcasecmp(arg[1],thisDetector->detectorIP)) {
|
||||
memset(thisDetector->detectorIP, 0, MAX_STR_LENGTH);
|
||||
strcpy(thisDetector->detectorIP, arg[1]);
|
||||
cprintf(RESET,"%d: Detector IP updated to %s\n", detId, thisDetector->detectorIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
disconnectControl();
|
||||
if (ret==FORCE_UPDATE)
|
||||
updateDetector();
|
||||
|
Reference in New Issue
Block a user