using const for getupdatemode

This commit is contained in:
maliakal_d 2021-11-22 15:08:58 +01:00
parent e37725ac12
commit 7772eb153d
4 changed files with 6 additions and 4 deletions

View File

@ -1787,7 +1787,7 @@ class Detector {
void updateFirmwareAndServer(const std::string &sname, void updateFirmwareAndServer(const std::string &sname,
const std::string &fname, Positions pos = {}); const std::string &fname, Positions pos = {});
Result<bool> getUpdateMode(Positions pos = {}); Result<bool> getUpdateMode(Positions pos = {}) const;
/** Restarts detector server in update mode. This is useful when /** Restarts detector server in update mode. This is useful when
* server-firmware compatibility is at its worst and server cannot start up * server-firmware compatibility is at its worst and server cannot start up

View File

@ -2195,7 +2195,7 @@ void Detector::updateFirmwareAndServer(const std::string &sname,
programFPGA(fname, pos); programFPGA(fname, pos);
} }
Result<bool> Detector::getUpdateMode(Positions pos) { Result<bool> Detector::getUpdateMode(Positions pos) const {
return pimpl->Parallel(&Module::getUpdateMode, pos); return pimpl->Parallel(&Module::getUpdateMode, pos);
} }

View File

@ -2568,7 +2568,9 @@ void Module::rebootController() {
<< "): Controller rebooted successfully!"; << "): Controller rebooted successfully!";
} }
bool Module::getUpdateMode() { return sendToDetector<int>(F_GET_UPDATE_MODE); } bool Module::getUpdateMode() const {
return sendToDetector<int>(F_GET_UPDATE_MODE);
}
void Module::setUpdateMode(const bool updatemode) { void Module::setUpdateMode(const bool updatemode) {
sendToDetector(F_SET_UPDATE_MODE, static_cast<int>(updatemode), nullptr); sendToDetector(F_SET_UPDATE_MODE, static_cast<int>(updatemode), nullptr);

View File

@ -545,7 +545,7 @@ class Module : public virtual slsDetectorDefs {
const std::string &serverName); const std::string &serverName);
void updateKernel(std::vector<char> buffer); void updateKernel(std::vector<char> buffer);
void rebootController(); void rebootController();
bool getUpdateMode(); bool getUpdateMode() const;
void setUpdateMode(const bool updatemode); void setUpdateMode(const bool updatemode);
uint32_t readRegister(uint32_t addr) const; uint32_t readRegister(uint32_t addr) const;
uint32_t writeRegister(uint32_t addr, uint32_t val); uint32_t writeRegister(uint32_t addr, uint32_t val);