server locking flag (not real lock), last client vs this client, change port implemented, most funcs of the multidetector implemented again

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@64 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
bergamaschi
2011-11-25 15:33:25 +00:00
parent f1654363e0
commit 4cbd9b2265
14 changed files with 1958 additions and 1388 deletions

View File

@ -975,14 +975,13 @@ u_int32_t* fifo_read_event()
#ifdef VERYVERBOSE
printf("Copying to ptr %x %d\n",now_ptr, dataBytes);
#endif
#ifdef VERYVERBOSE
printf("after readout %08x %08x\n", runState(), bus_r(LOOK_AT_ME_REG));
for (ichip=0; ichip<nModBoard*NCHIP; ichip++) {
if ((fifoReadCounter(ichip)&FIFO_COUNTER_MASK)%128)
printf("FIFO %d contains %d words\n",ichip,(fifoReadCounter(ichip)&FIFO_COUNTER_MASK));
}
#endif
if (storeInRAM>0) {
now_ptr+=dataBytes;
}

View File

@ -5,7 +5,7 @@
#include <stdlib.h>
int sockfd;
extern int sockfd;
void error(char *msg)
@ -18,6 +18,8 @@ int main(int argc, char *argv[])
int portno, b;
char cmd[100];
int retval=OK;
int sd, fd;
if (argc==1) {
portno = DEFAULT_PORTNO;
@ -37,8 +39,12 @@ int main(int argc, char *argv[])
init_detector(b);
bindSocket(portno);
if (getServerError()) {
sd=bindSocket(portno);
sockfd=sd;
if (getServerError(sd)) {
printf("server error!\n");
return -1;
}
@ -58,21 +64,21 @@ int main(int argc, char *argv[])
#ifdef VERY_VERBOSE
printf("Waiting for client call\n");
#endif
acceptConnection();
fd=acceptConnection(sockfd);
#ifdef VERY_VERBOSE
printf("Conenction accepted\n");
#endif
retval=decode_function();
#ifdef VERY_VERBOSE
retval=decode_function(fd);
//#ifdef VERY_VERBOSE
printf("function executed\n");
#endif
closeConnection();
//#endif
closeConnection(fd);
#ifdef VERY_VERBOSE
printf("connection closed\n");
#endif
}
exitServer();
exitServer(sockfd);
printf("Goodbye!\n");
return 0;

View File

@ -38,5 +38,5 @@
#define CLK_FREQ 100E+6
#define THIS_SOFTWARE_VERSION 0x20100429
#define THIS_SOFTWARE_VERSION 0x20111125
#endif

File diff suppressed because it is too large Load Diff

View File

@ -12,9 +12,12 @@
#define GOODBYE -200
int sockfd;
int function_table();
int decode_function();
int decode_function(int);
int init_detector(int);
@ -64,7 +67,9 @@ int get_roi(int);
int set_speed(int);
int set_readout_flags(int);
int execute_trimming(int);
int lock_server(int);
int set_port(int);
int get_last_client_ip(int);