mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
Versioning (#568)
- removed getClientServerAPIVersion in server (not used) - removed rxr side (clientversion compatibility check), removed enum as well as it is now done on the client side. - versionAPI.h - GITBRANCH changed to RELEASE - dates for all API changed to "sem_version date". Scripts to compile servers modified for this. Empty "branch" name will end up with developer for sem_version. - Version class with constructor taking in the long version (APILIB date). Other member functions including concise(to get sem_version for new releases and date for old releases), - bypassing initial tests, also now bypasses the client-rxr compatibility check (at rx_hostname command) - previously, compatibility between client-det was ensuring both had the same detector API (eg. same APIJUNGFRAU) - Now, compatibility only checks APILIB (client side) and detector API(eg. APIJUNGFRAU) (detector side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. - If server is from an older release, it will compare dates like previous implementation (APIJUNGFRAU from both client and det) - - previously, compatibility between client-rxr was ensuring both had the same APIRECEIVER - Now, compatibility only checks APILIB (client side) and APIRECEIVER (rxr side) have same major version. It only does backward compatibility test. Rest is upto user to ensure. - If rxr is from an older release, it will compare dates like previous implementation (APIRECEIVER from both client and rxr) - removed APIGUI, evalVersionVariables.sh, genVersionHeader.sh (not needed or not used) - clientVersion, rxrversion and detectorserverversion all return strings and not integers (in hex) anymore. Depending if it has semantic versioning, it will print that or the date if it is too old. - fixed in python (strings for versions) - check_version function in detector server changed to "initial checks" as it only checks server-firmware compatibility and initial server checks. Client compatibilities are moved to client side. - --version gives sem_version and date? Is date needed as well. The clientversion, detserverversion and rxrversion API gives only sem_version (no date) - - formatting
This commit is contained in:
@ -1,43 +1,84 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
|
||||
# empty branch = developer branch in updateAPIVersion.sh
|
||||
branch=""
|
||||
det_list=("ctbDetectorServer"
|
||||
"gotthardDetectorServer"
|
||||
"gotthard2DetectorServer"
|
||||
"jungfrauDetectorServer"
|
||||
"mythen3DetectorServer"
|
||||
"moenchDetectorServer"
|
||||
)
|
||||
usage="\nUsage: compileAllServers.sh [server|all(opt)] [branch(opt)]. \n\tNo arguments mean all servers with 'developer' branch. \n\tNo 'branch' input means 'developer branch'"
|
||||
|
||||
# arguments
|
||||
if [ $# -eq 0 ]; then
|
||||
declare -a det=("ctbDetectorServer"
|
||||
"gotthardDetectorServer"
|
||||
"gotthard2DetectorServer"
|
||||
"jungfrauDetectorServer"
|
||||
"mythen3DetectorServer"
|
||||
"moenchDetectorServer"
|
||||
)
|
||||
# no argument, all servers
|
||||
declare -a det=${det_list[@]}
|
||||
echo "Compiling all servers"
|
||||
elif [ $# -eq 1 ] || [ $# -eq 2 ]; then
|
||||
# 'all' servers
|
||||
if [[ $1 == "all" ]]; then
|
||||
declare -a det=${det_list[@]}
|
||||
echo "Compiling all servers"
|
||||
else
|
||||
# only one server
|
||||
# arg not in list
|
||||
if [[ $det_list != *$1* ]]; then
|
||||
echo -e "Invalid argument 1: $1. $usage"
|
||||
return -1
|
||||
fi
|
||||
declare -a det=("${1}")
|
||||
#echo "Compiling only $1"
|
||||
fi
|
||||
# branch
|
||||
if [ $# -eq 2 ]; then
|
||||
# arg in list
|
||||
if [[ $det_list == *$2* ]]; then
|
||||
echo -e "Invalid argument 2: $2. $usage"
|
||||
return -1
|
||||
fi
|
||||
branch+=$2
|
||||
#echo "with branch $branch"
|
||||
fi
|
||||
else
|
||||
declare -a det=("${1}")
|
||||
echo -e "Too many arguments.$usage"
|
||||
return -1
|
||||
fi
|
||||
|
||||
declare -a deterror=("OK" "OK" "OK" "OK" "OK" "OK")
|
||||
|
||||
for ((i=0;i<${#det[@]};++i))
|
||||
echo -e "list is ${det[@]}"
|
||||
|
||||
# compile each server
|
||||
idet=0
|
||||
for i in ${det[@]}
|
||||
do
|
||||
dir=${det[i]}
|
||||
file="${det[i]}_developer"
|
||||
dir=$i
|
||||
file="${i}_developer"
|
||||
echo -e "Compiling $dir [$file]"
|
||||
cd $dir
|
||||
make clean
|
||||
if make version; then
|
||||
deterror[i]="OK"
|
||||
if make version API_BRANCH=$branch; then
|
||||
deterror[$idet]="OK"
|
||||
else
|
||||
deterror[i]="FAIL"
|
||||
deterror[$idet]="FAIL"
|
||||
fi
|
||||
|
||||
mv bin/$dir bin/$file
|
||||
git add -f bin/$file
|
||||
cp bin/$file /tftpboot/
|
||||
cd ..
|
||||
echo -e "\n\n"
|
||||
((++idet))
|
||||
done
|
||||
|
||||
echo -e "Results:"
|
||||
for ((i=0;i<${#det[@]};++i))
|
||||
idet=0
|
||||
for i in ${det[@]}
|
||||
do
|
||||
printf "%s\t\t= %s\n" "${det[i]}" "${deterror[i]}"
|
||||
printf "%s\t\t= %s\n" "$i" "${deterror[$idet]}"
|
||||
((++idet))
|
||||
done
|
||||
|
||||
|
||||
|
@ -1,32 +1,32 @@
|
||||
# SPDX-License-Identifier: LGPL-3.0-or-other
|
||||
# Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
declare -a det=("eigerDetectorServer")
|
||||
deterror="OK"
|
||||
dir="eigerDetectorServer"
|
||||
file="${dir}_developer"
|
||||
branch=""
|
||||
|
||||
declare -a deterror=("OK" "OK" "OK" "OK")
|
||||
# arguments
|
||||
if [ $# -eq 1 ]; then
|
||||
branch+=$1
|
||||
#echo "with branch $branch"
|
||||
elif [ ! $# -eq 0 ]; then
|
||||
echo -e "Only one optional argument allowed for branch."
|
||||
return -1
|
||||
fi
|
||||
|
||||
for ((i=0;i<${#det[@]};++i))
|
||||
do
|
||||
dir=${det[i]}
|
||||
file="${det[i]}_developer"
|
||||
echo -e "Compiling $dir [$file]"
|
||||
cd $dir
|
||||
make clean
|
||||
if make version; then
|
||||
deterror[i]="OK"
|
||||
else
|
||||
deterror[i]="FAIL"
|
||||
fi
|
||||
|
||||
mv bin/$dir bin/$file
|
||||
git add -f bin/$file
|
||||
cp bin/$file /tftpboot/
|
||||
cd ..
|
||||
echo -e "\n\n"
|
||||
done
|
||||
|
||||
echo -e "Results:"
|
||||
for ((i=0;i<${#det[@]};++i))
|
||||
do
|
||||
printf "%s\t\t= %s\n" "${det[i]}" "${deterror[i]}"
|
||||
done
|
||||
echo -e "Compiling $dir [$file]"
|
||||
cd $dir
|
||||
make clean
|
||||
if make version API_BRANCH=$branch; then
|
||||
deterror="OK"
|
||||
else
|
||||
deterror="FAIL"
|
||||
fi
|
||||
|
||||
mv bin/$dir bin/$file
|
||||
git add -f bin/$file
|
||||
cp bin/$file /tftpboot/
|
||||
cd ..
|
||||
echo -e "\n\n"
|
||||
printf "Result:\t\t= %s\n" "${deterror}"
|
||||
|
||||
|
@ -25,10 +25,11 @@ version: clean versioning $(PROGS)
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
version_branch=$(API_BRANCH)
|
||||
version_name=APICTB
|
||||
version_path=slsDetectorServers/ctbDetectorServer
|
||||
versioning:
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
|
||||
|
||||
|
||||
$(PROGS): $(OBJS)
|
||||
|
Binary file not shown.
@ -121,9 +121,10 @@ void basictests() {
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
char swversion[MAX_STR_LENGTH] = {0};
|
||||
memset(swversion, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(swversion);
|
||||
int64_t sw_fw_apiversion = 0;
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
|
||||
if (fwversion >= MIN_REQRD_VRSN_T_RD_API)
|
||||
sw_fw_apiversion = getFirmwareAPIVersion();
|
||||
@ -136,15 +137,13 @@ void basictests() {
|
||||
"Detector MAC Addr:\t\t 0x%llx\n\n"
|
||||
|
||||
"Firmware Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t %s\n"
|
||||
"F/w-S/w API Version:\t\t 0x%llx\n"
|
||||
"Required Firmware Version:\t 0x%x\n"
|
||||
"Client-Software API Version:\t 0x%llx\n"
|
||||
"********************************************************\n",
|
||||
hversion, hsnumber, ipadd, (long long unsigned int)macadd,
|
||||
(long long int)fwversion, (long long int)swversion,
|
||||
(long long int)sw_fw_apiversion, REQRD_FRMWR_VRSN,
|
||||
(long long int)client_sw_apiversion));
|
||||
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
|
||||
REQRD_FRMWR_VRSN));
|
||||
|
||||
#ifndef VIRTUAL
|
||||
// return if flag is not zero, debug mode
|
||||
@ -325,9 +324,7 @@ int testBus() {
|
||||
|
||||
/* Ids */
|
||||
|
||||
uint64_t getServerVersion() { return APICTB; }
|
||||
|
||||
uint64_t getClientServerAPIVersion() { return APICTB; }
|
||||
void getServerVersion(char *version) { strcpy(version, APICTB); }
|
||||
|
||||
uint64_t getFirmwareVersion() {
|
||||
#ifdef VIRTUAL
|
||||
|
@ -25,10 +25,11 @@ version: clean versioning $(PROGS) #hv9m_blackfin_server
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
version_branch=$(API_BRANCH)
|
||||
version_name=APIEIGER
|
||||
version_path=slsDetectorServers/eigerDetectorServer
|
||||
versioning:
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
|
||||
|
||||
|
||||
$(PROGS): $(OBJS)
|
||||
|
Binary file not shown.
@ -117,9 +117,10 @@ void basictests() {
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
char swversion[MAX_STR_LENGTH] = {0};
|
||||
memset(swversion, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(swversion);
|
||||
int64_t sw_fw_apiversion = getFirmwareAPIVersion();
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
|
||||
LOG(logINFOBLUE,
|
||||
("**************************************************\n"
|
||||
@ -127,16 +128,13 @@ void basictests() {
|
||||
"Detector MAC Addr:\t\t 0x%llx\n"
|
||||
|
||||
"Firmware Version:\t\t %lld\n"
|
||||
"Software Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t %s\n"
|
||||
"F/w-S/w API Version:\t\t %lld\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,
|
||||
(long long int)client_sw_apiversion));
|
||||
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
|
||||
REQUIRED_FIRMWARE_VERSION));
|
||||
|
||||
// update default udpdstip and udpdstmac (1g is hardware ip and hardware
|
||||
// mac)
|
||||
@ -208,9 +206,7 @@ int getTestImageMode() { return eiger_virtual_test_mode; }
|
||||
|
||||
/* Ids */
|
||||
|
||||
uint64_t getServerVersion() { return APIEIGER; }
|
||||
|
||||
uint64_t getClientServerAPIVersion() { return APIEIGER; }
|
||||
void getServerVersion(char *version) { strcpy(version, APIEIGER); }
|
||||
|
||||
u_int64_t getFirmwareVersion() {
|
||||
#ifdef VIRTUAL
|
||||
|
@ -24,10 +24,11 @@ version: clean versioning $(PROGS)
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
version_branch=$(API_BRANCH)
|
||||
version_name=APIGOTTHARD2
|
||||
version_path=slsDetectorServers/gotthard2DetectorServer
|
||||
versioning:
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
|
||||
|
||||
|
||||
$(PROGS): $(OBJS)
|
||||
|
1
slsDetectorServers/gotthard2DetectorServer/bin/detid_gotthard2.txt
Executable file
1
slsDetectorServers/gotthard2DetectorServer/bin/detid_gotthard2.txt
Executable file
@ -0,0 +1 @@
|
||||
1234
|
Binary file not shown.
@ -117,9 +117,10 @@ void basictests() {
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
char swversion[MAX_STR_LENGTH] = {0};
|
||||
memset(swversion, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(swversion);
|
||||
int64_t sw_fw_apiversion = getFirmwareAPIVersion();
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
uint32_t requiredFirmwareVersion = REQRD_FRMWRE_VRSN;
|
||||
|
||||
LOG(logINFOBLUE,
|
||||
@ -130,15 +131,13 @@ void basictests() {
|
||||
"Detector MAC Addr:\t\t 0x%llx\n\n"
|
||||
|
||||
"Firmware Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t %s\n"
|
||||
"F/w-S/w API Version:\t\t 0x%llx\n"
|
||||
"Required Firmware Version:\t 0x%x\n"
|
||||
"Client-Software API Version:\t 0x%llx\n"
|
||||
"********************************************************\n",
|
||||
hversion, ipadd, (long long unsigned int)macadd,
|
||||
(long long int)fwversion, (long long int)swversion,
|
||||
(long long int)sw_fw_apiversion, requiredFirmwareVersion,
|
||||
(long long int)client_sw_apiversion));
|
||||
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
|
||||
requiredFirmwareVersion));
|
||||
|
||||
#ifndef VIRTUAL
|
||||
// return if flag is not zero, debug mode
|
||||
@ -251,9 +250,7 @@ int testBus() {
|
||||
|
||||
/* Ids */
|
||||
|
||||
uint64_t getServerVersion() { return APIGOTTHARD2; }
|
||||
|
||||
uint64_t getClientServerAPIVersion() { return APIGOTTHARD2; }
|
||||
void getServerVersion(char *version) { strcpy(version, APIGOTTHARD2); }
|
||||
|
||||
u_int64_t getFirmwareVersion() {
|
||||
#ifdef VIRTUAL
|
||||
|
@ -23,10 +23,11 @@ version: clean versioning $(PROGS)
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
version_branch=$(API_BRANCH)
|
||||
version_name=APIGOTTHARD
|
||||
version_path=slsDetectorServers/gotthardDetectorServer
|
||||
versioning:
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
|
||||
|
||||
|
||||
$(PROGS): $(OBJS)
|
||||
|
Binary file not shown.
@ -107,8 +107,9 @@ void basictests() {
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
char swversion[MAX_STR_LENGTH] = {0};
|
||||
memset(swversion, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(swversion);
|
||||
|
||||
LOG(logINFOBLUE,
|
||||
("**************************************************\n"
|
||||
@ -118,15 +119,13 @@ void basictests() {
|
||||
"Detector MAC Addr : 0x%llx\n\n"
|
||||
|
||||
"Firmware Version : 0x%llx\n"
|
||||
"Software Version : 0x%llx\n"
|
||||
"Client-S/w API Version : 0x%llx\n"
|
||||
"Software Version : %s\n"
|
||||
"********************************************************\n",
|
||||
boardrev,
|
||||
|
||||
ipadd, (long long unsigned int)macadd,
|
||||
|
||||
(long long int)fwversion, (long long int)swversion,
|
||||
(long long int)client_sw_apiversion));
|
||||
(long long int)fwversion, swversion));
|
||||
|
||||
#ifndef VIRTUAL
|
||||
if (!debugflag || updateFlag) {
|
||||
@ -270,9 +269,7 @@ int getTestImageMode() {
|
||||
|
||||
/* Ids */
|
||||
|
||||
uint64_t getServerVersion() { return APIGOTTHARD; }
|
||||
|
||||
uint64_t getClientServerAPIVersion() { return APIGOTTHARD; }
|
||||
void getServerVersion(char *version) { strcpy(version, APIGOTTHARD); }
|
||||
|
||||
u_int64_t getFirmwareVersion() {
|
||||
#ifdef VIRTUAL
|
||||
|
@ -24,10 +24,11 @@ version: clean versioning $(PROGS)
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
version_branch=$(API_BRANCH)
|
||||
version_name=APIJUNGFRAU
|
||||
version_path=slsDetectorServers/jungfrauDetectorServer
|
||||
versioning:
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
|
||||
|
||||
|
||||
$(PROGS): $(OBJS)
|
||||
|
4
slsDetectorServers/jungfrauDetectorServer/bin/config_jungfrau.txt
Executable file
4
slsDetectorServers/jungfrauDetectorServer/bin/config_jungfrau.txt
Executable file
@ -0,0 +1,4 @@
|
||||
|
||||
|
||||
#chip version version (multiplied by 10)
|
||||
chipversion 11
|
Binary file not shown.
@ -102,9 +102,10 @@ void basictests() {
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
char swversion[MAX_STR_LENGTH] = {0};
|
||||
memset(swversion, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(swversion);
|
||||
int64_t sw_fw_apiversion = 0;
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
uint32_t requiredFirmwareVersion =
|
||||
(isHardwareVersion2() ? REQRD_FRMWRE_VRSN_BOARD2 : REQRD_FRMWRE_VRSN);
|
||||
|
||||
@ -120,15 +121,13 @@ void basictests() {
|
||||
"Detector MAC Addr:\t\t 0x%llx\n\n"
|
||||
|
||||
"Firmware Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t %s\n"
|
||||
"F/w-S/w API Version:\t\t 0x%llx\n"
|
||||
"Required Firmware Version:\t 0x%x\n"
|
||||
"Client-Software API Version:\t 0x%llx\n"
|
||||
"********************************************************\n",
|
||||
hversion, hsnumber, ipadd, (long long unsigned int)macadd,
|
||||
(long long int)fwversion, (long long int)swversion,
|
||||
(long long int)sw_fw_apiversion, requiredFirmwareVersion,
|
||||
(long long int)client_sw_apiversion));
|
||||
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
|
||||
requiredFirmwareVersion));
|
||||
|
||||
#ifndef VIRTUAL
|
||||
// return if flag is not zero, debug mode
|
||||
@ -257,9 +256,7 @@ int getTestImageMode() { return virtual_image_test_mode; }
|
||||
|
||||
/* Ids */
|
||||
|
||||
uint64_t getServerVersion() { return APIJUNGFRAU; }
|
||||
|
||||
uint64_t getClientServerAPIVersion() { return APIJUNGFRAU; }
|
||||
void getServerVersion(char *version) { strcpy(version, APIJUNGFRAU); }
|
||||
|
||||
u_int64_t getFirmwareVersion() {
|
||||
#ifdef VIRTUAL
|
||||
|
@ -25,10 +25,11 @@ version: clean versioning $(PROGS)
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
version_branch=$(API_BRANCH)
|
||||
version_name=APIMOENCH
|
||||
version_path=slsDetectorServers/moenchDetectorServer
|
||||
versioning:
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
|
||||
|
||||
|
||||
$(PROGS): $(OBJS)
|
||||
|
Binary file not shown.
@ -125,9 +125,10 @@ void basictests() {
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
char swversion[MAX_STR_LENGTH] = {0};
|
||||
memset(swversion, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(swversion);
|
||||
int64_t sw_fw_apiversion = 0;
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
|
||||
if (fwversion >= MIN_REQRD_VRSN_T_RD_API)
|
||||
sw_fw_apiversion = getFirmwareAPIVersion();
|
||||
@ -140,15 +141,13 @@ void basictests() {
|
||||
"Detector MAC Addr:\t\t 0x%llx\n\n"
|
||||
|
||||
"Firmware Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t %s\n"
|
||||
"F/w-S/w API Version:\t\t 0x%llx\n"
|
||||
"Required Firmware Version:\t 0x%x\n"
|
||||
"Client-Software API Version:\t 0x%llx\n"
|
||||
"********************************************************\n",
|
||||
hversion, hsnumber, ipadd, (long long unsigned int)macadd,
|
||||
(long long int)fwversion, (long long int)swversion,
|
||||
(long long int)sw_fw_apiversion, REQRD_FRMWR_VRSN,
|
||||
(long long int)client_sw_apiversion));
|
||||
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
|
||||
REQRD_FRMWR_VRSN));
|
||||
|
||||
#ifndef VIRTUAL
|
||||
// return if flag is not zero, debug mode
|
||||
@ -329,9 +328,7 @@ int testBus() {
|
||||
|
||||
/* Ids */
|
||||
|
||||
uint64_t getServerVersion() { return APIMOENCH; }
|
||||
|
||||
uint64_t getClientServerAPIVersion() { return APIMOENCH; }
|
||||
void getServerVersion(char *version) { strcpy(version, APIMOENCH); }
|
||||
|
||||
uint64_t getFirmwareVersion() {
|
||||
#ifdef VIRTUAL
|
||||
|
@ -25,10 +25,11 @@ version: clean versioning $(PROGS)
|
||||
|
||||
boot: $(OBJS)
|
||||
|
||||
version_branch=$(API_BRANCH)
|
||||
version_name=APIMYTHEN3
|
||||
version_path=slsDetectorServers/mythen3DetectorServer
|
||||
versioning:
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path); tput sgr0;`
|
||||
cd ../../ && echo $(PWD) && echo `tput setaf 6; ./updateAPIVersion.sh $(version_name) $(version_path) $(version_branch); tput sgr0;`
|
||||
|
||||
|
||||
$(PROGS): $(OBJS)
|
||||
|
1
slsDetectorServers/mythen3DetectorServer/bin/detid_mythen3.txt
Executable file
1
slsDetectorServers/mythen3DetectorServer/bin/detid_mythen3.txt
Executable file
@ -0,0 +1 @@
|
||||
0
|
Binary file not shown.
@ -110,10 +110,10 @@ void basictests() {
|
||||
uint32_t ipadd = getDetectorIP();
|
||||
uint64_t macadd = getDetectorMAC();
|
||||
int64_t fwversion = getFirmwareVersion();
|
||||
int64_t swversion = getServerVersion();
|
||||
char swversion[MAX_STR_LENGTH] = {0};
|
||||
memset(swversion, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(swversion);
|
||||
int64_t sw_fw_apiversion = getFirmwareAPIVersion();
|
||||
;
|
||||
int64_t client_sw_apiversion = getClientServerAPIVersion();
|
||||
uint32_t requiredFirmwareVersion = REQRD_FRMWRE_VRSN;
|
||||
|
||||
LOG(logINFOBLUE,
|
||||
@ -124,15 +124,13 @@ void basictests() {
|
||||
"Detector MAC Addr:\t\t 0x%llx\n\n"
|
||||
|
||||
"Firmware Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t 0x%llx\n"
|
||||
"Software Version:\t\t %s\n"
|
||||
"F/w-S/w API Version:\t\t 0x%llx\n"
|
||||
"Required Firmware Version:\t 0x%x\n"
|
||||
"Client-Software API Version:\t 0x%llx\n"
|
||||
"********************************************************\n",
|
||||
hversion, ipadd, (long long unsigned int)macadd,
|
||||
(long long int)fwversion, (long long int)swversion,
|
||||
(long long int)sw_fw_apiversion, requiredFirmwareVersion,
|
||||
(long long int)client_sw_apiversion));
|
||||
(long long int)fwversion, swversion, (long long int)sw_fw_apiversion,
|
||||
requiredFirmwareVersion));
|
||||
|
||||
#ifndef VIRTUAL
|
||||
// return if flag is not zero, debug mode
|
||||
@ -245,9 +243,7 @@ int testBus() {
|
||||
|
||||
/* Ids */
|
||||
|
||||
uint64_t getServerVersion() { return APIMYTHEN3; }
|
||||
|
||||
uint64_t getClientServerAPIVersion() { return APIMYTHEN3; }
|
||||
void getServerVersion(char *version) { strcpy(version, APIMYTHEN3); }
|
||||
|
||||
u_int64_t getFirmwareVersion() {
|
||||
#ifdef VIRTUAL
|
||||
|
@ -75,8 +75,7 @@ int getTestImageMode();
|
||||
#endif
|
||||
|
||||
// Ids
|
||||
u_int64_t getServerVersion();
|
||||
u_int64_t getClientServerAPIVersion();
|
||||
void getServerVersion(char *version);
|
||||
u_int64_t getFirmwareVersion();
|
||||
u_int64_t getFirmwareAPIVersion();
|
||||
#if defined(JUNGFRAUD) || defined(CHIPTESTBOARDD) || defined(MOENCHD) || \
|
||||
|
@ -127,7 +127,7 @@ int temp_control(int);
|
||||
int temp_event(int);
|
||||
int auto_comp_disable(int);
|
||||
int storage_cell_start(int);
|
||||
int check_version(int);
|
||||
int initial_checks(int);
|
||||
int software_trigger(int);
|
||||
int led(int);
|
||||
int digital_io_delay(int);
|
||||
|
@ -55,7 +55,8 @@ int main(int argc, char *argv[]) {
|
||||
debugflag = 0;
|
||||
updateFlag = 0;
|
||||
checkModuleFlag = 1;
|
||||
int version = 0;
|
||||
char version[MAX_STR_LENGTH] = {0};
|
||||
memset(version, 0, MAX_STR_LENGTH);
|
||||
ignoreConfigFileFlag = 0;
|
||||
#if defined(GOTTHARDD) || defined(GOTTHARD2D) || defined(EIGERD) || \
|
||||
defined(MYTHEN3D)
|
||||
@ -142,22 +143,21 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
case 'v':
|
||||
#ifdef GOTTHARDD
|
||||
version = APIGOTTHARD;
|
||||
strcpy(version, APIGOTTHARD);
|
||||
#elif EIGERD
|
||||
version = APIEIGER;
|
||||
strcpy(version, APIEIGER);
|
||||
#elif JUNGFRAUD
|
||||
version = APIJUNGFRAU;
|
||||
strcpy(version, APIJUNGFRAU);
|
||||
#elif CHIPTESTBOARDD
|
||||
version = APICTB;
|
||||
strcpy(version, APICTB);
|
||||
#elif MOENCHD
|
||||
version = APIMOENCH;
|
||||
strcpy(version, APIMOENCH);
|
||||
#elif MYTHEN3D
|
||||
version = APIMYTHEN3;
|
||||
strcpy(version, APIMYTHEN3);
|
||||
#elif GOTTHARD2D
|
||||
version = APIGOTTHARD2;
|
||||
strcpy(version, APIGOTTHARD2);
|
||||
#endif
|
||||
LOG(logINFO, ("SLS Detector Server Version: %s (0x%x)\n", GITBRANCH,
|
||||
version));
|
||||
LOG(logINFO, ("SLS Detector Server Version: %s\n", version));
|
||||
exit(EXIT_SUCCESS);
|
||||
|
||||
case 'p':
|
||||
|
@ -84,7 +84,7 @@ int updateModeAllowedFunction(int file_des) {
|
||||
F_EXEC_COMMAND, F_GET_DETECTOR_TYPE, F_GET_FIRMWARE_VERSION,
|
||||
F_GET_SERVER_VERSION, F_GET_SERIAL_NUMBER, F_WRITE_REGISTER,
|
||||
F_READ_REGISTER, F_LOCK_SERVER, F_GET_LAST_CLIENT_IP,
|
||||
F_PROGRAM_FPGA, F_RESET_FPGA, F_CHECK_VERSION,
|
||||
F_PROGRAM_FPGA, F_RESET_FPGA, F_INITIAL_CHECKS,
|
||||
F_REBOOT_CONTROLLER, F_GET_KERNEL_VERSION, F_UPDATE_KERNEL,
|
||||
F_UPDATE_DETECTOR_SERVER, F_GET_UPDATE_MODE, F_SET_UPDATE_MODE,
|
||||
F_GET_NUM_CHANNELS, F_GET_NUM_INTERFACES, F_ACTIVATE};
|
||||
@ -303,7 +303,7 @@ void function_table() {
|
||||
flist[F_TEMP_EVENT] = &temp_event;
|
||||
flist[F_AUTO_COMP_DISABLE] = &auto_comp_disable;
|
||||
flist[F_STORAGE_CELL_START] = &storage_cell_start;
|
||||
flist[F_CHECK_VERSION] = &check_version;
|
||||
flist[F_INITIAL_CHECKS] = &initial_checks;
|
||||
flist[F_SOFTWARE_TRIGGER] = &software_trigger;
|
||||
flist[F_LED] = &led;
|
||||
flist[F_DIGITAL_IO_DELAY] = &digital_io_delay;
|
||||
@ -737,10 +737,11 @@ int get_firmware_version(int file_des) {
|
||||
int get_server_version(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t retval = -1;
|
||||
retval = getServerVersion();
|
||||
LOG(logDEBUG1, ("server version retval: 0x%llx\n", (long long int)retval));
|
||||
return Server_SendResult(file_des, INT64, &retval, sizeof(retval));
|
||||
char retvals[MAX_STR_LENGTH];
|
||||
memset(retvals, 0, MAX_STR_LENGTH);
|
||||
getServerVersion(retvals);
|
||||
LOG(logDEBUG1, ("server version retval: %s\n", retvals));
|
||||
return Server_SendResult(file_des, OTHER, retvals, sizeof(retvals));
|
||||
}
|
||||
|
||||
int get_serial_number(int file_des) {
|
||||
@ -4075,13 +4076,9 @@ int storage_cell_start(int file_des) {
|
||||
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
|
||||
}
|
||||
|
||||
int check_version(int file_des) {
|
||||
int initial_checks(int file_des) {
|
||||
ret = OK;
|
||||
memset(mess, 0, sizeof(mess));
|
||||
int64_t arg = -1;
|
||||
|
||||
if (receiveData(file_des, &arg, sizeof(arg), INT64) < 0)
|
||||
return printSocketReadError();
|
||||
|
||||
// check software- firmware compatibility and basic tests
|
||||
LOG(logDEBUG1, ("Checking software-firmware compatibility and basic "
|
||||
@ -4107,39 +4104,6 @@ int check_version(int file_des) {
|
||||
LOG(logERROR, (mess));
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == OK) {
|
||||
LOG(logDEBUG1,
|
||||
("Checking versioning compatibility with value 0x%llx\n", arg));
|
||||
|
||||
int64_t client_requiredVersion = arg;
|
||||
int64_t det_apiVersion = getClientServerAPIVersion();
|
||||
int64_t det_version = getServerVersion();
|
||||
|
||||
// old client
|
||||
if (det_apiVersion > client_requiredVersion) {
|
||||
ret = FAIL;
|
||||
sprintf(mess,
|
||||
"Client's detector SW API version: (0x%llx). "
|
||||
"Detector's SW API Version: (0x%llx). "
|
||||
"Incompatible, update client!\n",
|
||||
(long long int)client_requiredVersion,
|
||||
(long long int)det_apiVersion);
|
||||
LOG(logERROR, (mess));
|
||||
}
|
||||
|
||||
// old software
|
||||
else if (client_requiredVersion > det_version) {
|
||||
ret = FAIL;
|
||||
sprintf(mess,
|
||||
"Detector SW Version: (0x%llx). "
|
||||
"Client's detector SW API Version: (0x%llx). "
|
||||
"Incompatible, update detector software!\n",
|
||||
(long long int)det_version,
|
||||
(long long int)client_requiredVersion);
|
||||
LOG(logERROR, (mess));
|
||||
}
|
||||
}
|
||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user