Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
dcdb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
dcdb
dcdb
Commits
19bcc76b
Commit
19bcc76b
authored
Feb 12, 2020
by
Michael Ott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add xccSingleEnergy sensor type
parent
8264f200
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
1 deletion
+27
-1
dcdbpusher/sensors/ipmi/IPMISensorBase.h
dcdbpusher/sensors/ipmi/IPMISensorBase.h
+6
-1
dcdbpusher/sensors/ipmi/IPMISensorGroup.cpp
dcdbpusher/sensors/ipmi/IPMISensorGroup.cpp
+7
-0
dcdbpusher/sensors/ipmi/LenovoXCC.cpp
dcdbpusher/sensors/ipmi/LenovoXCC.cpp
+13
-0
dcdbpusher/sensors/ipmi/LenovoXCC.h
dcdbpusher/sensors/ipmi/LenovoXCC.h
+1
-0
No files found.
dcdbpusher/sensors/ipmi/IPMISensorBase.h
View file @
19bcc76b
...
...
@@ -89,7 +89,8 @@ class IPMISensorBase : public SensorBase {
undefined
=
0
,
raw
,
sdr
,
xccDatastorePower
xccDatastorePower
,
xccSingleEnergy
};
uint16_t
getRecordId
()
const
{
return
_recordId
;
}
...
...
@@ -115,6 +116,8 @@ class IPMISensorBase : public SensorBase {
return
std
::
string
(
"sdr"
);
case
xccDatastorePower
:
return
std
::
string
(
"xccDatastorePower"
);
case
xccSingleEnergy
:
return
std
::
string
(
"xccSingleEnergy"
);
default:
return
std
::
string
(
"undefined"
);
}
...
...
@@ -146,6 +149,8 @@ class IPMISensorBase : public SensorBase {
_type
=
sdr
;
}
else
if
(
boost
::
iequals
(
type
,
"xccDatastorePower"
))
{
_type
=
xccDatastorePower
;
}
else
if
(
boost
::
iequals
(
type
,
"xccSingleEnergy"
))
{
_type
=
xccSingleEnergy
;
}
else
{
_type
=
undefined
;
}
...
...
dcdbpusher/sensors/ipmi/IPMISensorGroup.cpp
View file @
19bcc76b
...
...
@@ -112,6 +112,13 @@ void IPMISensorGroup::read() {
}
break
;
}
case
IPMISensorBase
::
sensorType
::
xccSingleEnergy
:
{
LenovoXCC
xcc
(
_entity
);
if
(
xcc
.
getSingleEnergy
(
reading
)
==
0
)
{
s
->
storeReading
(
reading
,
s
->
getFactor
());
}
break
;
}
case
IPMISensorBase
::
sensorType
::
sdr
:
{
std
::
vector
<
uint8_t
>
sdrRecord
=
s
->
getSdrRecord
();
if
(
sdrRecord
.
size
()
==
0
)
{
...
...
dcdbpusher/sensors/ipmi/LenovoXCC.cpp
View file @
19bcc76b
...
...
@@ -65,6 +65,19 @@ int LenovoXCC::getDatastorePower(std::vector<reading_t> &readings) {
}
}
int
LenovoXCC
::
getSingleEnergy
(
reading_t
&
reading
)
{
if
(
_drift
||
getDrift
()
==
0
)
{
uint64_t
ts
,
energy
;
if
(
readSingleEnergyRaw
(
ts
,
energy
)
==
0
)
{
reading
.
timestamp
=
ts
+
_drift
;
reading
.
value
=
energy
;
return
0
;
}
}
return
1
;
}
int
LenovoXCC
::
readSingleEnergyRaw
(
uint64_t
&
timeStamp
,
uint64_t
&
energy
)
{
uint8_t
buf
[
256
];
uint8_t
getSingleEnergyCmd
[]
=
{
0x00
,
0x3a
,
0x32
,
0x04
,
0x02
,
0x00
,
0x00
,
0x00
};
...
...
dcdbpusher/sensors/ipmi/LenovoXCC.h
View file @
19bcc76b
...
...
@@ -20,6 +20,7 @@ class LenovoXCC {
virtual
~
LenovoXCC
();
int
getDatastorePower
(
std
::
vector
<
reading_t
>
&
readings
);
int
getSingleEnergy
(
reading_t
&
reading
);
private:
int
openDatastore
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment