1 #include "config.h" 2 3 #include "host_condition.hpp" 4 5 #include <sdbusplus/bus.hpp> 6 7 #include <cstdlib> 8 #include <iostream> 9 10 int main(int argc, char** argv) 11 { 12 std::string hostId; 13 14 if (argc == 2) 15 { 16 hostId = std::string(argv[1]); 17 } 18 else 19 { 20 return 0; 21 } 22 23 auto bus = sdbusplus::bus::new_default(); 24 std::string objGroupName = HOST_GPIOS_OBJPATH; 25 std::string objPathInst = objGroupName + "/host" + hostId; 26 std::string busName = HOST_GPIOS_BUSNAME + hostId; 27 28 // Add sdbusplus ObjectManager 29 sdbusplus::server::manager_t objManager(bus, objGroupName.c_str()); 30 31 // For now, we only support checking Host0 status 32 phosphor::condition::Host host(bus, objPathInst, hostId); 33 34 bus.request_name(busName.c_str()); 35 36 while (true) 37 { 38 bus.process_discard(); 39 bus.wait(); 40 } 41 42 return 0; 43 } 44