diff --git a/RELEASE.txt b/RELEASE.txt index 7fcaf65d0..ccb56de6c 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -21,6 +21,8 @@ This document describes the differences between vx.x.x and v6.0.0. ========================== - kernelversion - updatekernel +- updatedetectorserver +- update (without pcname) 2. Resolved Issues diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index b2aa41f8f..cfd1f3d49 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 e49b05591..f5723bff5 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index 1174203f5..08068ed32 100755 Binary files a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer and b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer differ diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 25d69150d..6b10e2c52 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 99a913b3c..bbc2112d2 100755 Binary files a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer and b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer differ diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 1b4d0a1ff..95d149426 100755 Binary files a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer and b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/src/common.c b/slsDetectorServers/slsDetectorServer/src/common.c index b39a7bd00..2a609d60c 100644 --- a/slsDetectorServers/slsDetectorServer/src/common.c +++ b/slsDetectorServers/slsDetectorServer/src/common.c @@ -4,12 +4,15 @@ #include "common.h" #include "clogger.h" #include "sls/sls_detector_defs.h" +#include "slsDetectorServer_defs.h" #include // dirname #include #include // uname #include // readlink +extern int executeCommand(char *command, char *result, enum TLogLevel level); + int ConvertToDifferentRange(int inputMin, int inputMax, int outputMin, int outputMax, int inputValue, int *outputValue) { LOG(logDEBUG1, (" Input Value: %d (Input:(%d - %d), Output:(%d - %d))\n", @@ -101,7 +104,8 @@ int getTimeFromString(char *buf, time_t *result) { } int getKernelVersion(char *retvals) { - struct utsname buf = {0}; + struct utsname buf; + memset(&buf, 0, sizeof(buf)); if (uname(&buf) == -1) { strcpy(retvals, "Failed to get utsname structure from uname\n"); LOG(logERROR, (retvals)); @@ -461,7 +465,7 @@ int setupDetectorServer(char *mess, char *sname) { LOG(logINFO, ("\tinittab: DetectoServer line deleted\n")); // add new link name to /etc/inittab - format = "echo 'ttyS0::respawn:/./%s' >> /etc/inittab"; + char* format = "echo 'ttyS0::respawn:/./%s' >> /etc/inittab"; if (snprintf(cmd, MAX_STR_LENGTH, format, LINKED_SERVER_NAME) >= MAX_STR_LENGTH) { strcpy(mess, "Could not copy detector server. Command " @@ -488,4 +492,5 @@ int setupDetectorServer(char *mess, char *sname) { return FAIL; } LOG(logINFO, ("\tsync\n")); + return OK; } \ No newline at end of file diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index eb670f387..389fec128 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1733,7 +1733,8 @@ class Detector { /** [Jungfrau][CTB][Moench] Advanced user Function! */ void resetFPGA(Positions pos = {}); - /** [Jungfrau][Eiger][Gotthard][CTB][Moench][Mythen3][Gotthard2] + /** [[deprecated ("Replaced by updateDetectorServer, which does not require tftp")]] + * [Jungfrau][Eiger][Gotthard][CTB][Moench][Mythen3][Gotthard2] * Advanced user Function! \n * Copy detector server fname from tftp folder of hostname to detector. Also * creates a symbolic link to a shorter name (without vx.x.x). Then the @@ -1763,7 +1764,7 @@ class Detector { * Function! */ void rebootController(Positions pos = {}); - /** + /** [[deprecated ("Replaced by overloaded updateDetectorServer, which does not require tftp and has one less argument")]] * Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the * firmware, detector server, make a soft link and then reboots detector * controller. \n [Mythen3][Gotthard2] Will require a script to start up the @@ -1775,6 +1776,16 @@ class Detector { const std::string &hostname, const std::string &fname, Positions pos = {}); + /** + * Advanced user Function!\n [Jungfrau][Gotthard][CTB][Moench] Updates the + * firmware, detector server, make a soft link and then reboots detector + * controller. \n [Mythen3][Gotthard2] Will require a script to start up the + * shorter named server link at start up \n sname is full path name of detector + * server \n fname is programming file name with full path to it + */ + void updateFirmwareAndServer(const std::string &sname, + const std::string &fname, Positions pos = {}); + /** Advanced user Function! \n * Goes to stop server. Hence, can be called while calling blocking * acquire(). \n [Eiger] Address is +0x100 for only left, +0x200 for only diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index eca03e314..cd1c1bb68 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -2853,6 +2853,7 @@ std::string CmdProxy::CopyDetectorServer(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { + LOG(logWARNING) << "Deprecated! Replaced by updatedetectorserver that requires no tftp.\n"; os << "[server_name (in tftp folder)] " "[pc_host_name]\n\t[Jungfrau][Eiger][Ctb][Moench][Mythen3][" "Gotthard2] Copies detector server via TFTP from pc. Ensure that " diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 9f9482f7b..a645c28eb 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -2156,19 +2156,17 @@ void Detector::copyDetectorServer(const std::string &fname, void Detector::updateDetectorServer(const std::string &fname, Positions pos) { LOG(logINFO) << "Updating Detector Server..."; - const std::string &serverName std::vector buffer = + std::vector buffer = readBinaryFile(fname, "Update Detector Server"); - // get file name + // get only the file name std::string filename(fname); - std::size_t pos = fname.rfind('/'); - if (pos != std::string::npos) { - filename = filePath.substr(pos + 1, filePath.size() - 1); + std::size_t slashPos = fname.rfind('/'); + if (slashPos != std::string::npos) { + filename = fname.substr(slashPos + 1, fname.size() - 1); } - LOG(logINFOBLUE) << "filename:" << filename; - exit(-1); - std::filesystem::path(fname).filename(); - pimpl->Parallel(&Module::updateDetectorServer, pos, buffer); + + pimpl->Parallel(&Module::updateDetectorServer, pos, buffer, filename); if (getDetectorType().squash() != defs::EIGER) { rebootController(pos); } @@ -2192,6 +2190,16 @@ void Detector::updateFirmwareAndServer(const std::string &sname, LOG(logINFO) << "Updating Firmware and Detector Server..."; pimpl->Parallel(&Module::copyDetectorServer, pos, sname, hostname); programFPGA(fname, pos); + rebootController(pos); +} + +void Detector::updateFirmwareAndServer(const std::string &sname, + const std::string &fname, + Positions pos) { + LOG(logINFO) << "Updating Firmware and Detector Server (no tftp)..."; + updateDetectorServer(sname, pos); + programFPGA(fname, pos); + rebootController(pos); } Result Detector::readRegister(uint32_t addr, Positions pos) const { diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index ecc01e3cf..e808cab62 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -6,10 +6,10 @@ #define APILIB 0x211027 #define APIRECEIVER 0x211020 #define APIGUI 0x211021 +#define APIEIGER 0x211109 #define APICTB 0x211109 #define APIGOTTHARD 0x211109 #define APIGOTTHARD2 0x211109 -#define APIJUNGFRAU 0x211109 #define APIMYTHEN3 0x211109 #define APIMOENCH 0x211109 -#define APIEIGER 0x211109 +#define APIJUNGFRAU 0x211110