summaryrefslogtreecommitdiff
path: root/redfish-core/lib/chassis.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'redfish-core/lib/chassis.hpp')
-rw-r--r--redfish-core/lib/chassis.hpp38
1 files changed, 20 insertions, 18 deletions
diff --git a/redfish-core/lib/chassis.hpp b/redfish-core/lib/chassis.hpp
index 99e305bde6..6cb877f845 100644
--- a/redfish-core/lib/chassis.hpp
+++ b/redfish-core/lib/chassis.hpp
@@ -42,19 +42,19 @@ namespace redfish
/**
* @brief Retrieves chassis state properties over dbus
*
- * @param[in] aResp - Shared pointer for completing asynchronous calls.
+ * @param[in] asyncResp - Shared pointer for completing asynchronous calls.
*
* @return None.
*/
-inline void getChassisState(std::shared_ptr<bmcweb::AsyncResp> aResp)
+inline void getChassisState(std::shared_ptr<bmcweb::AsyncResp> asyncResp)
{
// crow::connections::systemBus->async_method_call(
sdbusplus::asio::getProperty<std::string>(
*crow::connections::systemBus, "xyz.openbmc_project.State.Chassis",
"/xyz/openbmc_project/state/chassis0",
"xyz.openbmc_project.State.Chassis", "CurrentPowerState",
- [aResp{std::move(aResp)}](const boost::system::error_code& ec,
- const std::string& chassisState) {
+ [asyncResp{std::move(asyncResp)}](const boost::system::error_code& ec,
+ const std::string& chassisState) {
if (ec)
{
if (ec == boost::system::errc::host_unreachable)
@@ -64,8 +64,8 @@ inline void getChassisState(std::shared_ptr<bmcweb::AsyncResp> aResp)
BMCWEB_LOG_DEBUG << "Service not available " << ec;
return;
}
- BMCWEB_LOG_ERROR << "DBUS response error " << ec;
- messages::internalError(aResp->res);
+ BMCWEB_LOG_DEBUG << "DBUS response error " << ec;
+ messages::internalError(asyncResp->res);
return;
}
@@ -73,19 +73,19 @@ inline void getChassisState(std::shared_ptr<bmcweb::AsyncResp> aResp)
// Verify Chassis State
if (chassisState == "xyz.openbmc_project.State.Chassis.PowerState.On")
{
- aResp->res.jsonValue["PowerState"] = "On";
- aResp->res.jsonValue["Status"]["State"] = "Enabled";
+ asyncResp->res.jsonValue["PowerState"] = "On";
+ asyncResp->res.jsonValue["Status"]["State"] = "Enabled";
}
else if (chassisState ==
"xyz.openbmc_project.State.Chassis.PowerState.Off")
{
- aResp->res.jsonValue["PowerState"] = "Off";
- aResp->res.jsonValue["Status"]["State"] = "StandbyOffline";
+ asyncResp->res.jsonValue["PowerState"] = "Off";
+ asyncResp->res.jsonValue["Status"]["State"] = "StandbyOffline";
}
});
}
-inline void getIntrusionByService(std::shared_ptr<bmcweb::AsyncResp> aResp,
+inline void getIntrusionByService(std::shared_ptr<bmcweb::AsyncResp> asyncResp,
const std::string& service,
const std::string& objPath)
{
@@ -94,8 +94,8 @@ inline void getIntrusionByService(std::shared_ptr<bmcweb::AsyncResp> aResp,
sdbusplus::asio::getProperty<std::string>(
*crow::connections::systemBus, service, objPath,
"xyz.openbmc_project.Chassis.Intrusion", "Status",
- [aResp{std::move(aResp)}](const boost::system::error_code& ec,
- const std::string& value) {
+ [asyncResp{std::move(asyncResp)}](const boost::system::error_code& ec,
+ const std::string& value) {
if (ec)
{
// do not add err msg in redfish response, because this is not
@@ -104,21 +104,23 @@ inline void getIntrusionByService(std::shared_ptr<bmcweb::AsyncResp> aResp,
return;
}
- aResp->res.jsonValue["PhysicalSecurity"]["IntrusionSensorNumber"] = 1;
- aResp->res.jsonValue["PhysicalSecurity"]["IntrusionSensor"] = value;
+ asyncResp->res.jsonValue["PhysicalSecurity"]["IntrusionSensorNumber"] =
+ 1;
+ asyncResp->res.jsonValue["PhysicalSecurity"]["IntrusionSensor"] = value;
});
}
/**
* Retrieves physical security properties over dbus
*/
-inline void getPhysicalSecurityData(std::shared_ptr<bmcweb::AsyncResp> aResp)
+inline void
+ getPhysicalSecurityData(std::shared_ptr<bmcweb::AsyncResp> asyncResp)
{
constexpr std::array<std::string_view, 1> interfaces = {
"xyz.openbmc_project.Chassis.Intrusion"};
dbus::utility::getSubTree(
"/xyz/openbmc_project/Intrusion", 1, interfaces,
- [aResp{std::move(aResp)}](
+ [asyncResp{std::move(asyncResp)}](
const boost::system::error_code& ec,
const dbus::utility::MapperGetSubTreeResponse& subtree) {
if (ec)
@@ -134,7 +136,7 @@ inline void getPhysicalSecurityData(std::shared_ptr<bmcweb::AsyncResp> aResp)
if (!object.second.empty())
{
const auto service = object.second.front();
- getIntrusionByService(aResp, service.first, object.first);
+ getIntrusionByService(asyncResp, service.first, object.first);
return;
}
}