mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
eiger ensures the mac address is the same as the software mac address
This commit is contained in:
Binary file not shown.
@ -142,6 +142,9 @@ int initDetector(){
|
|||||||
Feb_Control_SetTestModeVariable(0);
|
Feb_Control_SetTestModeVariable(0);
|
||||||
Feb_Control_CheckSetup();
|
Feb_Control_CheckSetup();
|
||||||
|
|
||||||
|
//print detector mac
|
||||||
|
getDetectorMAC();
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -247,12 +250,16 @@ int getDetectorNumber(){
|
|||||||
|
|
||||||
|
|
||||||
u_int64_t getDetectorMAC() {
|
u_int64_t getDetectorMAC() {
|
||||||
/*
|
char mac[255]="";
|
||||||
char output[255],mac[255]="";
|
|
||||||
u_int64_t res=0;
|
u_int64_t res=0;
|
||||||
FILE* sysFile = popen("ifconfig eth0 | grep HWaddr | cut -d \" \" -f 11", "r");
|
|
||||||
|
//execute and get address
|
||||||
|
char output[255];
|
||||||
|
FILE* sysFile = popen("more /sys/class/net/eth0/address", "r");
|
||||||
|
//FILE* sysFile = popen("ifconfig eth0 | grep HWaddr | cut -d \" \" -f 11", "r");
|
||||||
fgets(output, sizeof(output), sysFile);
|
fgets(output, sizeof(output), sysFile);
|
||||||
pclose(sysFile);
|
pclose(sysFile);
|
||||||
|
|
||||||
//getting rid of ":"
|
//getting rid of ":"
|
||||||
char * pch;
|
char * pch;
|
||||||
pch = strtok (output,":");
|
pch = strtok (output,":");
|
||||||
@ -261,10 +268,9 @@ u_int64_t getDetectorMAC() {
|
|||||||
pch = strtok (NULL, ":");
|
pch = strtok (NULL, ":");
|
||||||
}
|
}
|
||||||
sscanf(mac,"%llx",&res);
|
sscanf(mac,"%llx",&res);
|
||||||
printf("mac:%llx\n",res);
|
//printf("mac:%llx\n",res);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
*/
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int moduleTest( enum digitalTestMode arg, int imod){
|
int moduleTest( enum digitalTestMode arg, int imod){
|
||||||
@ -744,6 +750,14 @@ int executeTrimming(enum trimMode mode, int par1, int par2, int imod){
|
|||||||
|
|
||||||
|
|
||||||
int configureMAC(int ipad, long long int macad, long long int detectormacadd, int detipad, int udpport, int udpport2, int ival){
|
int configureMAC(int ipad, long long int macad, long long int detectormacadd, int detipad, int udpport, int udpport2, int ival){
|
||||||
|
|
||||||
|
if(detectormacadd != getDetectorMAC()){
|
||||||
|
printf("*************************************************\n");
|
||||||
|
printf("WARNING: actual detector mac address %llx does not match the one from client %llx\n",getDetectorMAC(),detectormacadd);
|
||||||
|
printf("*************************************************\n");
|
||||||
|
}
|
||||||
|
detectormacadd = getDetectorMAC();
|
||||||
|
|
||||||
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;
|
||||||
sprintf(src_ip,"%d.%d.%d.%d",(detipad>>24)&0xff,(detipad>>16)&0xff,(detipad>>8)&0xff,(detipad)&0xff);
|
sprintf(src_ip,"%d.%d.%d.%d",(detipad>>24)&0xff,(detipad>>16)&0xff,(detipad>>8)&0xff,(detipad)&0xff);
|
||||||
|
@ -3000,7 +3000,7 @@ int configure_mac(int file_des) {
|
|||||||
printf("mess:%s\n",mess);
|
printf("mess:%s\n",mess);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
//#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
int i;
|
int i;
|
||||||
/*printf("\ndigital_test_bit in server %d\t",digitalTestBit);for gotthard*/
|
/*printf("\ndigital_test_bit in server %d\t",digitalTestBit);for gotthard*/
|
||||||
printf("\nipadd %x\t",ipad);
|
printf("\nipadd %x\t",ipad);
|
||||||
@ -3016,7 +3016,7 @@ int configure_mac(int file_des) {
|
|||||||
printf("udp port2:0x%x\n",udpport2);
|
printf("udp port2:0x%x\n",udpport2);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("Configuring MAC of module %d at port %x\n", imod, udpport);
|
printf("Configuring MAC of module %d at port %x\n", imod, udpport);
|
||||||
//#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
#ifdef SLS_DETECTOR_FUNCTION_LIST
|
||||||
if (ret==OK) {
|
if (ret==OK) {
|
||||||
|
Reference in New Issue
Block a user