summaryrefslogtreecommitdiff
path: root/redfish-core/lib/led.hpp
diff options
context:
space:
mode:
authorzhanghch05 <zhanghch05@inspur.com>2021-04-01 06:18:24 +0300
committerzhanghch05 <zhanghch05@inspur.com>2021-04-08 04:01:21 +0300
commit8d1b46d7f8d39db2ba048f9e9007106ca3a28c9b (patch)
tree821fcb9b383fdf3db22db77e154cd7f57606d402 /redfish-core/lib/led.hpp
parentdab0604af234bdd5010407031a01343d6c242edf (diff)
downloadbmcweb-8d1b46d7f8d39db2ba048f9e9007106ca3a28c9b.tar.xz
Using AsyncResp everywhere
Get the core using AsyncResp everywhere, and not have each individual handler creating its own object.We can call app.handle() without fear of the response getting ended after the first tree is done populating. Don't use res.end() anymore. Tested: 1. Validator passed. Signed-off-by: zhanghaicheng <zhanghch05@inspur.com> Change-Id: I867367ce4a0caf8c4b3f4e07e06c11feed0782e8
Diffstat (limited to 'redfish-core/lib/led.hpp')
-rw-r--r--redfish-core/lib/led.hpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/redfish-core/lib/led.hpp b/redfish-core/lib/led.hpp
index c003d22d57..fe1842f935 100644
--- a/redfish-core/lib/led.hpp
+++ b/redfish-core/lib/led.hpp
@@ -31,7 +31,8 @@ namespace redfish
* @return None.
*/
// TODO (Gunnar): Remove IndicatorLED after enough time has passed
-inline void getIndicatorLedState(const std::shared_ptr<AsyncResp>& aResp)
+inline void
+ getIndicatorLedState(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
{
BMCWEB_LOG_DEBUG << "Get led groups";
crow::connections::systemBus->async_method_call(
@@ -100,8 +101,9 @@ inline void getIndicatorLedState(const std::shared_ptr<AsyncResp>& aResp)
* @return None.
*/
// TODO (Gunnar): Remove IndicatorLED after enough time has passed
-inline void setIndicatorLedState(const std::shared_ptr<AsyncResp>& aResp,
- const std::string& ledState)
+inline void
+ setIndicatorLedState(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+ const std::string& ledState)
{
BMCWEB_LOG_DEBUG << "Set led groups";
bool ledOn = false;
@@ -163,7 +165,8 @@ inline void setIndicatorLedState(const std::shared_ptr<AsyncResp>& aResp,
*
* @return None.
*/
-inline void getLocationIndicatorActive(const std::shared_ptr<AsyncResp>& aResp)
+inline void
+ getLocationIndicatorActive(const std::shared_ptr<bmcweb::AsyncResp>& aResp)
{
BMCWEB_LOG_DEBUG << "Get LocationIndicatorActive";
crow::connections::systemBus->async_method_call(
@@ -233,8 +236,9 @@ inline void getLocationIndicatorActive(const std::shared_ptr<AsyncResp>& aResp)
*
* @return None.
*/
-inline void setLocationIndicatorActive(const std::shared_ptr<AsyncResp>& aResp,
- const bool ledState)
+inline void
+ setLocationIndicatorActive(const std::shared_ptr<bmcweb::AsyncResp>& aResp,
+ const bool ledState)
{
BMCWEB_LOG_DEBUG << "Set LocationIndicatorActive";