diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.1.16.0 b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.1.16.1 similarity index 68% rename from slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.1.16.0 rename to slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.1.16.1 index 484256ceb..ed605b7e6 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.1.16.0 and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.1.16.1 differ diff --git a/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt b/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt index bf2c15c1f..3bb5f38db 100644 --- a/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt +++ b/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt @@ -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: e6bd874a88493557fc5127d4a1686832299aaf06 -Revision: 312 +Repsitory UUID: ecf1e9fac1aaa7034e462638bd01965df892726a +Revision: 313 Branch: 3.0.1 Last Changed Author: Dhanya_Thattil -Last Changed Rev: 3346 -Last Changed Date: 2018-02-05 12:40:59.000000002 +0100 ./FebRegisterDefs.h +Last Changed Rev: 3348 +Last Changed Date: 2018-02-07 11:04:32.000000002 +0100 ./FebRegisterDefs.h diff --git a/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h b/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h index 2355fd690..dd1c9250b 100644 --- a/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h +++ b/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h @@ -1,6 +1,6 @@ #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" -#define GITREPUUID "e6bd874a88493557fc5127d4a1686832299aaf06" +#define GITREPUUID "ecf1e9fac1aaa7034e462638bd01965df892726a" #define GITAUTH "Dhanya_Thattil" -#define GITREV 0x3346 -#define GITDATE 0x20180205 +#define GITREV 0x3348 +#define GITDATE 0x20180207 #define GITBRANCH "3.0.1" diff --git a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c index 4eebe0053..c718e9b4c 100644 --- a/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/eigerDetectorServer/slsDetectorFunctionList.c @@ -828,23 +828,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; diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index 8ace51109..2ae6ba02e 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -6701,8 +6701,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]); + std::cout << "Detector MAC updated to " << thisDetector->detectorMAC << endl; + } + if (strcasecmp(arg[1],thisDetector->detectorIP)) { + memset(thisDetector->detectorIP, 0, MAX_STR_LENGTH); + strcpy(thisDetector->detectorIP, arg[0]); + std::cout << "Detector IP updated to " << thisDetector->detectorIP << endl; + } + } + } disconnectControl(); if (ret==FORCE_UPDATE) updateDetector(); diff --git a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c index eb3b99eff..e189d2133 100755 --- a/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c +++ b/slsDetectorSoftware/slsDetectorServer/slsDetectorServer_funcs.c @@ -3479,6 +3479,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; @@ -3505,9 +3525,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; }