Merge branch 'master' of gitorious.psi.ch:sls_det_software/sls_detector_software

This commit is contained in:
bergamaschi 2014-10-14 17:03:50 +02:00
commit 74ef04e726
8 changed files with 125 additions and 103 deletions

View File

@ -330,7 +330,7 @@ int Beb_SetUpUDPHeader(unsigned int beb_number, int ten_gig, unsigned int header
Beb_SwapDataFun(1,12,&(Beb_send_data[2])); Beb_SwapDataFun(1,12,&(Beb_send_data[2]));
if(!Beb_WriteTo(i)) return 0; if(!Beb_WriteTo(i)) return 0;
printf("dst_port:%d\n",dst_port); printf("beb dst_port:%d\n",dst_port);
return 1; return 1;
} }
@ -514,7 +514,7 @@ int Beb_RequestNImages(unsigned int beb_number, unsigned int left_right, int ten
if(in_two_requests) npackets/=2; if(in_two_requests) npackets/=2;
// printf("npackets:%d\n",npackets); // printf("npackets:%d\n",npackets);
//usleep needed after acquisition start, else you miss the single images //usleep needed after acquisition start, else you miss the single images
usleep(1000); usleep(10000);//less than this and it starts sending half stuff sometimes
//printf("beb no:%d left_right:%d ten_gig:%d dst_number:%d #images:%d header_size:%d test_just_send_out_packets_no_wait:%d\n",beb_number,left_right,ten_gig,dst_number,nimages, header_size,test_just_send_out_packets_no_wait); //printf("beb no:%d left_right:%d ten_gig:%d dst_number:%d #images:%d header_size:%d test_just_send_out_packets_no_wait:%d\n",beb_number,left_right,ten_gig,dst_number,nimages, header_size,test_just_send_out_packets_no_wait);
//printf("here: "<<beb_number<<","<<left_right<<","<<ten_gig<<","<<dst_number<<","<<1<<","<<header_size<<","<<test_just_send_out_packets_no_wait\n"); //printf("here: "<<beb_number<<","<<left_right<<","<<ten_gig<<","<<dst_number<<","<<1<<","<<header_size<<","<<test_just_send_out_packets_no_wait\n");

View File

@ -141,9 +141,11 @@ int Module_GetBottomDACValue(struct Module* mod,unsigned int i)
int Feb_Control_IsBottomModule(){
if(Module_BottomAddressIsValid(&modules[1]))
return 1;
return 0;
}
void Feb_Control_FebControl(){ void Feb_Control_FebControl(){
@ -694,7 +696,7 @@ int Feb_Control_SendHighVoltage(unsigned int dst_num,float* value){
int Feb_Control_DecodeDACString(char* dac_str, unsigned int* module_index, int* top, int* bottom, unsigned int* dac_ch){ int Feb_Control_DecodeDACString(char* dac_str, unsigned int* module_index, int* top, int* bottom, unsigned int* dac_ch){
char* local_s = dac_str; char* local_s = dac_str;
char temp[50]; char temp[50];
*module_index = 0; *module_index = 1;
char* p1 = strstr(local_s,"mod");//size_t p1 = local_s.find("mod"); char* p1 = strstr(local_s,"mod");//size_t p1 = local_s.find("mod");
char* p2 = strstr(local_s,"::");//size_t p2 =local_s.find("::"); char* p2 = strstr(local_s,"::");//size_t p2 =local_s.find("::");
@ -711,24 +713,24 @@ int Feb_Control_DecodeDACString(char* dac_str, unsigned int* module_index, int*
} }
*top = 1; *top = 1;//make them both 1 instead of this
*bottom = 1; *bottom = 1;
/* /*if(p1 = strstr(local_s,"top::")!=NULL){
if((p1 = local_s.find("top::"))!=string::npos){
local_s = local_s.substr(p1+5);
*bottom=0;
}else if((p1 = local_s.find("bottom::"))!=string::npos){
local_s = local_s.substr(p1+8);
*top=0;
}
*/
if(p1 = strstr(local_s,"top::")!=NULL){
strcpy(local_s,p1+5); strcpy(local_s,p1+5);
*bottom=0; *bottom=0;
}else if(p1 = strstr(local_s,"bottom::")!=NULL){ }else if(p1 = strstr(local_s,"bottom::")!=NULL){
strcpy(local_s,p1+8); strcpy(local_s,p1+8);
*top=0; *top=0;
} }*/
if(Module_BottomAddressIsValid(&modules[*module_index]))
*top=0;
else
*bottom=0;
*dac_ch = 0; *dac_ch = 0;
if(!Feb_Control_GetDACNumber(local_s,dac_ch)){ if(!Feb_Control_GetDACNumber(local_s,dac_ch)){
printf("Error in dac_name: %s (%s)\n",dac_str,local_s); printf("Error in dac_name: %s (%s)\n",dac_str,local_s);
@ -777,11 +779,11 @@ int Feb_Control_SetDAC(char* dac_str, int value, int is_a_voltage_mv){
unsigned int v = value; unsigned int v = value;
if(is_a_voltage_mv&&!Feb_Control_VoltageToDAC(value,&v,4096,0,2048)){ if(is_a_voltage_mv&&!Feb_Control_VoltageToDAC(value,&v,4096,0,2048)){
printf("Waring: SetDac bad value, %d. The range is 0 to 2048 mV.\n",value); printf("Warning: SetDac bad value, %d. The range is 0 to 2048 mV.\n",value);
return 0; return 0;
} }
if(v<0||v>4095){ if(v<0||v>4095){
printf("Waring: SetDac bad value, %d. The range is 0 to 4095.\n",v); printf("Warning: SetDac bad value, %d. The range is 0 to 4095.\n",v);
return 0; return 0;
} }
@ -940,29 +942,42 @@ int Feb_Control_SetTrimbits(unsigned int module_num, unsigned int *trimbits){
int i; int i;
for(i=0;i<8;i++){ // column loop i for(i=0;i<8;i++){ // column loop i
//printf("i:%d\t\t",i); //printf("i:%d\t\t",i);
if(Module_TopAddressIsValid(&modules[0])){
trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_l+i])<<((7-i)*4);//low trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_l+i])<<((7-i)*4);//low
trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_l+i])>>3)<<((7-i)*4);//upper trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_l+i])>>3)<<((7-i)*4);//upper
trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_r+i])<<((7-i)*4);//low trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[row_set*16480+super_column_start_position_r+i])<<((7-i)*4);//low
trimbits_to_load_r[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_r+i])>>3)<<((7-i)*4);//upper trimbits_to_load_r[offset+chip_sc+32] |= ((0x38 & trimbits[row_set*16480+super_column_start_position_r+i])>>3)<<((7-i)*4);//upper
/* }else{
trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[263679 - (row_set*16480+super_column_start_position_l+i)])<<((7-i)*4);//low trimbits_to_load_l[offset+chip_sc] |= ( 0x7 & trimbits[263679 - (row_set*16480+super_column_start_position_l+i)])<<((7-i)*4);//low
trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[263679 - (row_set*16480+super_column_start_position_l+i)])>>3)<<((7-i)*4);//upper trimbits_to_load_l[offset+chip_sc+32] |= ((0x38 & trimbits[263679 - (row_set*16480+super_column_start_position_l+i)])>>3)<<((7-i)*4);//upper
trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[263679 - (row_set*16480+super_column_start_position_r+i)])<<((7-i)*4);//low trimbits_to_load_r[offset+chip_sc] |= ( 0x7 & trimbits[263679 - (row_set*16480+super_column_start_position_r+i)])<<((7-i)*4);//low
trimbits_to_load_r[offset+chip_sc+32] |= ((0x38 & trimbits[263679 - (row_set*16480+super_column_start_position_r+i)])>>3)<<((7-i)*4);//upper trimbits_to_load_r[offset+chip_sc+32] |= ((0x38 & trimbits[263679 - (row_set*16480+super_column_start_position_r+i)])>>3)<<((7-i)*4);//upper
*/
}
} // end column loop i } // end column loop i
} //end supercolumn loop sc } //end supercolumn loop sc
} //end row loop } //end row loop
if(Module_TopAddressIsValid(&modules[0])){
if(!Feb_Interface_WriteMemoryInLoops(Module_GetTopLeftAddress(&modules[0]),0,0,1024,trimbits_to_load_r)|| if(!Feb_Interface_WriteMemoryInLoops(Module_GetTopLeftAddress(&modules[1]),0,0,1024,trimbits_to_load_r)||
!Feb_Interface_WriteMemoryInLoops(Module_GetTopRightAddress(&modules[0]),0,0,1024,trimbits_to_load_l)|| !Feb_Interface_WriteMemoryInLoops(Module_GetTopRightAddress(&modules[1]),0,0,1024,trimbits_to_load_l)||
//if(!Feb_Interface_WriteMemory(Module_GetTopLeftAddress(&modules[0]),0,0,1023,trimbits_to_load_r)|| //if(!Feb_Interface_WriteMemory(Module_GetTopLeftAddress(&modules[0]),0,0,1023,trimbits_to_load_r)||
// !Feb_Interface_WriteMemory(Module_GetTopRightAddress(&modules[0]),0,0,1023,trimbits_to_load_l)|| // !Feb_Interface_WriteMemory(Module_GetTopRightAddress(&modules[0]),0,0,1023,trimbits_to_load_l)||
!Feb_Control_StartDAQOnlyNWaitForFinish(5000)){ !Feb_Control_StartDAQOnlyNWaitForFinish(5000)){
printf(" some errror!\n"); printf(" some errror!\n");
return 0; return 0;
} }
}else{
if(!Feb_Interface_WriteMemoryInLoops(Module_GetBottomLeftAddress(&modules[1]),0,0,1024,trimbits_to_load_r)||
!Feb_Interface_WriteMemoryInLoops(Module_GetBottomRightAddress(&modules[1]),0,0,1024,trimbits_to_load_l)||
//if(!Feb_Interface_WriteMemory(Module_GetTopLeftAddress(&modules[0]),0,0,1023,trimbits_to_load_r)||
// !Feb_Interface_WriteMemory(Module_GetTopRightAddress(&modules[0]),0,0,1023,trimbits_to_load_l)||
!Feb_Control_StartDAQOnlyNWaitForFinish(5000)){
printf(" some errror!\n");
return 0;
}
}
} //end row_set loop (groups of 16 rows) } //end row_set loop (groups of 16 rows)
} // end l_r loop } // end l_r loop
@ -982,11 +997,14 @@ unsigned int* Feb_Control_GetTrimbits(){
unsigned int Feb_Control_AddressToAll(){ unsigned int Feb_Control_AddressToAll(){
if(moduleSize==0) return 0; if(moduleSize==0) return 0;
if(Module_BottomAddressIsValid(&modules[1])){//printf("************* bottom\n");
return Module_GetBottomLeftAddress(&modules[1])|Module_GetBottomRightAddress(&modules[1]);}
if(Module_BottomAddressIsValid(&modules[0])){
//printf("************* bottom\n");
return Module_GetBottomLeftAddress(&modules[0])|Module_GetBottomRightAddress(&modules[0]);
}
//printf("************* top\n"); //printf("************* top\n");
return Module_GetTopLeftAddress(&modules[1])|Module_GetTopRightAddress(&modules[1]); return Module_GetTopLeftAddress(&modules[0])|Module_GetTopRightAddress(&modules[0]);
} }
int Feb_Control_SetCommandRegister(unsigned int cmd){ int Feb_Control_SetCommandRegister(unsigned int cmd){
@ -1035,7 +1053,7 @@ int Feb_Control_AcquisitionInProgress(){
//printf("right:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopRightAddress(&modules[1]),&status_reg_r)); //printf("right:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopRightAddress(&modules[1]),&status_reg_r));
//printf("left:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopLeftAddress(&modules[1]),&status_reg_l)); //printf("left:%d\n",Feb_Control_GetDAQStatusRegister(Module_GetTopLeftAddress(&modules[1]),&status_reg_l));
if(Module_BottomAddressIsValid(&modules[0])){ if(Module_BottomAddressIsValid(&modules[1])){
//printf("************* bottom1\n"); //printf("************* bottom1\n");
if(!(Feb_Control_GetDAQStatusRegister(Module_GetBottomRightAddress(&modules[1]),&status_reg_r))) if(!(Feb_Control_GetDAQStatusRegister(Module_GetBottomRightAddress(&modules[1]),&status_reg_r)))
@ -1057,7 +1075,7 @@ int Feb_Control_AcquisitionInProgress(){
} }
*/ */
return 0; //i.e. not running (status_reg_r|status_reg_l)&DAQ_STATUS_DAQ_RUNNING; /*printf("**idle\n");*/return 0; //i.e. not running (status_reg_r|status_reg_l)&DAQ_STATUS_DAQ_RUNNING;
} }
int Feb_Control_Reset(){ int Feb_Control_Reset(){
@ -1370,7 +1388,7 @@ int Feb_Control_WriteNRead(char* message, int length, int max_length){
} }
*/ */
int Feb_Control_StartAcquisition(){ int Feb_Control_StartAcquisition(){printf("****** starting acquisition********* \n");
static unsigned int reg_nums[20]; static unsigned int reg_nums[20];
static unsigned int reg_vals[20]; static unsigned int reg_vals[20];

View File

@ -65,7 +65,7 @@ int Module_GetBottomDACValue(struct Module* mod,unsigned int i);
int Feb_Control_IsBottomModule();
void Feb_Control_ClearModules(); void Feb_Control_ClearModules();

View File

@ -1,6 +1,6 @@
CC = powerpc-4xx-softfloat-gcc CC = powerpc-4xx-softfloat-gcc
CCX = powerpc-4xx-softfloat-g++ CCX = powerpc-4xx-softfloat-g++
CFLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT -DSTOP_SERVER #-DVERBOSE #-DVIRTUAL -DPCCOMPILE CFLAGS += -Wall -DDACS_INT -DEIGERD -DSLS_DETECTOR_FUNCTION_LIST -DDACS_INT #-DSTOP_SERVER #-DVERBOSE #-DVIRTUAL -DPCCOMPILE
LDLIBS += -lm -lstdc++ LDLIBS += -lm -lstdc++
PROGS = eigerDetectorServer PROGS = eigerDetectorServer

View File

@ -53,7 +53,8 @@ int dst_requested[32] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
int default_dac_values[16] = {0,2000,2000,1250,700,1278,500,500,2000,500,500,550,550,100,1000,775}; int default_dac_values[16] = {0,2000,2000,1250,700,1278,500,500,2000,500,500,550,550,100,1000,775};
enum masterFlags masterMode=NO_MASTER;
enum masterFlags trialMasterMode=NO_MASTER;
int initDetector(){ int initDetector(){
int imod,i,n; int imod,i,n;
@ -128,9 +129,12 @@ int initDetector(){
setHighVolage(150,0); setHighVolage(150,0);
setIODelay(675,0); setIODelay(675,0);
setTiming(AUTO_TIMING); setTiming(AUTO_TIMING);
//setMaster(GET_MASTER);
int enable[2] = {0,1}; int enable[2] = {0,1};
setExternalGating(enable);//disable external gating setExternalGating(enable);//disable external gating
if(getDetectorNumber() == 0xbeb031)
trialMasterMode = IS_MASTER;
return 1; return 1;
} }
@ -452,9 +456,14 @@ enum detectorSettings setSettings(enum detectorSettings sett, int imod){
int startStateMachine(){ int startStateMachine(){
printf("Going to start acquisition\n");
if(Feb_Control_StartAcquisition()){
if(trialMasterMode == IS_MASTER){
printf("Going to start acquisition\n");
Feb_Control_StartAcquisition();
}
printf("requesting images\n");
//RequestImages(); //RequestImages();
int ret_val = 0; int ret_val = 0;
dst_requested[0] = 1; dst_requested[0] = 1;
@ -471,15 +480,18 @@ int startStateMachine(){
return FAIL; return FAIL;
else else
return OK; return OK;
}
return FAIL; return FAIL;
} }
int stopStateMachine(){ int stopStateMachine(){
if(trialMasterMode == IS_MASTER){
printf("Going to stop acquisition\n"); printf("Going to stop acquisition\n");
if(Feb_Control_StopAcquisition()) if(Feb_Control_StopAcquisition())
return OK; return OK;
}else return OK;
return FAIL; return FAIL;
} }
@ -509,10 +521,10 @@ int startReadOut(){
enum runStatus getRunStatus(){ enum runStatus getRunStatus(){
int i = Feb_Control_AcquisitionInProgress(); int i = Feb_Control_AcquisitionInProgress();
if(i== 0){ if(i== 0){
printf("IDLE\n"); /*printf("IDLE\n");*/
return IDLE; return IDLE;
}else{ }else{
printf("RUNNING\n"); /*printf("RUNNING\n");*/
return RUNNING; return RUNNING;
} }
} }
@ -676,7 +688,6 @@ 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){
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;
int dst_port = udpport;
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);
sprintf(dst_ip,"%d.%d.%d.%d",(ipad>>24)&0xff,(ipad>>16)&0xff,(ipad>>8)&0xff,(ipad)&0xff); sprintf(dst_ip,"%d.%d.%d.%d",(ipad>>24)&0xff,(ipad>>16)&0xff,(ipad>>8)&0xff,(ipad)&0xff);
sprintf(src_mac,"%02x:%02x:%02x:%02x:%02x:%02x",(unsigned int)((detectormacadd>>40)&0xFF), sprintf(src_mac,"%02x:%02x:%02x:%02x:%02x:%02x",(unsigned int)((detectormacadd>>40)&0xFF),
@ -693,15 +704,17 @@ int configureMAC(int ipad, long long int macad, long long int detectormacadd, in
(unsigned int)((macad>>0)&0xFF)); (unsigned int)((macad>>0)&0xFF));
printf("src_port:%d\n",src_port); printf("src_port:%d\n",src_port);
printf("dst_port:%d\n",dst_port);
printf("src_ip:%s\n",src_ip); printf("src_ip:%s\n",src_ip);
printf("dst_ip:%s\n",dst_ip); printf("dst_ip:%s\n",dst_ip);
printf("src_mac:%s\n",src_mac); printf("src_mac:%s\n",src_mac);
printf("dst_mac:%s\n\n",dst_mac); printf("dst_mac:%s\n",dst_mac);
int beb_num = 34; int beb_num = 34;
int header_number = 0; int header_number = 0;
int dst_port = udpport;
printf("dst_port:%d\n\n",dst_port);
int i=0; int i=0;
/* for(i=0;i<32;i++){/** modified for Aldo*/ /* for(i=0;i<32;i++){/** modified for Aldo*/
@ -713,11 +726,12 @@ int configureMAC(int ipad, long long int macad, long long int detectormacadd, in
header_number = 32; header_number = 32;
dst_port = udpport2; dst_port = udpport2;
printf("dst_port:%d\n\n",dst_port);
/*for(i=0;i<32;i++){*//** modified for Aldo*/ /*for(i=0;i<32;i++){*//** modified for Aldo*/
if(Beb_SetBebSrcHeaderInfos(beb_num,send_to_ten_gig,src_mac,src_ip,src_port) && if(Beb_SetBebSrcHeaderInfos(beb_num,send_to_ten_gig,src_mac,src_ip,src_port) &&
Beb_SetUpUDPHeader(beb_num,send_to_ten_gig,header_number+i,dst_mac,dst_ip, dst_port)) Beb_SetUpUDPHeader(beb_num,send_to_ten_gig,header_number+i,dst_mac,dst_ip, dst_port))
printf("set up right ok\n"); printf("set up right ok\n\n");
else return -1; else return -1;
/*}*/ /*}*/
@ -885,6 +899,9 @@ void setExternalGating(int enable[]){
enum masterFlags setMaster(enum masterFlags arg){ enum masterFlags setMaster(enum masterFlags arg){
//if(arg != GET_MASTER)
// masterMode = arg;
return NO_MASTER; return NO_MASTER;
} }

View File

@ -1198,15 +1198,6 @@ int multiSlsDetector::startAcquisition(){
int i=0; int i=0;
int ret=OK, ret1=OK; int ret=OK, ret1=OK;
if (detectors[0]) {
ret=detectors[0]->startAcquisition();
if(detectors[0]->getErrorMask())
setErrorMask(getErrorMask()|(1<<i));
if (ret!=OK)
ret1=FAIL;
}
/*
for (i=0; i<thisMultiDetector->numberOfDetectors; i++) { for (i=0; i<thisMultiDetector->numberOfDetectors; i++) {
if (i!=thisMultiDetector->masterPosition) if (i!=thisMultiDetector->masterPosition)
if (detectors[i]) { if (detectors[i]) {
@ -1226,7 +1217,7 @@ int multiSlsDetector::startAcquisition(){
if (ret!=OK) if (ret!=OK)
ret1=FAIL; ret1=FAIL;
} }
}*/ }
return ret1; return ret1;
}; };
@ -1515,6 +1506,7 @@ int multiSlsDetector::startAndReadAllNoWait(){
ret1=FAIL; ret1=FAIL;
} }
} }
return ret1; return ret1;
} }
@ -1536,20 +1528,16 @@ slsDetectorDefs::runStatus multiSlsDetector::getRunStatus() {
return s; return s;
} }
if (detectors[0]){
s=detectors[0]->getRunStatus();
if(detectors[0]->getErrorMask())
setErrorMask(getErrorMask()|(1<<0));
}
for (int i=1; i<thisMultiDetector->numberOfDetectors; i++) { for (int i=1; i<thisMultiDetector->numberOfDetectors; i++) {
s1=detectors[i]->getRunStatus(); s1=detectors[i]->getRunStatus();
if(detectors[i]->getErrorMask()) if(detectors[i]->getErrorMask())
setErrorMask(getErrorMask()|(1<<i)); setErrorMask(getErrorMask()|(1<<i));
if (s1==ERROR) if (s1==ERROR)
s=ERROR; s=ERROR;
if (s1==IDLE && s!=IDLE) if (s1!=IDLE)
s=ERROR; s = s1;
// if (s1==IDLE && s!=IDLE)
// s=ERROR;
} }
return s; return s;

View File

@ -54,8 +54,8 @@ int init_detector(int b) {
#endif #endif
}else{ }else{
Feb_Interface_FebInterface(); Feb_Interface_FebInterface();
Feb_Control_FebControl(); //Feb_Control_FebControl();
printf("FEb control constructor done\n"); // printf("FEb control constructor done\n");
/* Beb_Beb(-1); /* Beb_Beb(-1);
printf("BEB constructor done\n");*/ printf("BEB constructor done\n");*/
} }
@ -2963,7 +2963,7 @@ int execute_trimming(int file_des) {
int configure_mac(int file_des) {printf("in hereeeeee\n"); int configure_mac(int file_des) {
int retval=-100; int retval=-100;
int ret=OK,ret1=OK; int ret=OK,ret1=OK;
@ -2979,7 +2979,7 @@ int configure_mac(int file_des) {printf("in hereeeeee\n");
int udpport2; int udpport2;
int detipad; int detipad;
#endif #endif
printf("111\n");
sprintf(mess,"Can't configure MAC\n"); sprintf(mess,"Can't configure MAC\n");
n = receiveData(file_des,arg,sizeof(arg),OTHER); n = receiveData(file_des,arg,sizeof(arg),OTHER);
@ -2987,7 +2987,7 @@ printf("111\n");
sprintf(mess,"Error reading from socket\n"); sprintf(mess,"Error reading from socket\n");
ret=FAIL; ret=FAIL;
} }
printf("222\n");
#ifdef MYTHEND #ifdef MYTHEND
ret = FAIL; ret = FAIL;
strcpy(mess,"Not applicable/implemented for this detector\n"); strcpy(mess,"Not applicable/implemented for this detector\n");
@ -3007,7 +3007,6 @@ printf("222\n");
printf("mess:%s\n",mess); printf("mess:%s\n",mess);
} }
#endif #endif
printf("333\n");
//#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*/
@ -3036,9 +3035,9 @@ printf("333\n");
if(retval==-1) ret=FAIL; if(retval==-1) ret=FAIL;
} }
#endif #endif
//#ifdef VERBOSE #ifdef VERBOSE
printf("Configured MAC with retval %d\n", retval); printf("Configured MAC with retval %d\n", retval);
//#endif #endif
if (ret==FAIL) { if (ret==FAIL) {
printf("configuring MAC of mod %d failed\n", imod); printf("configuring MAC of mod %d failed\n", imod);
} }