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
diff --git a/redfish-core/lib/led.hpp b/redfish-core/lib/led.hpp
index c003d22..fe1842f 100644
--- a/redfish-core/lib/led.hpp
+++ b/redfish-core/lib/led.hpp
@@ -31,7 +31,8 @@
* @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 @@
* @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 @@
*
* @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 @@
*
* @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";