mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 10:04:39 +01:00
included detector ip and detector mac defaults in client, which can be specified in config file
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@374 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
@@ -1258,7 +1258,7 @@ int initConfGain(int isettings,int val,int imod){
|
||||
}
|
||||
|
||||
|
||||
int configureMAC(int ipad,long long int macad,long long int servermacad,int ival, int adc,int udpport){
|
||||
int configureMAC(int ipad,long long int macad,long long int detectormacad, int detipad, int ival, int adc,int udpport){
|
||||
//setting daqregister
|
||||
setDAQRegister(adc);
|
||||
//setting adc mask
|
||||
@@ -1361,12 +1361,12 @@ int configureMAC(int ipad,long long int macad,long long int servermacad,int ival
|
||||
mac_conf_regs->mac.mac_src_mac5 = 0xDD;
|
||||
mac_conf_regs->mac.mac_src_mac6 = 0xEE;
|
||||
*/
|
||||
mac_conf_regs->mac.mac_src_mac1 =((servermacad>>(8*5))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac2 =((servermacad>>(8*4))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac3 =((servermacad>>(8*3))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac4 =((servermacad>>(8*2))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac5 =((servermacad>>(8*1))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac6 =((servermacad>>(8*0))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac1 =((detectormacad>>(8*5))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac2 =((detectormacad>>(8*4))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac3 =((detectormacad>>(8*3))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac4 =((detectormacad>>(8*2))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac5 =((detectormacad>>(8*1))&0xFF);
|
||||
mac_conf_regs->mac.mac_src_mac6 =((detectormacad>>(8*0))&0xFF);
|
||||
mac_conf_regs->mac.mac_ether_type = 0x0800; //ipv4
|
||||
|
||||
|
||||
@@ -1380,7 +1380,7 @@ int configureMAC(int ipad,long long int macad,long long int servermacad,int ival
|
||||
mac_conf_regs->ip.ip_ttl = 0x70;
|
||||
mac_conf_regs->ip.ip_protocol = 0x11;
|
||||
mac_conf_regs->ip.ip_chksum = 0x0000 ; //6E42 now is automatically computed
|
||||
mac_conf_regs->ip.ip_sourceip = 0x8181CA2E;
|
||||
mac_conf_regs->ip.ip_sourceip = detipad; //0x8181CA2E;129.129.202.46
|
||||
mac_conf_regs->ip.ip_destip = ipad; //CA57
|
||||
|
||||
#ifdef VERBOSE
|
||||
@@ -1393,7 +1393,7 @@ int configureMAC(int ipad,long long int macad,long long int servermacad,int ival
|
||||
mac_conf_regs->mac.mac_dest_mac5,
|
||||
mac_conf_regs->mac.mac_dest_mac6);
|
||||
printf("mac_src:%llx %x:%x:%x:%x:%x:%x\n",
|
||||
servermacad,
|
||||
detectormacad,
|
||||
mac_conf_regs->mac.mac_src_mac1,
|
||||
mac_conf_regs->mac.mac_src_mac2,
|
||||
mac_conf_regs->mac.mac_src_mac3,
|
||||
|
||||
@@ -62,7 +62,7 @@ int getTemperature(int tempSensor,int imod);
|
||||
int initHighVoltage(int val,int imod);
|
||||
int initConfGain(int isettings,int val,int imod);
|
||||
|
||||
int configureMAC(int ipad, long long int macad, long long int servermacad, int ival, int adc,int udpport);
|
||||
int configureMAC(int ipad, long long int macad, long long int detectormacadd, int detipad, int ival, int adc,int udpport);
|
||||
|
||||
u_int64_t getDetectorNumber();
|
||||
u_int32_t getFirmwareVersion();
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
#define ALLFIFO 0xffff
|
||||
|
||||
|
||||
|
||||
#define ADCSYNC_VAL 0x32214
|
||||
#define TOKEN_RESTART_DELAY 0x88000000
|
||||
#define TOKEN_RESTART_DELAY_ROI 0x1b000000
|
||||
|
||||
@@ -2750,14 +2750,15 @@ int update_client(int file_des) {
|
||||
int configure_mac(int file_des) {
|
||||
|
||||
int ret=OK;
|
||||
char arg[4][50];
|
||||
char arg[5][50];
|
||||
int n;
|
||||
|
||||
int imod=0;//should be in future sent from client as -1, arg[2]
|
||||
int ipad;
|
||||
long long int imacadd;
|
||||
long long int iservermacadd;
|
||||
long long int idetectormacadd;
|
||||
int udpport;
|
||||
int detipad;
|
||||
int adc=-1;
|
||||
|
||||
sprintf(mess,"Can't configure MAC\n");
|
||||
@@ -2769,10 +2770,12 @@ int configure_mac(int file_des) {
|
||||
ret=FAIL;
|
||||
}
|
||||
|
||||
sscanf(arg[0], "%x", &ipad);
|
||||
sscanf(arg[1], "%llx", &imacadd);
|
||||
sscanf(arg[2], "%llx", &iservermacadd);
|
||||
sscanf(arg[3], "%x", &udpport);
|
||||
sscanf(arg[0], "%x", &ipad);
|
||||
sscanf(arg[1], "%llx", &imacadd);
|
||||
sscanf(arg[2], "%x", &udpport);
|
||||
sscanf(arg[3], "%llx", &idetectormacadd);
|
||||
sscanf(arg[4], "%x", &detipad);
|
||||
|
||||
#ifdef VERBOSE
|
||||
int i;
|
||||
printf("\ndigital_test_bit in server %d\t",digitalTestBit);
|
||||
@@ -2781,12 +2784,13 @@ int configure_mac(int file_des) {
|
||||
printf("macad:%llx\n",imacadd);
|
||||
for (i=0;i<6;i++)
|
||||
printf("mac adress %d is 0x%x \n",6-i,(unsigned int)(((imacadd>>(8*i))&0xFF)));
|
||||
printf("server macad:%llx\n",iservermacadd);
|
||||
for (i=0;i<6;i++)
|
||||
printf("server mac adress %d is 0x%x \n",6-i,(unsigned int)(((iservermacadd>>(8*i))&0xFF)));
|
||||
printf("udp port:0x%x\n",udpport);
|
||||
printf("detector macad:%llx\n",idetectormacadd);
|
||||
for (i=0;i<6;i++)
|
||||
printf("detector mac adress %d is 0x%x \n",6-i,(unsigned int)(((idetectormacadd>>(8*i))&0xFF)));
|
||||
printf("detipad %x\n",detipad);
|
||||
printf("\n");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
n = receiveDataOnly(file_des,&adc,sizeof(adc));
|
||||
if (n < 0) {
|
||||
@@ -2805,7 +2809,7 @@ int configure_mac(int file_des) {
|
||||
//#endif
|
||||
#ifdef MCB_FUNCS
|
||||
if (ret==OK)
|
||||
configureMAC(ipad,imacadd,iservermacadd,digitalTestBit,adc,udpport);
|
||||
configureMAC(ipad,imacadd,idetectormacadd,detipad,digitalTestBit,adc,udpport);
|
||||
#endif
|
||||
if (ret==FAIL)
|
||||
printf("configuring MAC of mod %d failed\n", imod);
|
||||
|
||||
Reference in New Issue
Block a user