Patrick Venture | 02e3237 | 2019-08-16 10:50:18 -0700 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <ipmid/types.hpp> |
| 4 | #include <nlohmann/json.hpp> |
| 5 | |
| 6 | namespace ipmi |
| 7 | { |
| 8 | namespace sensor |
| 9 | { |
| 10 | |
| 11 | /** |
Patrick Venture | c2b7fc1 | 2019-08-19 11:53:22 -0700 | [diff] [blame] | 12 | * @brief Open the default entity map json file, and if present and valid json, |
| 13 | * return a built entity map. |
| 14 | * |
| 15 | * @return the map |
| 16 | */ |
| 17 | EntityInfoMap buildEntityMapFromFile(); |
| 18 | |
| 19 | /** |
Patrick Venture | 02e3237 | 2019-08-16 10:50:18 -0700 | [diff] [blame] | 20 | * @brief Given json data validate the data matches the expected format for the |
| 21 | * entity map configuration and parse the data into a map of the entities. |
| 22 | * |
| 23 | * If any entry is invalid, the entire contents passed in is disregarded as |
| 24 | * possibly corrupt. |
| 25 | * |
| 26 | * @param[in] data - the json data |
| 27 | * @return the map |
| 28 | */ |
| 29 | EntityInfoMap buildJsonEntityMap(const nlohmann::json& data); |
| 30 | |
| 31 | } // namespace sensor |
| 32 | } // namespace ipmi |