Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <stdint.h> |
| 4 | |
| 5 | #include <map> |
| 6 | #include <string> |
| 7 | |
| 8 | #include <sdbusplus/server.hpp> |
| 9 | |
| 10 | namespace ipmi |
| 11 | { |
Ratan Gupta | dcb1067 | 2017-07-10 10:33:50 +0530 | [diff] [blame] | 12 | |
| 13 | using DbusObjectPath = std::string; |
| 14 | using DbusService = std::string; |
| 15 | using DbusInterface = std::string; |
| 16 | using DbusObjectInfo = std::pair<DbusObjectPath, DbusService>; |
| 17 | using DbusProperty = std::string; |
| 18 | using Value = sdbusplus::message::variant<bool, int64_t, uint8_t, std::string>; |
| 19 | using PropertyMap = std::map<DbusProperty, Value>; |
| 20 | using ObjectTree = std::map<DbusObjectPath, |
| 21 | std::map<DbusService, std::vector<DbusInterface>>>; |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 22 | namespace sensor |
| 23 | { |
| 24 | |
| 25 | using Offset = uint8_t; |
Ratan Gupta | dcb1067 | 2017-07-10 10:33:50 +0530 | [diff] [blame] | 26 | using Value = ipmi::Value; |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 27 | |
| 28 | struct Values |
| 29 | { |
| 30 | Value assert; |
| 31 | Value deassert; |
| 32 | }; |
| 33 | |
| 34 | using OffsetValueMap = std::map<Offset,Values>; |
| 35 | |
Ratan Gupta | dcb1067 | 2017-07-10 10:33:50 +0530 | [diff] [blame] | 36 | using DbusProperty = ipmi::DbusProperty; |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 37 | using DbusPropertyMap = std::map<DbusProperty,OffsetValueMap>; |
| 38 | |
Ratan Gupta | dcb1067 | 2017-07-10 10:33:50 +0530 | [diff] [blame] | 39 | using DbusInterface = ipmi::DbusInterface; |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 40 | using DbusInterfaceMap = std::map<DbusInterface,DbusPropertyMap>; |
| 41 | |
| 42 | using InstancePath = std::string; |
| 43 | using Type = uint8_t; |
| 44 | using ReadingType = uint8_t; |
Emily Shaffer | 10f4959 | 2017-05-10 12:01:10 -0700 | [diff] [blame] | 45 | using Multiplier = uint16_t; |
| 46 | using OffsetB = uint16_t; |
| 47 | using Exponent = uint8_t; |
| 48 | using ScaledOffset = int64_t; |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 49 | |
| 50 | struct Info |
| 51 | { |
| 52 | Type sensorType; |
| 53 | InstancePath sensorPath; |
| 54 | ReadingType sensorReadingType; |
Emily Shaffer | 10f4959 | 2017-05-10 12:01:10 -0700 | [diff] [blame] | 55 | Multiplier coefficientM; |
| 56 | OffsetB coefficientB; |
| 57 | Exponent exponentB; |
| 58 | ScaledOffset scaledOffset; |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 59 | DbusInterfaceMap sensorInterfaces; |
| 60 | }; |
| 61 | |
| 62 | using Id = uint8_t; |
| 63 | using IdInfoMap = std::map<Id,Info>; |
| 64 | |
Ratan Gupta | dcb1067 | 2017-07-10 10:33:50 +0530 | [diff] [blame] | 65 | using PropertyMap = ipmi::PropertyMap; |
Tom Joseph | be703f7 | 2017-03-09 12:34:35 +0530 | [diff] [blame] | 66 | |
| 67 | using InterfaceMap = std::map<DbusInterface, PropertyMap>; |
| 68 | |
| 69 | using Object = sdbusplus::message::object_path; |
| 70 | using ObjectMap = std::map<Object, InterfaceMap>; |
| 71 | |
Tom Joseph | dd78a1d | 2017-05-05 11:04:29 +0530 | [diff] [blame] | 72 | struct SelData |
| 73 | { |
| 74 | Id sensorID; |
| 75 | Type sensorType; |
| 76 | ReadingType eventReadingType; |
| 77 | Offset eventOffset; |
| 78 | }; |
| 79 | |
| 80 | using InventoryPath = std::string; |
| 81 | |
| 82 | using InvObjectIDMap = std::map<InventoryPath, SelData>; |
| 83 | |
Ratan Gupta | 0065905 | 2017-02-23 17:29:08 +0530 | [diff] [blame] | 84 | }//namespce sensor |
| 85 | }//namespace ipmi |