Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
ICBM
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
detectors
DSSC
ICBM
Commits
4daf32ce
Commit
4daf32ce
authored
2 weeks ago
by
Cyril Danilevski
Browse files
Options
Downloads
Patches
Plain Diff
Add Interlock status to MPOD query result
parent
1c472fde
No related branches found
No related tags found
1 merge request
!5
Perform power down sequence from port expander trigger
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpod.cpp
+5
-0
5 additions, 0 deletions
mpod.cpp
mpod.hpp
+3
-1
3 additions, 1 deletion
mpod.hpp
with
8 additions
and
1 deletion
mpod.cpp
+
5
−
0
View file @
4daf32ce
...
...
@@ -5,6 +5,7 @@
MPOD
::
MPOD
()
{
bool
_on
=
false
;
bool
_interlocked
=
false
;
bool
_rampingUp
=
false
;
bool
_rampingDown
=
false
;
float
_measurementSenseVoltage
=
0
;
...
...
@@ -85,6 +86,7 @@ bool MPOD::message(const SNMP::Message *message) {
break
;
}
_on
=
status
->
getBit
(
0
);
_interlocked
=
status
->
getBit
(
1
);
_rampingUp
=
status
->
getBit
(
11
);
_rampingDown
=
status
->
getBit
(
12
);
}
...
...
@@ -151,6 +153,8 @@ bool MPOD::message(const SNMP::Message *message) {
bool
MPOD
::
isOn
()
const
{
return
_on
;
}
bool
MPOD
::
isInterlocked
()
const
{
return
_interlocked
;
}
bool
MPOD
::
isRampingUp
()
const
{
return
_rampingUp
;
}
bool
MPOD
::
isRampingDown
()
const
{
return
_rampingDown
;
}
...
...
@@ -182,6 +186,7 @@ String MPOD::toJSON() {
String
json
=
"{
\n
"
;
json
+=
"
\"
channel
\"
:"
+
String
(
getChannel
())
+
","
;
json
+=
"
\"
is_on
\"
:"
+
String
(
isOn
())
+
","
;
json
+=
"
\"
is_interlocked
\"
:"
+
String
(
isInterlocked
())
+
","
;
json
+=
"
\"
ramping_up
\"
:"
+
String
(
isRampingUp
())
+
","
;
json
+=
"
\"
ramping_down
\"
:"
+
String
(
isRampingDown
())
+
","
;
json
+=
"
\"
sense_voltage
\"
:"
+
String
(
getMeasurementSenseVoltage
())
+
","
;
...
...
This diff is collapsed.
Click to expand it.
mpod.hpp
+
3
−
1
View file @
4daf32ce
...
...
@@ -65,6 +65,7 @@ class MPOD {
SNMP
::
Message
*
setTargetVoltage
(
const
uint16_t
,
const
float
);
bool
message
(
const
SNMP
::
Message
*
);
bool
isOn
()
const
;
bool
isInterlocked
()
const
;
bool
isRampingUp
()
const
;
bool
isRampingDown
()
const
;
float
getMeasurementSenseVoltage
()
const
;
...
...
@@ -74,12 +75,13 @@ class MPOD {
float
getVoltageRiseRate
()
const
;
uint16_t
getChannel
()
const
;
String
toJSON
();
private
:
unsigned
int
getIntegerFromVarBind
(
const
VarBind
*
);
float
getFloatFromVarBind
(
const
VarBind
*
);
uint16_t
_channel
;
bool
_on
;
bool
_interlocked
;
bool
_rampingUp
;
bool
_rampingDown
;
float
_measurementSenseVoltage
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment