mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-26 08:10:02 +02:00
WIP, all servers with virtual stop and start working
This commit is contained in:
parent
cfe9a431f9
commit
ee67c28711
@ -20,10 +20,10 @@ install(TARGETS slsProjectCSettings
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
#add_subdirectory(ctbDetectorServer)
|
||||
#add_subdirectory(eigerDetectorServer)
|
||||
#add_subdirectory(gotthardDetectorServer)
|
||||
#add_subdirectory(jungfrauDetectorServer)
|
||||
add_subdirectory(ctbDetectorServer)
|
||||
add_subdirectory(eigerDetectorServer)
|
||||
add_subdirectory(gotthardDetectorServer)
|
||||
add_subdirectory(jungfrauDetectorServer)
|
||||
add_subdirectory(mythen3DetectorServer)
|
||||
#add_subdirectory(gotthard2DetectorServer)
|
||||
#add_subdirectory(moenchDetectorServer)
|
||||
add_subdirectory(gotthard2DetectorServer)
|
||||
add_subdirectory(moenchDetectorServer)
|
||||
|
@ -16,7 +16,6 @@ add_executable(ctbDetectorServer_virtual
|
||||
../slsDetectorServer/src/LTC2620.c
|
||||
../slsDetectorServer/src/MAX1932.c
|
||||
../slsDetectorServer/src/programFpgaBlackfin.c
|
||||
../slsDetectorServer/src/communication_virtual.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
)
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "slsDetectorFunctionList.h"
|
||||
#include "clogger.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include "AD7689.h" // slow adcs
|
||||
@ -10,9 +11,6 @@
|
||||
#include "UDPPacketHeaderGenerator.h"
|
||||
#include "common.h"
|
||||
#include "communication_funcs_UDP.h"
|
||||
#ifdef VIRTUAL
|
||||
#include "communication_virtual.h"
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
@ -40,6 +38,7 @@ extern void getIpAddressinString(char *cip, uint32_t ip);
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
char initErrorMessage[MAX_STR_LENGTH];
|
||||
sharedMem *thisMem;
|
||||
|
||||
#ifdef VIRTUAL
|
||||
pthread_t pthread_virtual_tid;
|
||||
@ -437,7 +436,9 @@ void initStopServer() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_stop = 0;
|
||||
if (!isControlServer) {
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->stop = virtual_stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -483,7 +484,9 @@ void setupDetector() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
memset(virtual_pattern, 0, sizeof(virtual_pattern));
|
||||
#endif
|
||||
@ -2222,21 +2225,27 @@ int startStateMachine() {
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFOBLUE, ("Starting State Machine\n"));
|
||||
virtual_status = 1;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
if (virtual_stop != 0) {
|
||||
LOG(logERROR, ("Cant start acquisition. "
|
||||
"Stop server has not updated stop status to 0\n"));
|
||||
return FAIL;
|
||||
}
|
||||
virtual_status = 1;
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (pthread_create(&pthread_virtual_tid, NULL, &start_timer, NULL)) {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
@ -2300,7 +2309,9 @@ void *start_timer(void *arg) {
|
||||
for (int frameNr = 0; frameNr != numFrames; ++frameNr) {
|
||||
|
||||
// update the virtual stop from stop server
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// check if virtual_stop is high
|
||||
if (virtual_stop == 1) {
|
||||
break;
|
||||
@ -2353,7 +2364,9 @@ void *start_timer(void *arg) {
|
||||
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
LOG(logINFOBLUE, ("Finished Acquiring\n"));
|
||||
return NULL;
|
||||
@ -2365,14 +2378,20 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_stop = 1;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// read till status is idle
|
||||
int tempStatus = 1;
|
||||
while (tempStatus == 1) {
|
||||
tempStatus = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
tempStatus = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
virtual_stop = 0;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
return OK;
|
||||
@ -2390,7 +2409,9 @@ int stopStateMachine() {
|
||||
enum runStatus getRunStatus() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (virtual_status == 0) {
|
||||
LOG(logINFOBLUE, ("Status: IDLE\n"));
|
||||
@ -2673,7 +2694,9 @@ int readFrameFromFifo() {
|
||||
uint32_t runBusy() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return virtual_status;
|
||||
#endif
|
||||
|
@ -5,7 +5,6 @@ set(src
|
||||
../slsDetectorServer/src/communication_funcs.c
|
||||
../slsDetectorServer/src/communication_funcs_UDP.c
|
||||
../slsDetectorServer/src/common.c
|
||||
../slsDetectorServer/src/communication_virtual.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
)
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
#include "slsDetectorFunctionList.h"
|
||||
#include "clogger.h"
|
||||
#include "common.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#ifndef VIRTUAL
|
||||
#include "Beb.h"
|
||||
#include "FebControl.h"
|
||||
#else
|
||||
#include "communication_virtual.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
@ -32,6 +31,7 @@ extern void getIpAddressinString(char *cip, uint32_t ip);
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
char initErrorMessage[MAX_STR_LENGTH];
|
||||
sharedMem *thisMem;
|
||||
|
||||
int default_tau_from_file = -1;
|
||||
enum detectorSettings thisSettings;
|
||||
@ -251,7 +251,8 @@ u_int64_t getDetectorMAC() {
|
||||
// execute and get address
|
||||
char output[255];
|
||||
#ifdef VIRTUAL
|
||||
FILE *sysFile = popen("cat /sys/class/net/$(ip route show default | awk "
|
||||
FILE *sysFile =
|
||||
popen("cat /sys/class/net/$(ip route show default | grep -v vpn | awk "
|
||||
"'/default/ {print $5}')/address",
|
||||
"r");
|
||||
#else
|
||||
@ -288,7 +289,8 @@ u_int32_t getDetectorIP() {
|
||||
// execute and get address
|
||||
char output[255];
|
||||
#ifdef VIRTUAL
|
||||
FILE *sysFile = popen("ifconfig $(ip route show default | awk '/default/ "
|
||||
FILE *sysFile =
|
||||
popen("ifconfig $(ip route show default | grep -v vpn | awk '/default/ "
|
||||
"{print $5}') | grep 'inet ' | cut -d ' ' -f10",
|
||||
"r");
|
||||
#else
|
||||
@ -365,7 +367,9 @@ void initStopServer() {
|
||||
getModuleConfiguration();
|
||||
virtual_stop = 0;
|
||||
if (!isControlServer) {
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->stop = virtual_stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
// get top/master in virtual
|
||||
readConfigFile();
|
||||
@ -670,7 +674,9 @@ void setupDetector() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1986,21 +1992,27 @@ int startStateMachine() {
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFOBLUE, ("Starting State Machine\n"));
|
||||
virtual_status = 1;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
if (virtual_stop != 0) {
|
||||
LOG(logERROR, ("Cant start acquisition. "
|
||||
"Stop server has not updated stop status to 0\n"));
|
||||
return FAIL;
|
||||
}
|
||||
virtual_status = 1;
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (pthread_create(&virtual_tid, NULL, &start_timer, NULL)) {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
@ -2107,7 +2119,9 @@ void *start_timer(void *arg) {
|
||||
usleep(eiger_virtual_transmission_delay_frame);
|
||||
|
||||
// update the virtual stop from stop server
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// check if virtual_stop is high
|
||||
if (virtual_stop == 1) {
|
||||
setStartingFrameNumber(frameNr + iframes + 1);
|
||||
@ -2210,7 +2224,9 @@ void *start_timer(void *arg) {
|
||||
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
LOG(logINFOBLUE, ("Finished Acquiring\n"));
|
||||
return NULL;
|
||||
@ -2222,14 +2238,20 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_stop = 1;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// read till status is idle
|
||||
int tempStatus = 1;
|
||||
while (tempStatus == 1) {
|
||||
tempStatus = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
tempStatus = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
virtual_stop = 0;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
return OK;
|
||||
@ -2289,7 +2311,9 @@ int startReadOut() {
|
||||
enum runStatus getRunStatus() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (virtual_status == 0) {
|
||||
LOG(logINFO, ("Status: IDLE\n"));
|
||||
|
@ -11,7 +11,6 @@ add_executable(gotthard2DetectorServer_virtual
|
||||
../slsDetectorServer/src/ALTERA_PLL_CYCLONE10.c
|
||||
../slsDetectorServer/src/ASIC_Driver.c
|
||||
../slsDetectorServer/src/programFpgaNios.c
|
||||
../slsDetectorServer/src/communication_virtual.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
)
|
||||
|
||||
|
@ -6,10 +6,10 @@
|
||||
#include "RegisterDefs.h"
|
||||
#include "clogger.h"
|
||||
#include "common.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "versionAPI.h"
|
||||
#ifdef VIRTUAL
|
||||
#include "communication_funcs_UDP.h"
|
||||
#include "communication_virtual.h"
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
@ -34,6 +34,7 @@ extern void getIpAddressinString(char *cip, uint32_t ip);
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
char initErrorMessage[MAX_STR_LENGTH];
|
||||
sharedMem *thisMem;
|
||||
|
||||
#ifdef VIRTUAL
|
||||
pthread_t pthread_virtual_tid;
|
||||
@ -344,7 +345,9 @@ void initStopServer() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_stop = 0;
|
||||
if (!isControlServer) {
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->stop = virtual_stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -395,7 +398,9 @@ void setupDetector() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2240,21 +2245,27 @@ int startStateMachine() {
|
||||
}
|
||||
LOG(logINFOBLUE, ("Starting State Machine\n"));
|
||||
// set status to running
|
||||
virtual_status = 1;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
if (virtual_stop != 0) {
|
||||
LOG(logERROR, ("Cant start acquisition. "
|
||||
"Stop server has not updated stop status to 0\n"));
|
||||
return FAIL;
|
||||
}
|
||||
virtual_status = 1;
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (pthread_create(&pthread_virtual_tid, NULL, &start_timer, NULL)) {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
@ -2322,7 +2333,9 @@ void *start_timer(void *arg) {
|
||||
for (int frameNr = 0; frameNr != numFrames; ++frameNr) {
|
||||
|
||||
// update the virtual stop from stop server
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// check if virtual_stop is high
|
||||
if (virtual_stop == 1) {
|
||||
break;
|
||||
@ -2401,7 +2414,9 @@ void *start_timer(void *arg) {
|
||||
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
LOG(logINFOBLUE, ("Finished Acquiring\n"));
|
||||
return NULL;
|
||||
@ -2413,14 +2428,20 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_stop = 1;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// read till status is idle
|
||||
int tempStatus = 1;
|
||||
while (tempStatus == 1) {
|
||||
tempStatus = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
tempStatus = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
virtual_stop = 0;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
return OK;
|
||||
@ -2434,7 +2455,9 @@ int stopStateMachine() {
|
||||
enum runStatus getRunStatus() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (virtual_status == 0) {
|
||||
LOG(logINFOBLUE, ("Status: IDLE\n"));
|
||||
@ -2512,7 +2535,9 @@ void readFrame(int *ret, char *mess) {
|
||||
u_int32_t runBusy() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return virtual_status;
|
||||
#endif
|
||||
|
@ -10,7 +10,6 @@ add_executable(gotthardDetectorServer_virtual
|
||||
../slsDetectorServer/src/common.c
|
||||
../slsDetectorServer/src/commonServerFunctions.c
|
||||
../slsDetectorServer/src/communication_funcs_UDP.c
|
||||
../slsDetectorServer/src/communication_virtual.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
)
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
#include "slsDetectorFunctionList.h"
|
||||
#include "RegisterDefs.h"
|
||||
#include "clogger.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include "LTC2620.h" // dacs
|
||||
#ifdef VIRTUAL
|
||||
#include "communication_funcs_UDP.h"
|
||||
#include "communication_virtual.h"
|
||||
#endif
|
||||
|
||||
#include "string.h"
|
||||
@ -31,6 +31,7 @@ extern void getIpAddressinString(char *cip, uint32_t ip);
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
char initErrorMessage[MAX_STR_LENGTH];
|
||||
sharedMem *thisMem;
|
||||
|
||||
#ifdef VIRTUAL
|
||||
pthread_t pthread_virtual_tid;
|
||||
@ -358,7 +359,9 @@ void initStopServer() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_stop = 0;
|
||||
if (!isControlServer) {
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->stop = virtual_stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -371,7 +374,9 @@ void setupDetector() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1516,21 +1521,27 @@ int startStateMachine() {
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFOBLUE, ("Starting State Machine\n"));
|
||||
virtual_status = 1;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
if (virtual_stop != 0) {
|
||||
LOG(logERROR, ("Cant start acquisition. "
|
||||
"Stop server has not updated stop status to 0\n"));
|
||||
return FAIL;
|
||||
}
|
||||
virtual_status = 1;
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (pthread_create(&pthread_virtual_tid, NULL, &start_timer, NULL)) {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
@ -1582,7 +1593,9 @@ void *start_timer(void *arg) {
|
||||
for (int frameNr = 0; frameNr != numFrames; ++frameNr) {
|
||||
|
||||
// update the virtual stop from stop server
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// check if virtual_stop is high
|
||||
if (virtual_stop == 1) {
|
||||
break;
|
||||
@ -1627,7 +1640,9 @@ void *start_timer(void *arg) {
|
||||
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
LOG(logINFOBLUE, ("Finished Acquiring\n"));
|
||||
return NULL;
|
||||
@ -1639,14 +1654,20 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_stop = 1;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// read till status is idle
|
||||
int tempStatus = 1;
|
||||
while (tempStatus == 1) {
|
||||
tempStatus = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
tempStatus = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
virtual_stop = 0;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
return OK;
|
||||
@ -1671,7 +1692,9 @@ int stopStateMachine() {
|
||||
enum runStatus getRunStatus() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (virtual_status == 0) {
|
||||
LOG(logINFOBLUE, ("Status: IDLE\n"));
|
||||
@ -1776,7 +1799,9 @@ void readFrame(int *ret, char *mess) {
|
||||
u_int32_t runBusy() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return virtual_status;
|
||||
#endif
|
||||
|
@ -12,7 +12,6 @@ add_executable(jungfrauDetectorServer_virtual
|
||||
../slsDetectorServer/src/MAX1932.c
|
||||
../slsDetectorServer/src/programFpgaBlackfin.c
|
||||
../slsDetectorServer/src/communication_funcs_UDP.c
|
||||
../slsDetectorServer/src/communication_virtual.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
)
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "slsDetectorFunctionList.h"
|
||||
#include "clogger.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include "ALTERA_PLL.h" // pll
|
||||
@ -8,7 +9,6 @@
|
||||
#include "common.h"
|
||||
#ifdef VIRTUAL
|
||||
#include "communication_funcs_UDP.h"
|
||||
#include "communication_virtual.h"
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
@ -33,6 +33,7 @@ extern void getIpAddressinString(char *cip, uint32_t ip);
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
char initErrorMessage[MAX_STR_LENGTH];
|
||||
sharedMem *thisMem;
|
||||
|
||||
#ifdef VIRTUAL
|
||||
pthread_t pthread_virtual_tid;
|
||||
@ -365,7 +366,9 @@ void initStopServer() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_stop = 0;
|
||||
if (!isControlServer) {
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->stop = virtual_stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
// temp threshold and reset event (read by stop server)
|
||||
setThresholdTemperature(DEFAULT_TMP_THRSHLD);
|
||||
@ -384,7 +387,9 @@ void setupDetector() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1672,21 +1677,27 @@ int startStateMachine() {
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFOBLUE, ("starting state machine\n"));
|
||||
virtual_status = 1;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
if (virtual_stop != 0) {
|
||||
LOG(logERROR, ("Cant start acquisition. "
|
||||
"Stop server has not updated stop status to 0\n"));
|
||||
return FAIL;
|
||||
}
|
||||
virtual_status = 1;
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (pthread_create(&pthread_virtual_tid, NULL, &start_timer, NULL)) {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
@ -1741,7 +1752,9 @@ void *start_timer(void *arg) {
|
||||
usleep(transmissionDelayUs);
|
||||
|
||||
// update the virtual stop from stop server
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// check if virtual_stop is high
|
||||
if (virtual_stop == 1) {
|
||||
setStartingFrameNumber(frameNr + iframes + 1);
|
||||
@ -1820,7 +1833,9 @@ void *start_timer(void *arg) {
|
||||
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
LOG(logINFOBLUE, ("Finished Acquiring\n"));
|
||||
return NULL;
|
||||
@ -1832,14 +1847,20 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_stop = 1;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// read till status is idle
|
||||
int tempStatus = 1;
|
||||
while (tempStatus == 1) {
|
||||
tempStatus = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
tempStatus = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
virtual_stop = 0;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
return OK;
|
||||
@ -1856,7 +1877,9 @@ int stopStateMachine() {
|
||||
enum runStatus getRunStatus() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (virtual_status == 0) {
|
||||
LOG(logINFOBLUE, ("Status: IDLE\n"));
|
||||
@ -1929,7 +1952,9 @@ void readFrame(int *ret, char *mess) {
|
||||
u_int32_t runBusy() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return virtual_status;
|
||||
#endif
|
||||
|
@ -14,7 +14,6 @@ add_executable(moenchDetectorServer_virtual
|
||||
../slsDetectorServer/src/MAX1932.c
|
||||
../slsDetectorServer/src/programFpgaBlackfin.c
|
||||
../slsDetectorServer/src/readDefaultPattern.c
|
||||
../slsDetectorServer/src/communication_virtual.c
|
||||
../slsDetectorServer/src/sharedMemory.c
|
||||
)
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "slsDetectorFunctionList.h"
|
||||
#include "clogger.h"
|
||||
#include "sharedMemory.h"
|
||||
#include "versionAPI.h"
|
||||
|
||||
#include "ALTERA_PLL.h" // pll
|
||||
@ -8,9 +9,6 @@
|
||||
#include "UDPPacketHeaderGenerator.h"
|
||||
#include "common.h"
|
||||
#include "communication_funcs_UDP.h"
|
||||
#ifdef VIRTUAL
|
||||
#include "communication_virtual.h"
|
||||
#endif
|
||||
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
@ -38,6 +36,7 @@ extern void getIpAddressinString(char *cip, uint32_t ip);
|
||||
int initError = OK;
|
||||
int initCheckDone = 0;
|
||||
char initErrorMessage[MAX_STR_LENGTH];
|
||||
sharedMem *thisMem;
|
||||
|
||||
#ifdef VIRTUAL
|
||||
pthread_t pthread_virtual_tid;
|
||||
@ -433,7 +432,9 @@ void initStopServer() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_stop = 0;
|
||||
if (!isControlServer) {
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->stop = virtual_stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@ -489,7 +490,9 @@ void setupDetector() {
|
||||
#ifdef VIRTUAL
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
memset(virtual_pattern, 0, sizeof(virtual_pattern));
|
||||
#endif
|
||||
@ -1855,21 +1858,27 @@ int startStateMachine() {
|
||||
return FAIL;
|
||||
}
|
||||
LOG(logINFOBLUE, ("Starting State Machine\n"));
|
||||
virtual_status = 1;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
if (virtual_stop != 0) {
|
||||
LOG(logERROR, ("Cant start acquisition. "
|
||||
"Stop server has not updated stop status to 0\n"));
|
||||
return FAIL;
|
||||
}
|
||||
virtual_status = 1;
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (pthread_create(&pthread_virtual_tid, NULL, &start_timer, NULL)) {
|
||||
LOG(logERROR, ("Could not start Virtual acquisition thread\n"));
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
@ -1932,7 +1941,9 @@ void *start_timer(void *arg) {
|
||||
for (int frameNr = 0; frameNr != numFrames; ++frameNr) {
|
||||
|
||||
// update the virtual stop from stop server
|
||||
virtual_stop = ComVirtual_getStop();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// check if virtual_stop is high
|
||||
if (virtual_stop == 1) {
|
||||
break;
|
||||
@ -1982,7 +1993,9 @@ void *start_timer(void *arg) {
|
||||
|
||||
virtual_status = 0;
|
||||
if (isControlServer) {
|
||||
ComVirtual_setStatus(virtual_status);
|
||||
lockSharedMemory(thisMem);
|
||||
thisMem->status = virtual_status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
LOG(logINFOBLUE, ("Finished Acquiring\n"));
|
||||
return NULL;
|
||||
@ -1994,14 +2007,20 @@ int stopStateMachine() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_stop = 1;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
// read till status is idle
|
||||
int tempStatus = 1;
|
||||
while (tempStatus == 1) {
|
||||
tempStatus = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
tempStatus = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
virtual_stop = 0;
|
||||
ComVirtual_setStop(virtual_stop);
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_stop = thisMem->stop;
|
||||
unlockSharedMemory(thisMem);
|
||||
LOG(logINFO, ("Stopped State Machine\n"));
|
||||
}
|
||||
return OK;
|
||||
@ -2019,7 +2038,9 @@ int stopStateMachine() {
|
||||
enum runStatus getRunStatus() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
if (virtual_status == 0) {
|
||||
LOG(logINFOBLUE, ("Status: IDLE\n"));
|
||||
@ -2259,7 +2280,9 @@ int readFrameFromFifo() {
|
||||
uint32_t runBusy() {
|
||||
#ifdef VIRTUAL
|
||||
if (!isControlServer) {
|
||||
virtual_status = ComVirtual_getStatus();
|
||||
lockSharedMemory(thisMem);
|
||||
virtual_status = thisMem->status;
|
||||
unlockSharedMemory(thisMem);
|
||||
}
|
||||
return virtual_status;
|
||||
#endif
|
||||
|
@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
#ifdef VIRTUAL
|
||||
// communciate between control and stop server
|
||||
|
||||
int ComVirtual_createFiles(const int port);
|
||||
void ComVirtual_setFileNames(const int port);
|
||||
void ComVirtual_setStatus(int value);
|
||||
int ComVirtual_getStatus();
|
||||
void ComVirtual_setStop(int value);
|
||||
int ComVirtual_getStop();
|
||||
int ComVirtual_writeToFile(int value, const char *fname,
|
||||
const char *serverName);
|
||||
int ComVirtual_readFromFile(int *value, const char *fname,
|
||||
const char *serverName);
|
||||
|
||||
#endif
|
@ -1,121 +0,0 @@
|
||||
#ifdef VIRTUAL
|
||||
#include "communication_virtual.h"
|
||||
#include "clogger.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h> // usleep
|
||||
|
||||
#define FILE_STATUS "/tmp/sls_virtual_server_status_"
|
||||
#define FILE_STOP "/tmp/sls_virtual_server_stop_"
|
||||
#define FD_STATUS 0
|
||||
#define FD_STOP 1
|
||||
#define FILE_NAME_LENGTH 1000
|
||||
|
||||
FILE *fd[2] = {NULL, NULL};
|
||||
char fnameStatus[FILE_NAME_LENGTH];
|
||||
char fnameStop[FILE_NAME_LENGTH];
|
||||
int portNumber = 0;
|
||||
|
||||
int ComVirtual_createFiles(const int port) {
|
||||
portNumber = port;
|
||||
// control server writign status file
|
||||
memset(fnameStatus, 0, FILE_NAME_LENGTH);
|
||||
sprintf(fnameStatus, "%s%d", FILE_STATUS, port);
|
||||
FILE *fd = NULL;
|
||||
if (NULL == (fd = fopen(fnameStatus, "w"))) {
|
||||
LOG(logERROR, ("Could not open the file %s for virtual communication\n",
|
||||
fnameStatus));
|
||||
return 0;
|
||||
}
|
||||
fclose(fd);
|
||||
LOG(logINFOBLUE, ("Created status file %s\n", fnameStatus));
|
||||
|
||||
// stop server writing stop file
|
||||
memset(fnameStop, 0, FILE_NAME_LENGTH);
|
||||
sprintf(fnameStop, "%s%d", FILE_STOP, port);
|
||||
if (NULL == (fd = fopen(fnameStop, "w"))) {
|
||||
LOG(logERROR, ("Could not open the file %s for virtual communication\n",
|
||||
fnameStop));
|
||||
return 0;
|
||||
}
|
||||
fclose(fd);
|
||||
LOG(logINFOBLUE, ("Created stop file %s\n", fnameStop));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ComVirtual_setFileNames(const int port) {
|
||||
portNumber = port;
|
||||
memset(fnameStatus, 0, FILE_NAME_LENGTH);
|
||||
memset(fnameStop, 0, FILE_NAME_LENGTH);
|
||||
sprintf(fnameStatus, "%s%d", FILE_STATUS, port);
|
||||
sprintf(fnameStop, "%s%d", FILE_STOP, port);
|
||||
}
|
||||
|
||||
void ComVirtual_setStatus(int value) {
|
||||
while (!ComVirtual_writeToFile(value, fnameStatus, "Control")) {
|
||||
usleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
int ComVirtual_getStatus() {
|
||||
int retval = 0;
|
||||
while (!ComVirtual_readFromFile(&retval, fnameStatus, "Stop")) {
|
||||
usleep(100);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
void ComVirtual_setStop(int value) {
|
||||
while (!ComVirtual_writeToFile(value, fnameStop, "Stop")) {
|
||||
usleep(100);
|
||||
}
|
||||
}
|
||||
|
||||
int ComVirtual_getStop() {
|
||||
int retval = 0;
|
||||
while (!ComVirtual_readFromFile(&retval, fnameStop, "Control")) {
|
||||
usleep(100);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
int ComVirtual_writeToFile(int value, const char *fname,
|
||||
const char *serverName) {
|
||||
FILE *fd = NULL;
|
||||
if (NULL == (fd = fopen(fname, "w"))) {
|
||||
LOG(logERROR, ("Vritual %s Server [%d] could not open "
|
||||
"the file %s for writing\n",
|
||||
serverName, portNumber, fname));
|
||||
return 0;
|
||||
}
|
||||
while (fwrite(&value, sizeof(value), 1, fd) < 1) {
|
||||
LOG(logERROR, ("Vritual %s Server [%d] could not write "
|
||||
"to file %s\n",
|
||||
serverName, portNumber, fname));
|
||||
return 0;
|
||||
}
|
||||
fclose(fd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int ComVirtual_readFromFile(int *value, const char *fname,
|
||||
const char *serverName) {
|
||||
FILE *fd = NULL;
|
||||
if (NULL == (fd = fopen(fname, "r"))) {
|
||||
LOG(logERROR, ("Vritual %s Server [%d] could not open "
|
||||
"the file %s for reading\n",
|
||||
serverName, portNumber, fname));
|
||||
return 0;
|
||||
}
|
||||
while (fread(value, sizeof(int), 1, fd) < 1) {
|
||||
LOG(logERROR, ("Vritual %s Server [%d] could not read "
|
||||
"from file %s\n",
|
||||
serverName, portNumber, fname));
|
||||
return 0;
|
||||
}
|
||||
fclose(fd);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user