diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index 6dd0e758a..fe51b43bd 100755 Binary files a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer and b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 7ea572bfe..295b307be 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 7046f4a16..90d3a183e 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -188,7 +188,9 @@ int checkKernelVersion() { #ifdef VIRTUAL return OK; #endif - return validateKernelVersion(KERNEL_DATE_VRSN); + char version[255]={0}; + strcpy(version, KERNEL_DATE_VRSN); + return validateKernelVersion(version, sizeof(version)); } int checkType() { diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h index 44fa5f4e6..d0c225497 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorServer_defs.h @@ -4,7 +4,7 @@ #include "sls/sls_detector_defs.h" #define REQRD_FRMWRE_VRSN (0x210527) -#define KERNEL_DATE_VRSN "Wed May 20 13:58:38 CEST 2020" +#define KERNEL_DATE_VRSN "Mon May 10 18:00:21 CEST 2021" #define ID_FILE "detid_gotthard2.txt" #define LINKED_SERVER_NAME "gotthard2DetectorServer" diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index a62826926..b2e8d925b 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index 613a0a3e4..f4719542f 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/include/common.h b/slsDetectorServers/slsDetectorServer/include/common.h index 0435c7df2..f69772087 100644 --- a/slsDetectorServers/slsDetectorServer/include/common.h +++ b/slsDetectorServers/slsDetectorServer/include/common.h @@ -26,9 +26,9 @@ int ConvertToDifferentRange(int inputMin, int inputMax, int outputMin, int getAbsPath(char *buf, size_t bufSize, char *fname); -int getTimeFromString(char *buf, time_t *result); +int getTimeFromString(char *buf, size_t len, time_t *result); -int validateKernelVersion(char *expectedVersion); +int validateKernelVersion(char *expectedVersion, size_t len); void validate(int *ret, char *mess, int arg, int retval, char *modename, enum numberMode nummode); diff --git a/slsDetectorServers/slsDetectorServer/src/common.c b/slsDetectorServers/slsDetectorServer/src/common.c index fd0a60c9e..ff9ce3c93 100644 --- a/slsDetectorServers/slsDetectorServer/src/common.c +++ b/slsDetectorServers/slsDetectorServer/src/common.c @@ -65,9 +65,10 @@ int getAbsPath(char *buf, size_t bufSize, char *fname) { return OK; } -int getTimeFromString(char *buf, time_t *result) { +int getTimeFromString(char *buf, size_t len, time_t *result) { // remove timezone as strptime cannot validate timezone despite - // documentation + // documentation (for blackfin) + LOG(logDEBUG, ("buf for time %s\n", buf)); const char *timezone = {"CEST"}; char *res = strstr(buf, timezone); if (res != NULL) { @@ -83,14 +84,18 @@ int getTimeFromString(char *buf, time_t *result) { // convert to time structure struct tm t; - if (NULL == strptime(buf, "%a %b %d %H:%M:%S %Z %Y", &t)) { + if (NULL == strptime(buf, "%a %b %d %H:%M:%S %Y", &t)) { return FAIL; } + + // print time structure + LOG(logDEBUG, ("%d %d %d %d:%d:%d %d (day date month H:M:S year)\n", t.tm_wday, t.tm_mday, t.tm_mon, t.tm_year +1900, t.tm_hour, t.tm_min, t.tm_sec)); + *result = mktime(&t); return OK; } -int validateKernelVersion(char *expectedVersion) { +int validateKernelVersion(char *expectedVersion, size_t len) { // extract kernel date string struct utsname buf = {0}; if (uname(&buf) == -1) { @@ -110,14 +115,14 @@ int validateKernelVersion(char *expectedVersion) { // convert kernel date string into time time_t kernelDate; - if (getTimeFromString(output, &kernelDate) == FAIL) { + if (getTimeFromString(output, sizeof(output), &kernelDate) == FAIL) { LOG(logERROR, ("Could not parse retrieved kernel date, %s\n", output)); return FAIL; } // convert expected date into time time_t expDate; - if (getTimeFromString(expectedVersion, &expDate) == FAIL) { + if (getTimeFromString(expectedVersion, len, &expDate) == FAIL) { LOG(logERROR, ("Could not parse expected kernel date, %s\n", expectedVersion)); return FAIL; diff --git a/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c b/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c index 1d900914f..4fa232cb6 100644 --- a/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c +++ b/slsDetectorServers/slsDetectorServer/src/programFpgaBlackfin.c @@ -25,14 +25,16 @@ int gpioDefined = 0; extern int executeCommand(char *command, char *result, enum TLogLevel level); int latestKernelVerified = -1; -#define KERNEL_DATE_VRSN_3GPIO "Fri Oct 29 07:04:21 2021" +#define KERNEL_DATE_VRSN_3GPIO "Fri Oct 29 00:00:00 2021" void defineGPIOpins() { #ifdef VIRTUAL return; #endif if (latestKernelVerified == -1) { - if (FAIL == validateKernelVersion(KERNEL_DATE_VRSN_3GPIO)) { + char version[255]={0}; + strcpy(version, KERNEL_DATE_VRSN_3GPIO); + if (FAIL == validateKernelVersion(version, sizeof(version))) { latestKernelVerified = 0; LOG(logWARNING, ("Kernel too old to use gpio 3 pins. Not the end " diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 7cbc79ac5..c774ada78 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -7,9 +7,9 @@ #define APIRECEIVER 0x211020 #define APIGUI 0x211021 #define APIEIGER 0x211027 -#define APICTB 0x211029 #define APIGOTTHARD 0x211029 -#define APIGOTTHARD2 0x211029 #define APIMYTHEN3 0x211029 -#define APIMOENCH 0x211028 #define APIJUNGFRAU 0x211102 +#define APIMOENCH 0x211029 +#define APICTB 0x211102 +#define APIGOTTHARD2 0x211102