diff options
author | Ratan Gupta <ratagupt@in.ibm.com> | 2017-02-23 17:29:08 +0530 |
---|---|---|
committer | Ratan Gupta <ratagupt@in.ibm.com> | 2017-03-15 09:45:16 +0530 |
commit | 0065905e1aad15bd35edc4957a56e5fd7fca963a (patch) | |
tree | ab1f405a03b8cbca49a6c856a78ba3467d5db4f4 /types.hpp | |
parent | b12b0c011f41d3cad863b19285f710aec5000748 (diff) | |
download | phosphor-host-ipmid-0065905e1aad15bd35edc4957a56e5fd7fca963a.tar.gz phosphor-host-ipmid-0065905e1aad15bd35edc4957a56e5fd7fca963a.zip |
inventory: write sensor yaml parser
Write python-based parser for sensor.yaml. The parser generates
sensor-gen.cpp,which is having a map of sensorid(key) and
sensorinfo(value).
Change-Id: I5aa2d2bc871ced06e5e4c164a67eeb5974031d5d
Signed-off-by: Ratan Gupta <ratagupt@in.ibm.com>
Diffstat (limited to 'types.hpp')
-rw-r--r-- | types.hpp | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/types.hpp b/types.hpp new file mode 100644 index 0000000..d8a1386 --- /dev/null +++ b/types.hpp @@ -0,0 +1,48 @@ +#pragma once + +#include <stdint.h> + +#include <map> +#include <string> + +#include <sdbusplus/server.hpp> + +namespace ipmi +{ +namespace sensor +{ + +using Offset = uint8_t; +using Value = sdbusplus::message::variant<bool, int64_t, std::string>; + +struct Values +{ + Value assert; + Value deassert; +}; + +using OffsetValueMap = std::map<Offset,Values>; + +using DbusProperty = std::string; +using DbusPropertyMap = std::map<DbusProperty,OffsetValueMap>; + +using DbusInterface = std::string; +using DbusInterfaceMap = std::map<DbusInterface,DbusPropertyMap>; + +using InstancePath = std::string; +using Type = uint8_t; +using ReadingType = uint8_t; + +struct Info +{ + Type sensorType; + InstancePath sensorPath; + ReadingType sensorReadingType; + DbusInterfaceMap sensorInterfaces; +}; + +using Id = uint8_t; +using IdInfoMap = std::map<Id,Info>; + +}//namespce sensor +}//namespace ipmi |