mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
slsReceiver, slsDetector, eiger and jungfrau server: client checks firmware and software an dreceiver compatibility for each time shared memory is cleaned up
This commit is contained in:
Binary file not shown.
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: cb635d800a5e1de6cf3330f03a98ffc382879cf3
|
||||
Revision: 339
|
||||
Branch: mergevirtual
|
||||
Repsitory UUID: 4d4e4a4ce7a91af094251ed0903575ba7e73ef5f
|
||||
Revision: 341
|
||||
Branch: versioning
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3832
|
||||
Last Changed Date: 2018-05-23 11:11:12.000000002 +0200 ./Makefile.virtual
|
||||
Last Changed Rev: 3847
|
||||
Last Changed Date: 2018-05-28 18:02:50.000000002 +0200 ./xparameters.h
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "cb635d800a5e1de6cf3330f03a98ffc382879cf3"
|
||||
#define GITREPUUID "4d4e4a4ce7a91af094251ed0903575ba7e73ef5f"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3832
|
||||
#define GITDATE 0x20180523
|
||||
#define GITBRANCH "mergevirtual"
|
||||
#define GITREV 0x3847
|
||||
#define GITDATE 0x20180528
|
||||
#define GITBRANCH "versioning"
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "gitInfoEiger.h"
|
||||
#include "FebControl.h"
|
||||
#include "Beb.h"
|
||||
#include "versionAPI.h"
|
||||
#endif
|
||||
|
||||
int default_tau_from_file= -1;
|
||||
@ -89,18 +90,32 @@ int normal = 0;
|
||||
uint32_t detid = 0;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* basic tests */
|
||||
|
||||
int firmware_compatibility = OK;
|
||||
int firmware_check_done = 0;
|
||||
char firmware_message[MAX_STR_LENGTH];
|
||||
|
||||
|
||||
int isFirmwareCheckDone() {
|
||||
return firmware_check_done;
|
||||
}
|
||||
|
||||
int getFirmwareCheckResult(char** mess) {
|
||||
*mess = firmware_message;
|
||||
return firmware_compatibility;
|
||||
}
|
||||
|
||||
void checkFirmwareCompatibility(int flag){
|
||||
firmware_compatibility = OK;
|
||||
firmware_check_done = 0;
|
||||
memset(firmware_message, 0, MAX_STR_LENGTH);
|
||||
#ifdef VIRTUAL
|
||||
cprintf(BLUE,"\n\n"
|
||||
"********************************************************\n"
|
||||
"***************** EIGER Virtual Server *****************\n"
|
||||
"********************************************************\n");
|
||||
firmware_check_done = 1;
|
||||
return;
|
||||
#endif
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
@ -108,6 +123,7 @@ void checkFirmwareCompatibility(int flag){
|
||||
int64_t fwversion = getDetectorId(DETECTOR_FIRMWARE_VERSION);
|
||||
int64_t swversion = getDetectorId(DETECTOR_SOFTWARE_VERSION);
|
||||
int64_t sw_fw_apiversion = getDetectorId(SOFTWARE_FIRMWARE_API_VERSION);
|
||||
int64_t client_sw_apiversion = getDetectorId(CLIENT_SOFTWARE_API_VERSION);
|
||||
|
||||
cprintf(BLUE,"\n\n"
|
||||
"********************************************************\n"
|
||||
@ -120,37 +136,61 @@ void checkFirmwareCompatibility(int flag){
|
||||
"Firmware Version:\t\t %lld\n"
|
||||
"Software Version:\t\t %llx\n"
|
||||
"F/w-S/w API Version:\t\t %lld\n"
|
||||
"Required Firmware Version:\t %d\n\n"
|
||||
"Required Firmware Version:\t %d\n"
|
||||
"Client-Software API Version:\t 0x%llx\n"
|
||||
"\n"
|
||||
"********************************************************\n",
|
||||
(unsigned int)ipadd,
|
||||
(long long unsigned int)macadd,
|
||||
(long long int)fwversion,
|
||||
(long long int)swversion,
|
||||
(long long int)sw_fw_apiversion,
|
||||
REQUIRED_FIRMWARE_VERSION);
|
||||
REQUIRED_FIRMWARE_VERSION,
|
||||
(long long int)client_sw_apiversion);
|
||||
|
||||
// return if flag is not zero, debug mode
|
||||
if (flag) {
|
||||
firmware_check_done = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
//cant read versions
|
||||
if(!fwversion || !sw_fw_apiversion){
|
||||
cprintf(RED,"FATAL ERROR: Cant read versions from FPGA. Please update firmware\n");
|
||||
cprintf(RED,"Exiting Server. Goodbye!\n\n");
|
||||
exit(-1);
|
||||
strcpy(firmware_message,
|
||||
"FATAL ERROR: Cant read versions from FPGA. Please update firmware.\n");
|
||||
cprintf(RED,"%s\n\n", firmware_message);
|
||||
firmware_compatibility = FAIL;
|
||||
firmware_check_done = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
//check for API compatibility - old server
|
||||
if(sw_fw_apiversion > REQUIRED_FIRMWARE_VERSION){
|
||||
cprintf(RED,"FATAL ERROR: This software version is incompatible.\n"
|
||||
"Please update it to be compatible with this firmware\n\n");
|
||||
cprintf(RED,"Exiting Server. Goodbye!\n\n");
|
||||
exit(-1);
|
||||
sprintf(firmware_message,
|
||||
"FATAL ERROR: This detector software software version (%lld) is incompatible.\n"
|
||||
"Please update detector software (min. %lld) to be compatible with this firmware.\n",
|
||||
(long long int)sw_fw_apiversion,
|
||||
(long long int)REQUIRED_FIRMWARE_VERSION);
|
||||
cprintf(RED,"%s\n\n", firmware_message);
|
||||
firmware_compatibility = FAIL;
|
||||
firmware_check_done = 1;
|
||||
return;
|
||||
}
|
||||
|
||||
//check for firmware compatibility - old firmware
|
||||
if( REQUIRED_FIRMWARE_VERSION > fwversion){
|
||||
cprintf(RED,"FATAL ERROR: This firmware version is incompatible.\n"
|
||||
"Please update it to v%d to be compatible with this server\n\n", REQUIRED_FIRMWARE_VERSION);
|
||||
cprintf(RED,"Exiting Server. Goodbye!\n\n");
|
||||
exit(-1);
|
||||
sprintf(firmware_message,
|
||||
"FATAL ERROR: This firmware version (%lld) is incompatible.\n"
|
||||
"Please update firmware (min. %lld) to be compatible with this server.\n",
|
||||
(long long int)fwversion,
|
||||
(long long int)REQUIRED_FIRMWARE_VERSION);
|
||||
cprintf(RED,"%s\n\n", firmware_message);
|
||||
firmware_compatibility = FAIL;
|
||||
firmware_check_done = 1;
|
||||
return;
|
||||
}
|
||||
printf("Compatibility - success\n");
|
||||
firmware_check_done = 1;
|
||||
}
|
||||
|
||||
|
||||
@ -175,6 +215,8 @@ int64_t getDetectorId(enum idMode arg){
|
||||
return (int64_t)Beb_GetFirmwareSoftwareAPIVersion();
|
||||
case DETECTOR_SOFTWARE_VERSION:
|
||||
return (GITDATE & 0xFFFFFF);
|
||||
case CLIENT_SOFTWARE_API_VERSION:
|
||||
return APIEIGER;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
SRCFILE=gitInfoEiger.h
|
||||
DSTFILE=../commonFiles/versionAPI.h
|
||||
DSTFILE=versionAPI.h
|
||||
|
||||
SRCPATTERN=GITDATE
|
||||
DSTPATTERN=APIEIGER
|
||||
|
||||
awk -v a="$SRCFILE" -v b="$DSTFILE" -v c="$SRCPATTERN" -v d="$DSTPATTERN" 'FNR==NR&&$2==c{x=$3} NR!=FNR{if($2==d){$3=x}print > b}' $SRCFILE $DSTFILE
|
||||
awk -v a="$SRCFILE" -v b="$DSTFILE" -v c="$SRCPATTERN" -v d="$DSTPATTERN" 'FNR==NR&&$2==c{x=$3} NR!=FNR{if($2==d){$3="0x"substr(x,5)}print > b}' $SRCFILE $DSTFILE
|
1
slsDetectorSoftware/eigerDetectorServer/versionAPI.h
Symbolic link
1
slsDetectorSoftware/eigerDetectorServer/versionAPI.h
Symbolic link
@ -0,0 +1 @@
|
||||
../commonFiles/versionAPI.h
|
Reference in New Issue
Block a user