mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-06 01:50:40 +02:00
made the detector ip and detector mac update client in configuremac
This commit is contained in:
parent
ecf1e9fac1
commit
5198e67dbd
Binary file not shown.
@ -1,9 +1,9 @@
|
|||||||
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
||||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||||
Repsitory UUID: e6bd874a88493557fc5127d4a1686832299aaf06
|
Repsitory UUID: ecf1e9fac1aaa7034e462638bd01965df892726a
|
||||||
Revision: 312
|
Revision: 313
|
||||||
Branch: 3.0.1
|
Branch: 3.0.1
|
||||||
Last Changed Author: Dhanya_Thattil
|
Last Changed Author: Dhanya_Thattil
|
||||||
Last Changed Rev: 3346
|
Last Changed Rev: 3348
|
||||||
Last Changed Date: 2018-02-05 12:40:59.000000002 +0100 ./FebRegisterDefs.h
|
Last Changed Date: 2018-02-07 11:04:32.000000002 +0100 ./FebRegisterDefs.h
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||||
#define GITREPUUID "e6bd874a88493557fc5127d4a1686832299aaf06"
|
#define GITREPUUID "ecf1e9fac1aaa7034e462638bd01965df892726a"
|
||||||
#define GITAUTH "Dhanya_Thattil"
|
#define GITAUTH "Dhanya_Thattil"
|
||||||
#define GITREV 0x3346
|
#define GITREV 0x3348
|
||||||
#define GITDATE 0x20180205
|
#define GITDATE 0x20180207
|
||||||
#define GITBRANCH "3.0.1"
|
#define GITBRANCH "3.0.1"
|
||||||
|
@ -828,23 +828,6 @@ enum externalCommunicationMode setTiming( enum externalCommunicationMode arg){
|
|||||||
/* configure mac */
|
/* configure mac */
|
||||||
|
|
||||||
int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport, uint32_t udpport2, int ival) {
|
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];
|
char src_mac[50], src_ip[50],dst_mac[50], dst_ip[50];
|
||||||
int src_port = 0xE185;
|
int src_port = 0xE185;
|
||||||
|
@ -6701,8 +6701,41 @@ int slsDetector::configureMAC(){
|
|||||||
std::cout<< "Detector returned error: " << mess << std::endl;
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
|
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
controlSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
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();
|
disconnectControl();
|
||||||
if (ret==FORCE_UPDATE)
|
if (ret==FORCE_UPDATE)
|
||||||
updateDetector();
|
updateDetector();
|
||||||
|
@ -3479,6 +3479,26 @@ int configure_mac(int file_des) {
|
|||||||
cprintf(RED, "Warning: %s", mess);
|
cprintf(RED, "Warning: %s", mess);
|
||||||
}
|
}
|
||||||
else {
|
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);
|
retval=configureMAC(ipad,imacadd,idetectormacadd,detipad,udpport,udpport2,0); //digitalTestBit);
|
||||||
if(retval==-1) {
|
if(retval==-1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
@ -3505,9 +3525,16 @@ int configure_mac(int file_des) {
|
|||||||
// send return argument
|
// send return argument
|
||||||
if (ret==FAIL) {
|
if (ret==FAIL) {
|
||||||
n += sendData(file_des,mess,sizeof(mess),OTHER);
|
n += sendData(file_des,mess,sizeof(mess),OTHER);
|
||||||
} else
|
} else {
|
||||||
n += sendData(file_des,&retval,sizeof(retval),INT32);
|
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 ok / fail
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user