configuremac after starting receiver, also telling the server to send packets to receiver or cpu with receiver start and receiver stop

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@290 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-10-11 12:53:48 +00:00
parent e5a7d834db
commit 29a540818f
7 changed files with 174 additions and 18 deletions

View File

@ -705,6 +705,33 @@ int setContinousReadOut(int d) {
}
int startReceiver(int start) {
u_int32_t addr=CONFIG_REG;
#ifdef VERBOSE
if(start)
printf("Setting up detector to send to Receiver\n");
else
printf("Setting up detector to send to CPU\n");
#endif
int reg=bus_r(addr);
//for start recever, write 0 and for stop, write 1
if (!start)
bus_w(CONFIG_REG,reg|CPU_OR_RECEIVER_BIT);
else
bus_w(CONFIG_REG,reg&(~CPU_OR_RECEIVER_BIT));
reg=bus_r(addr);
#ifdef VERBOSE
printf("Config Reg %x\n", reg);
#endif
if (start && (!(reg&CPU_OR_RECEIVER_BIT)))
return OK;
if(!start && (reg&CPU_OR_RECEIVER_BIT))
return OK;
return FAIL;
}
u_int64_t getDetectorNumber() {
char output[255],mac[255]="";
u_int64_t res=0;