diff --git a/mpod.cpp b/mpod.cpp index aaf667bbfc576eead85f8a17aa61a44b306239cf..80a8280f23c6519311f41e13eade1cbb6578baed 100644 --- a/mpod.cpp +++ b/mpod.cpp @@ -5,8 +5,8 @@ MPOD::MPOD() { bool _on = false; - bool _up = false; - bool _down = false; + bool _rampingUp = false; + bool _rampingDown = false; float _measurementSenseVoltage = 0; float _measurementCurrent = 0; float _voltage = 0; @@ -63,8 +63,8 @@ bool MPOD::message(const SNMP::Message *message) { // OUTPUTSTATUS is defined in MIB as BITS but encoded as OCTETSTRING by MPOD OctetStringBER *status = static_cast<OctetStringBER *>(varbind->getValue()); _on = status->getBit(0); - _up = status->getBit(11); - _down = status->getBit(12); + _rampingUp = status->getBit(11); + _rampingDown = status->getBit(12); } found++; break; @@ -108,9 +108,9 @@ bool MPOD::message(const SNMP::Message *message) { bool MPOD::isOn() const { return _on; } -bool MPOD::isUp() const { return _up; } +bool MPOD::isRampingUp() const { return _rampingUp; } -bool MPOD::isDown() const { return _down; } +bool MPOD::isRampingDown() const { return _rampingDown; } float MPOD::getMeasurementSenseVoltage() const { return _measurementSenseVoltage; } @@ -139,8 +139,8 @@ String MPOD::toJSON() { String json = "\"status\":{\n"; json += "\"channel\":" + String(getChannel()) + ","; json += "\"is_on\":" + String(isOn()) + ","; - json += "\"is_up\":" + String(isUp()) + ","; - json += "\"is_down\":" + String(isDown()) + ","; + json += "\"ramping_up\":" + String(isRampingUp()) + ","; + json += "\"ramping_down\":" + String(isRampingDown()) + ","; json += "\"sense_voltage\":" + String(getMeasurementSenseVoltage()) + ","; json += "\"set_voltage\":" + String(getVoltage()) + ","; json += "\"sense_current\":" + String(getMeasurementCurrent()) + ","; @@ -162,11 +162,11 @@ void onMessage(const SNMP::Message *message, const IPAddress remote, const uint1 Serial.print("MPOD status: "); Serial.print(mpod.getChannel()); Serial.print(mpod.isOn() ? " on" : " off"); - if (mpod.isUp()) { - Serial.print(" up"); + if (mpod.isRampingUp()) { + Serial.print(" ramping up"); } - if (mpod.isDown()) { - Serial.print(" down"); + if (mpod.isRampingDown()) { + Serial.print(" ramping down"); } Serial.println(); Serial.print("HV voltage "); diff --git a/mpod.hpp b/mpod.hpp index a36d03f06540b360d2736392e202fc9dcda8bef1..035511d4a6ad6929a0181e23939b7a412c283bdc 100644 --- a/mpod.hpp +++ b/mpod.hpp @@ -56,8 +56,8 @@ class MPOD { SNMP::Message* output(const uint16_t, const bool); bool message(const SNMP::Message*); bool isOn() const; - bool isUp() const; - bool isDown() const; + bool isRampingUp() const; + bool isRampingDown() const; float getMeasurementSenseVoltage() const; float getMeasurementCurrent() const; float getVoltage() const; @@ -71,8 +71,8 @@ class MPOD { float getFloatFromVarBind(const VarBind*); uint16_t _channel; bool _on; - bool _up; - bool _down; + bool _rampingUp; + bool _rampingDown; float _measurementSenseVoltage; float _measurementCurrent; float _voltage;