Commit a3504758 authored by Michael Ott's avatar Michael Ott
Browse files

Check for start-stop interval length for IPMI raw commands

parent b871d684
......@@ -31,6 +31,19 @@ void IPMIConfigurator::sensorBase(IPMISensorBase& s, CFG_VAL config) {
ATTRIBUTE("recordId", setRecordId);
ATTRIBUTE("factor", setFactor);
}
if (s.getStart() < s.getStop()) {
if (s.getStop() - s.getStart() >= 8) {
s.setStop(s.getStart() + 7);
LOG(warning) << "Maximum length of IPMI raw response interval is 8 bytes, setting stop offset to " << (int) s.getStop();
}
} else {
if (s.getStart() - s.getStop() >= 8) {
s.setStart(s.getStop() + 7);
LOG(warning) << "Maximum length of IPMI raw response interval is 8 bytes, setting start offset to " << (int) s.getStart();
}
}
}
void IPMIConfigurator::sensorGroup(IPMISensorGroup& s, CFG_VAL config) {
......
......@@ -66,7 +66,9 @@ public:
}
}
void setStart(const std::string& start) { _start = stoi(start); }
void setStart(uint8_t start) { _start = start; }
void setStop(const std::string& stop) { _stop = stoi(stop); }
void setStop(uint8_t stop) { _stop = stop; }
protected:
uint16_t _recordId;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment