1 #include "host_condition.hpp" 2 3 namespace pldm 4 { 5 namespace dbus_api 6 { 7 8 Host::FirmwareCondition Host::currentFirmwareCondition() const 9 { 10 bool hostRunning = false; 11 12 if (hostPdrObj != nullptr) 13 { 14 hostRunning = hostPdrObj.get()->isHostUp(); 15 } 16 17 auto value = hostRunning ? Host::FirmwareCondition::Running 18 : Host::FirmwareCondition::Off; 19 20 return value; 21 } 22 23 } // namespace dbus_api 24 } // namespace pldm 25