Skip to content
Snippets Groups Projects
Commit 4daf32ce authored by Cyril Danilevski's avatar Cyril Danilevski :scooter:
Browse files

Add Interlock status to MPOD query result

parent 1c472fde
No related branches found
No related tags found
1 merge request!5Perform power down sequence from port expander trigger
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
MPOD::MPOD() { MPOD::MPOD() {
bool _on = false; bool _on = false;
bool _interlocked = false;
bool _rampingUp = false; bool _rampingUp = false;
bool _rampingDown = false; bool _rampingDown = false;
float _measurementSenseVoltage = 0; float _measurementSenseVoltage = 0;
...@@ -85,6 +86,7 @@ bool MPOD::message(const SNMP::Message *message) { ...@@ -85,6 +86,7 @@ bool MPOD::message(const SNMP::Message *message) {
break; break;
} }
_on = status->getBit(0); _on = status->getBit(0);
_interlocked = status->getBit(1);
_rampingUp = status->getBit(11); _rampingUp = status->getBit(11);
_rampingDown = status->getBit(12); _rampingDown = status->getBit(12);
} }
...@@ -151,6 +153,8 @@ bool MPOD::message(const SNMP::Message *message) { ...@@ -151,6 +153,8 @@ bool MPOD::message(const SNMP::Message *message) {
bool MPOD::isOn() const { return _on; } bool MPOD::isOn() const { return _on; }
bool MPOD::isInterlocked() const { return _interlocked; }
bool MPOD::isRampingUp() const { return _rampingUp; } bool MPOD::isRampingUp() const { return _rampingUp; }
bool MPOD::isRampingDown() const { return _rampingDown; } bool MPOD::isRampingDown() const { return _rampingDown; }
...@@ -182,6 +186,7 @@ String MPOD::toJSON() { ...@@ -182,6 +186,7 @@ String MPOD::toJSON() {
String json = "{\n"; String json = "{\n";
json += "\"channel\":" + String(getChannel()) + ","; json += "\"channel\":" + String(getChannel()) + ",";
json += "\"is_on\":" + String(isOn()) + ","; json += "\"is_on\":" + String(isOn()) + ",";
json += "\"is_interlocked\":" + String(isInterlocked()) + ",";
json += "\"ramping_up\":" + String(isRampingUp()) + ","; json += "\"ramping_up\":" + String(isRampingUp()) + ",";
json += "\"ramping_down\":" + String(isRampingDown()) + ","; json += "\"ramping_down\":" + String(isRampingDown()) + ",";
json += "\"sense_voltage\":" + String(getMeasurementSenseVoltage()) + ","; json += "\"sense_voltage\":" + String(getMeasurementSenseVoltage()) + ",";
......
...@@ -65,6 +65,7 @@ class MPOD { ...@@ -65,6 +65,7 @@ class MPOD {
SNMP::Message* setTargetVoltage(const uint16_t, const float); SNMP::Message* setTargetVoltage(const uint16_t, const float);
bool message(const SNMP::Message*); bool message(const SNMP::Message*);
bool isOn() const; bool isOn() const;
bool isInterlocked() const;
bool isRampingUp() const; bool isRampingUp() const;
bool isRampingDown() const; bool isRampingDown() const;
float getMeasurementSenseVoltage() const; float getMeasurementSenseVoltage() const;
...@@ -74,12 +75,13 @@ class MPOD { ...@@ -74,12 +75,13 @@ class MPOD {
float getVoltageRiseRate() const; float getVoltageRiseRate() const;
uint16_t getChannel() const; uint16_t getChannel() const;
String toJSON(); String toJSON();
private: private:
unsigned int getIntegerFromVarBind(const VarBind*); unsigned int getIntegerFromVarBind(const VarBind*);
float getFloatFromVarBind(const VarBind*); float getFloatFromVarBind(const VarBind*);
uint16_t _channel; uint16_t _channel;
bool _on; bool _on;
bool _interlocked;
bool _rampingUp; bool _rampingUp;
bool _rampingDown; bool _rampingDown;
float _measurementSenseVoltage; float _measurementSenseVoltage;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment