addd kernel version

This commit is contained in:
2021-11-03 11:46:46 +01:00
parent 1da2761654
commit eff64f99f2
25 changed files with 111 additions and 41 deletions

View File

@ -275,7 +275,7 @@ std::string CmdProxy::Versions(int action) {
if (!args.empty()) {
WrongNumberOfParameters(0);
}
auto t = det->getFirmwareVersion();
auto t = det->getFirmwareVersion(std::vector<int>{det_id});
os << "\nDetector Type: " << OutString(det->getDetectorType())
<< "\nPackage Version: " << det->getPackageVersion() << std::hex
<< "\nClient Version: 0x" << det->getClientVersion();
@ -285,10 +285,12 @@ std::string CmdProxy::Versions(int action) {
os << "\nFirmware Version: " << OutStringHex(t);
}
os << "\nDetector Server Version: "
<< OutStringHex(det->getDetectorServerVersion());
<< OutStringHex(det->getDetectorServerVersion(std::vector<int>{det_id}));
os << "\nDetector Server Version: "
<< OutString(det->getKernelVersion({std::vector<int>{det_id}}));
if (det->getUseReceiverFlag().squash(true)) {
os << "\nReceiver Version: "
<< OutStringHex(det->getReceiverVersion());
<< OutStringHex(det->getReceiverVersion(std::vector<int>{det_id}));
}
os << std::dec << '\n';
} else if (action == defs::PUT_ACTION) {

View File

@ -767,6 +767,7 @@ class CmdProxy {
{"clientversion", &CmdProxy::ClientVersion},
{"firmwareversion", &CmdProxy::FirmwareVersion},
{"detectorserverversion", &CmdProxy::detectorserverversion},
{"kernelversion", &CmdProxy::kernelversion},
{"rx_version", &CmdProxy::rx_version},
{"serialnumber", &CmdProxy::serialnumber},
{"moduleid", &CmdProxy::moduleid},
@ -1206,6 +1207,10 @@ class CmdProxy {
detectorserverversion, getDetectorServerVersion,
"\n\tOn-board detector server software version in format [0xYYMMDD].");
GET_COMMAND(
kernelversion, getKernelVersion,
"\n\tGet kernel version on the detector including time and date.");
GET_COMMAND_HEX(rx_version, getReceiverVersion,
"\n\tReceiver version in format [0xYYMMDD].");

View File

@ -117,6 +117,10 @@ Result<int64_t> Detector::getDetectorServerVersion(Positions pos) const {
return pimpl->Parallel(&Module::getDetectorServerVersion, pos);
}
Result<std::string> Detector::getKernelVersion(Positions pos) const {
return pimpl->Parallel(&Module::getKernelVersion, pos);
}
Result<int64_t> Detector::getSerialNumber(Positions pos) const {
return pimpl->Parallel(&Module::getSerialNumber, pos);
}

View File

@ -94,6 +94,12 @@ int64_t Module::getDetectorServerVersion() const {
return sendToDetector<int64_t>(F_GET_SERVER_VERSION);
}
std::string Module::getKernelVersion() const {
char retval[MAX_STR_LENGTH]{};
sendToDetector(F_GET_KERNEL_VERSION, nullptr, retval);
return retval;
}
int64_t Module::getSerialNumber() const {
return sendToDetector<int64_t>(F_GET_SERIAL_NUMBER);
}

View File

@ -91,6 +91,7 @@ class Module : public virtual slsDetectorDefs {
int64_t getFirmwareVersion() const;
int64_t getDetectorServerVersion() const;
std::string getKernelVersion() const;
int64_t getSerialNumber() const;
int getModuleId() const;
int64_t getReceiverSoftwareVersion() const;