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:
Dhanya Thattil
2022-11-09 11:13:09 +01:00
committed by GitHub
parent b150db0fb3
commit 05f657c106
56 changed files with 609 additions and 414 deletions

View File

@@ -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) || \

View File

@@ -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);

View File

@@ -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':

View File

@@ -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);
}