#pragma once #include #include #include #include #include #include namespace utils { using SensorPath = std::string; using ServiceName = std::string; using Ifaces = std::vector; using SensorIfaces = std::vector>; using SensorTree = std::pair; inline std::vector getSubTreeSensors(boost::asio::yield_context& yield, const std::shared_ptr& bus) { std::array interfaces = { "xyz.openbmc_project.Sensor.Value"}; boost::system::error_code ec; auto tree = bus->yield_method_call>( yield, ec, "xyz.openbmc_project.ObjectMapper", "/xyz/openbmc_project/object_mapper", "xyz.openbmc_project.ObjectMapper", "GetSubTree", "/xyz/openbmc_project/sensors", 2, interfaces); if (ec) { throw std::runtime_error("Failed to query ObjectMapper!"); } return tree; } } // namespace utils