blob: 37066f5bc37b127ee7806aa551bd374e82a368e7 [file] [log] [blame]
Ratan Gupta00659052017-02-23 17:29:08 +05301#pragma once
2
3#include <stdint.h>
4
5#include <map>
6#include <string>
7
8#include <sdbusplus/server.hpp>
9
10namespace ipmi
11{
12namespace sensor
13{
14
15using Offset = uint8_t;
16using Value = sdbusplus::message::variant<bool, int64_t, std::string>;
17
18struct Values
19{
20 Value assert;
21 Value deassert;
22};
23
24using OffsetValueMap = std::map<Offset,Values>;
25
26using DbusProperty = std::string;
27using DbusPropertyMap = std::map<DbusProperty,OffsetValueMap>;
28
29using DbusInterface = std::string;
30using DbusInterfaceMap = std::map<DbusInterface,DbusPropertyMap>;
31
32using InstancePath = std::string;
33using Type = uint8_t;
34using ReadingType = uint8_t;
Emily Shaffer10f49592017-05-10 12:01:10 -070035using Multiplier = uint16_t;
36using OffsetB = uint16_t;
37using Exponent = uint8_t;
38using ScaledOffset = int64_t;
Ratan Gupta00659052017-02-23 17:29:08 +053039
40struct Info
41{
42 Type sensorType;
43 InstancePath sensorPath;
44 ReadingType sensorReadingType;
Emily Shaffer10f49592017-05-10 12:01:10 -070045 Multiplier coefficientM;
46 OffsetB coefficientB;
47 Exponent exponentB;
48 ScaledOffset scaledOffset;
Ratan Gupta00659052017-02-23 17:29:08 +053049 DbusInterfaceMap sensorInterfaces;
50};
51
52using Id = uint8_t;
53using IdInfoMap = std::map<Id,Info>;
54
Tom Josephbe703f72017-03-09 12:34:35 +053055using PropertyMap = std::map<DbusProperty, Value>;
56
57using InterfaceMap = std::map<DbusInterface, PropertyMap>;
58
59using Object = sdbusplus::message::object_path;
60using ObjectMap = std::map<Object, InterfaceMap>;
61
Tom Josephdd78a1d2017-05-05 11:04:29 +053062struct SelData
63{
64 Id sensorID;
65 Type sensorType;
66 ReadingType eventReadingType;
67 Offset eventOffset;
68};
69
70using InventoryPath = std::string;
71
72using InvObjectIDMap = std::map<InventoryPath, SelData>;
73
Ratan Gupta00659052017-02-23 17:29:08 +053074}//namespce sensor
75}//namespace ipmi