mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 01:50:40 +02:00
merge from 3.0.1: eiger server detip and mac client updated back
This commit is contained in:
commit
aa190fda7a
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 3da6a6df6556312f7467407a8b5691bdc478424e
|
||||
Revision: 319
|
||||
Repsitory UUID: 897cbac27d3154d72893e331df3147d4b706ccc8
|
||||
Revision: 321
|
||||
Branch: developer
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3597
|
||||
Last Changed Date: 2018-02-07 10:44:13.000000002 +0100 ./FebRegisterDefs.h
|
||||
Last Changed Rev: 3600
|
||||
Last Changed Date: 2018-02-07 15:22:30.000000002 +0100 ./FebRegisterDefs.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "3da6a6df6556312f7467407a8b5691bdc478424e"
|
||||
#define GITREPUUID "897cbac27d3154d72893e331df3147d4b706ccc8"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3597
|
||||
#define GITREV 0x3600
|
||||
#define GITDATE 0x20180207
|
||||
#define GITBRANCH "developer"
|
||||
|
@ -831,23 +831,6 @@ enum externalCommunicationMode setTiming( enum externalCommunicationMode arg){
|
||||
/* configure mac */
|
||||
|
||||
int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport, uint32_t udpport2, int ival) {
|
||||
if (sourcemac != getDetectorMAC()){
|
||||
printf("*************************************************\n");
|
||||
printf("WARNING: actual detector mac address %llx does not match the one from client %llx\n",getDetectorMAC(),sourcemac);
|
||||
sourcemac = getDetectorMAC();
|
||||
printf("WARNING: Matched detectormac to the hardware mac now\n");
|
||||
printf("*************************************************\n");
|
||||
}
|
||||
//only for 1Gbe
|
||||
if(!send_to_ten_gig){
|
||||
if (sourceip != getDetectorIP()){
|
||||
printf("*************************************************\n");
|
||||
printf("WARNING: actual detector ip address %x does not match the one from client %x\n",getDetectorIP(),sourceip);
|
||||
sourceip = getDetectorIP();
|
||||
printf("WARNING: Matched detector ip to the hardware ip now\n");
|
||||
printf("*************************************************\n");
|
||||
}
|
||||
}
|
||||
|
||||
char src_mac[50], src_ip[50],dst_mac[50], dst_ip[50];
|
||||
int src_port = 0xE185;
|
||||
|
@ -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();
|
||||
|
@ -3669,6 +3669,26 @@ int configure_mac(int file_des) {
|
||||
cprintf(RED, "Warning: %s", mess);
|
||||
}
|
||||
else {
|
||||
#ifdef EIGERD
|
||||
// change mac to hardware mac, (for 1 gbe) change ip to hardware ip
|
||||
if (idetectormacadd != getDetectorMAC()){
|
||||
printf("*************************************************\n");
|
||||
printf("WARNING: actual detector mac address %llx does not match the one from client %llx\n",getDetectorMAC(),idetectormacadd);
|
||||
idetectormacadd = getDetectorMAC();
|
||||
printf("WARNING: Matched detectormac to the hardware mac now\n");
|
||||
printf("*************************************************\n");
|
||||
}
|
||||
//only for 1Gbe
|
||||
if(!enableTenGigabitEthernet(-1)){
|
||||
if (detipad != getDetectorIP()){
|
||||
printf("*************************************************\n");
|
||||
printf("WARNING: actual detector ip address %x does not match the one from client %x\n",getDetectorIP(),detipad);
|
||||
detipad = getDetectorIP();
|
||||
printf("WARNING: Matched detector ip to the hardware ip now\n");
|
||||
printf("*************************************************\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
retval=configureMAC(ipad,imacadd,idetectormacadd,detipad,udpport,udpport2,0); //digitalTestBit);
|
||||
if(retval==-1) {
|
||||
ret = FAIL;
|
||||
@ -3703,9 +3723,16 @@ int configure_mac(int file_des) {
|
||||
// send return argument
|
||||
if (ret==FAIL) {
|
||||
n += sendData(file_des,mess,sizeof(mess),OTHER);
|
||||
} else
|
||||
} else {
|
||||
n += sendData(file_des,&retval,sizeof(retval),INT32);
|
||||
|
||||
#ifdef EIGERD
|
||||
char arg[2][50];
|
||||
memset(arg,0,sizeof(arg));
|
||||
sprintf(arg[0],"%llx",idetectormacadd);
|
||||
sprintf(arg[1],"%x",detipad);
|
||||
n += sendData(file_des,arg,sizeof(arg),OTHER);
|
||||
#endif
|
||||
}
|
||||
// return ok / fail
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user