blob: ae9cc5daee0894e2dc8cb3e7c0b30de7f3ca4a70 [file] [log] [blame]
George Liud6a1bae2022-06-20 13:47:31 +08001#include "button_handler.hpp"
Matt Spinler69f93512018-11-26 14:55:58 -06002
Delphine CC Chiu15c60e22024-04-12 13:01:32 -05003#include "config.hpp"
Matt Spinler1a309f72023-04-04 13:12:19 -05004#include "power_button_profile_factory.hpp"
5
George Liu9fb15972022-06-20 14:54:38 +08006#include <phosphor-logging/lg2.hpp>
Matt Spinler963c65f2018-11-26 14:46:41 -06007#include <xyz/openbmc_project/State/Chassis/server.hpp>
8#include <xyz/openbmc_project/State/Host/server.hpp>
Matt Spinlerfb35a322018-11-26 14:30:30 -06009namespace phosphor
10{
11namespace button
12{
Matt Spinler963c65f2018-11-26 14:46:41 -060013
14namespace sdbusRule = sdbusplus::bus::match::rules;
15using namespace sdbusplus::xyz::openbmc_project::State::server;
Matt Spinler963c65f2018-11-26 14:46:41 -060016
Matt Spinler963c65f2018-11-26 14:46:41 -060017constexpr auto chassisIface = "xyz.openbmc_project.State.Chassis";
18constexpr auto hostIface = "xyz.openbmc_project.State.Host";
19constexpr auto powerButtonIface = "xyz.openbmc_project.Chassis.Buttons.Power";
Matt Spinler69f93512018-11-26 14:55:58 -060020constexpr auto idButtonIface = "xyz.openbmc_project.Chassis.Buttons.ID";
Matt Spinler06a5bdd2018-11-26 14:50:48 -060021constexpr auto resetButtonIface = "xyz.openbmc_project.Chassis.Buttons.Reset";
Matt Spinler69f93512018-11-26 14:55:58 -060022constexpr auto ledGroupIface = "xyz.openbmc_project.Led.Group";
Naveen Moses3bd1cfc2022-02-14 18:04:20 +053023constexpr auto ledGroupBasePath = "/xyz/openbmc_project/led/groups/";
24constexpr auto hostSelectorIface =
25 "xyz.openbmc_project.Chassis.Buttons.HostSelector";
26constexpr auto debugHostSelectorIface =
Naveen Mosesa6d4e652022-04-13 19:27:25 +053027 "xyz.openbmc_project.Chassis.Buttons.Button";
Naveen Moses3bd1cfc2022-02-14 18:04:20 +053028
29constexpr auto propertyIface = "org.freedesktop.DBus.Properties";
30constexpr auto mapperIface = "xyz.openbmc_project.ObjectMapper";
Matt Spinler963c65f2018-11-26 14:46:41 -060031
32constexpr auto mapperObjPath = "/xyz/openbmc_project/object_mapper";
33constexpr auto mapperService = "xyz.openbmc_project.ObjectMapper";
Naveen Moses3bd1cfc2022-02-14 18:04:20 +053034constexpr auto BMC_POSITION = 0;
Matt Spinler963c65f2018-11-26 14:46:41 -060035
Patrick Williams9a529a62022-07-22 19:26:54 -050036Handler::Handler(sdbusplus::bus_t& bus) : bus(bus)
Matt Spinlerfb35a322018-11-26 14:30:30 -060037{
Matt Spinler963c65f2018-11-26 14:46:41 -060038 try
39 {
40 if (!getService(POWER_DBUS_OBJECT_NAME, powerButtonIface).empty())
41 {
George Liu9fb15972022-06-20 14:54:38 +080042 lg2::info("Starting power button handler");
Matt Spinler1a309f72023-04-04 13:12:19 -050043
44 // Check for a custom handler
45 powerButtonProfile =
46 PowerButtonProfileFactory::instance().createProfile(bus);
47
48 if (!powerButtonProfile)
49 {
50 powerButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
51 bus,
52 sdbusRule::type::signal() + sdbusRule::member("Released") +
53 sdbusRule::path(POWER_DBUS_OBJECT_NAME) +
54 sdbusRule::interface(powerButtonIface),
55 std::bind(std::mem_fn(&Handler::powerReleased), this,
56 std::placeholders::_1));
57 }
Matt Spinler963c65f2018-11-26 14:46:41 -060058 }
59 }
Patrick Williams9a529a62022-07-22 19:26:54 -050060 catch (const sdbusplus::exception_t& e)
Matt Spinler963c65f2018-11-26 14:46:41 -060061 {
62 // The button wasn't implemented
63 }
Matt Spinler06a5bdd2018-11-26 14:50:48 -060064
65 try
66 {
Matt Spinler69f93512018-11-26 14:55:58 -060067 if (!getService(ID_DBUS_OBJECT_NAME, idButtonIface).empty())
68 {
George Liu9fb15972022-06-20 14:54:38 +080069 lg2::info("Registering ID button handler");
Matt Spinler69f93512018-11-26 14:55:58 -060070 idButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
71 bus,
72 sdbusRule::type::signal() + sdbusRule::member("Released") +
73 sdbusRule::path(ID_DBUS_OBJECT_NAME) +
74 sdbusRule::interface(idButtonIface),
Naveen Mosesab8dac52022-07-15 19:32:27 +053075 std::bind(std::mem_fn(&Handler::idReleased), this,
Matt Spinler69f93512018-11-26 14:55:58 -060076 std::placeholders::_1));
77 }
78 }
Patrick Williams9a529a62022-07-22 19:26:54 -050079 catch (const sdbusplus::exception_t& e)
Matt Spinler69f93512018-11-26 14:55:58 -060080 {
81 // The button wasn't implemented
82 }
83
84 try
85 {
Matt Spinler06a5bdd2018-11-26 14:50:48 -060086 if (!getService(RESET_DBUS_OBJECT_NAME, resetButtonIface).empty())
87 {
George Liu9fb15972022-06-20 14:54:38 +080088 lg2::info("Registering reset button handler");
Matt Spinler06a5bdd2018-11-26 14:50:48 -060089 resetButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
90 bus,
91 sdbusRule::type::signal() + sdbusRule::member("Released") +
92 sdbusRule::path(RESET_DBUS_OBJECT_NAME) +
93 sdbusRule::interface(resetButtonIface),
Naveen Mosesab8dac52022-07-15 19:32:27 +053094 std::bind(std::mem_fn(&Handler::resetReleased), this,
Matt Spinler06a5bdd2018-11-26 14:50:48 -060095 std::placeholders::_1));
96 }
97 }
Patrick Williams9a529a62022-07-22 19:26:54 -050098 catch (const sdbusplus::exception_t& e)
Matt Spinler06a5bdd2018-11-26 14:50:48 -060099 {
100 // The button wasn't implemented
101 }
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530102 try
103 {
104 if (!getService(DBG_HS_DBUS_OBJECT_NAME, debugHostSelectorIface)
105 .empty())
106 {
107 lg2::info("Registering debug host selector button handler");
108 debugHSButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
109 bus,
110 sdbusRule::type::signal() + sdbusRule::member("Released") +
111 sdbusRule::path(DBG_HS_DBUS_OBJECT_NAME) +
112 sdbusRule::interface(debugHostSelectorIface),
113 std::bind(std::mem_fn(&Handler::debugHostSelectorReleased),
114 this, std::placeholders::_1));
115 }
116 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600117 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530118 {
119 // The button wasn't implemented
120 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600121}
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530122bool Handler::isMultiHost()
123{
124 // return true in case host selector object is available
125 return (!getService(HS_DBUS_OBJECT_NAME, hostSelectorIface).empty());
126}
Matt Spinler963c65f2018-11-26 14:46:41 -0600127std::string Handler::getService(const std::string& path,
128 const std::string& interface) const
129{
130 auto method = bus.new_method_call(mapperService, mapperObjPath, mapperIface,
131 "GetObject");
132 method.append(path, std::vector{interface});
Thang Q. Nguyen42507852022-08-12 09:11:35 +0700133 try
134 {
135 auto result = bus.call(method);
136 std::map<std::string, std::vector<std::string>> objectData;
137 result.read(objectData);
138 return objectData.begin()->first;
139 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600140 catch (const sdbusplus::exception_t& e)
Thang Q. Nguyen42507852022-08-12 09:11:35 +0700141 {
142 return std::string();
143 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600144}
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530145size_t Handler::getHostSelectorValue()
Matt Spinler963c65f2018-11-26 14:46:41 -0600146{
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530147 auto HSService = getService(HS_DBUS_OBJECT_NAME, hostSelectorIface);
148
149 if (HSService.empty())
150 {
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530151 lg2::info("Host selector dbus object not available");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530152 throw std::invalid_argument("Host selector dbus object not available");
153 }
154
155 try
156 {
157 auto method = bus.new_method_call(
158 HSService.c_str(), HS_DBUS_OBJECT_NAME, propertyIface, "Get");
159 method.append(hostSelectorIface, "Position");
160 auto result = bus.call(method);
161
162 std::variant<size_t> HSPositionVariant;
163 result.read(HSPositionVariant);
164
165 auto position = std::get<size_t>(HSPositionVariant);
166 return position;
167 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500168 catch (const sdbusplus::exception_t& e)
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530169 {
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530170 lg2::error("Error reading host selector position: {ERROR}", "ERROR", e);
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530171 throw;
172 }
173}
174bool Handler::poweredOn(size_t hostNumber) const
175{
Potin Laic0fee462022-12-23 14:19:23 +0800176 auto hostObjectName = HOST_STATE_OBJECT_NAME + std::to_string(hostNumber);
177 auto service = getService(hostObjectName.c_str(), hostIface);
178 auto method = bus.new_method_call(service.c_str(), hostObjectName.c_str(),
179 propertyIface, "Get");
180 method.append(hostIface, "CurrentHostState");
Matt Spinler963c65f2018-11-26 14:46:41 -0600181 auto result = bus.call(method);
182
Patrick Williams5ed4cc02020-05-13 17:52:15 -0500183 std::variant<std::string> state;
Matt Spinler963c65f2018-11-26 14:46:41 -0600184 result.read(state);
185
Potin Laic0fee462022-12-23 14:19:23 +0800186 return Host::HostState::Off !=
187 Host::convertHostStateFromString(std::get<std::string>(state));
Matt Spinler963c65f2018-11-26 14:46:41 -0600188}
189
DelphineCCChiu395c7642023-04-19 10:46:47 +0800190void Handler::handlePowerEvent(PowerEvent powerEventType,
191 std::chrono::microseconds duration)
Matt Spinler963c65f2018-11-26 14:46:41 -0600192{
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530193 std::string objPathName;
194 std::string dbusIfaceName;
195 std::string transitionName;
196 std::variant<Host::Transition, Chassis::Transition> transition;
DelphineCCChiu395c7642023-04-19 10:46:47 +0800197 uint64_t durationMs =
198 std::chrono::duration_cast<std::chrono::milliseconds>(duration).count();
Matt Spinler963c65f2018-11-26 14:46:41 -0600199
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530200 size_t hostNumber = 0;
201 auto isMultiHostSystem = isMultiHost();
202 if (isMultiHostSystem)
Matt Spinler963c65f2018-11-26 14:46:41 -0600203 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530204 hostNumber = getHostSelectorValue();
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530205 lg2::info("Multi-host system detected : {POSITION}", "POSITION",
George Liu9fb15972022-06-20 14:54:38 +0800206 hostNumber);
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530207 }
208
209 std::string hostNumStr = std::to_string(hostNumber);
210
211 // ignore power and reset button events if BMC is selected.
212 if (isMultiHostSystem && (hostNumber == BMC_POSITION) &&
DelphineCCChiu395c7642023-04-19 10:46:47 +0800213 (powerEventType != PowerEvent::powerReleased) &&
214 (durationMs <= LONG_PRESS_TIME_MS))
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530215 {
George Liu9fb15972022-06-20 14:54:38 +0800216 lg2::info(
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530217 "handlePowerEvent : BMC selected on multi-host system. ignoring power and reset button events...");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530218 return;
219 }
220
221 switch (powerEventType)
222 {
Naveen Mosesab8dac52022-07-15 19:32:27 +0530223 case PowerEvent::powerReleased:
George Liu5b98f4d2022-06-20 13:31:14 +0800224 {
DelphineCCChiu395c7642023-04-19 10:46:47 +0800225 if (durationMs <= LONG_PRESS_TIME_MS)
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530226 {
DelphineCCChiu395c7642023-04-19 10:46:47 +0800227 objPathName = HOST_STATE_OBJECT_NAME + hostNumStr;
228 dbusIfaceName = hostIface;
229 transitionName = "RequestedHostTransition";
230
231 transition = Host::Transition::On;
232
233 if (poweredOn(hostNumber))
234 {
235 transition = Host::Transition::Off;
236 }
237 lg2::info("handlePowerEvent : Handle power button press ");
238
239 break;
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530240 }
DelphineCCChiu395c7642023-04-19 10:46:47 +0800241 else
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530242 {
DelphineCCChiu395c7642023-04-19 10:46:47 +0800243 dbusIfaceName = chassisIface;
244 transitionName = "RequestedPowerTransition";
245 objPathName = CHASSIS_STATE_OBJECT_NAME + hostNumStr;
246 transition = Chassis::Transition::Off;
247
248 /* multi host system :
249 hosts (1 to N) - host shutdown
250 bmc (0) - sled cycle
251 single host system :
252 host(0) - host shutdown
253 */
254 if (isMultiHostSystem && (hostNumber == BMC_POSITION))
255 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530256#if CHASSIS_SYSTEM_RESET_ENABLED
DelphineCCChiu395c7642023-04-19 10:46:47 +0800257 objPathName = CHASSISSYSTEM_STATE_OBJECT_NAME + hostNumStr;
258 transition = Chassis::Transition::PowerCycle;
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530259#else
DelphineCCChiu395c7642023-04-19 10:46:47 +0800260 return;
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530261#endif
DelphineCCChiu395c7642023-04-19 10:46:47 +0800262 }
263 else if (!poweredOn(hostNumber))
264 {
265 lg2::info(
266 "Power is off so ignoring long power button press");
267 return;
268 }
269 lg2::info("handlePowerEvent : handle long power button press");
270 break;
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530271 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600272 }
Naveen Mosesab8dac52022-07-15 19:32:27 +0530273 case PowerEvent::resetReleased:
George Liu5b98f4d2022-06-20 13:31:14 +0800274 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530275 objPathName = HOST_STATE_OBJECT_NAME + hostNumStr;
276 dbusIfaceName = hostIface;
277 transitionName = "RequestedHostTransition";
Matt Spinler963c65f2018-11-26 14:46:41 -0600278
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530279 if (!poweredOn(hostNumber))
280 {
George Liu9fb15972022-06-20 14:54:38 +0800281 lg2::info("Power is off so ignoring reset button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530282 return;
283 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600284
George Liu9fb15972022-06-20 14:54:38 +0800285 lg2::info("Handling reset button press");
HuyLe9456ffc2023-06-22 15:21:22 +0700286#ifdef ENABLE_RESET_BUTTON_DO_WARM_REBOOT
287 transition = Host::Transition::ForceWarmReboot;
288#else
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530289 transition = Host::Transition::Reboot;
HuyLe9456ffc2023-06-22 15:21:22 +0700290#endif
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530291 break;
292 }
George Liu5b98f4d2022-06-20 13:31:14 +0800293 default:
294 {
George Liu9fb15972022-06-20 14:54:38 +0800295 lg2::error("{EVENT} is invalid power event. skipping...", "EVENT",
Patrick Williams36106082024-02-26 10:26:43 -0600296 powerEventType);
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530297
298 return;
299 }
300 }
301 auto service = getService(objPathName.c_str(), dbusIfaceName);
302 auto method = bus.new_method_call(service.c_str(), objPathName.c_str(),
303 propertyIface, "Set");
304 method.append(dbusIfaceName, transitionName, transition);
305 bus.call(method);
306}
DelphineCCChiu395c7642023-04-19 10:46:47 +0800307void Handler::powerReleased(sdbusplus::message_t& msg)
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530308{
309 try
310 {
DelphineCCChiu395c7642023-04-19 10:46:47 +0800311 uint64_t time;
312 msg.read(time);
313
314 handlePowerEvent(PowerEvent::powerReleased,
315 std::chrono::microseconds(time));
Matt Spinler963c65f2018-11-26 14:46:41 -0600316 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500317 catch (const sdbusplus::exception_t& e)
Matt Spinler963c65f2018-11-26 14:46:41 -0600318 {
George Liu9fb15972022-06-20 14:54:38 +0800319 lg2::error("Failed power state change on a power button press: {ERROR}",
320 "ERROR", e);
Matt Spinler963c65f2018-11-26 14:46:41 -0600321 }
322}
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600323
Patrick Williams9a529a62022-07-22 19:26:54 -0500324void Handler::resetReleased(sdbusplus::message_t& /* msg */)
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600325{
326 try
327 {
DelphineCCChiu395c7642023-04-19 10:46:47 +0800328 // No need to calculate duration, set to 0.
329 handlePowerEvent(PowerEvent::resetReleased,
330 std::chrono::microseconds(0));
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600331 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500332 catch (const sdbusplus::exception_t& e)
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600333 {
George Liu9fb15972022-06-20 14:54:38 +0800334 lg2::error("Failed power state change on a reset button press: {ERROR}",
335 "ERROR", e);
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600336 }
337}
Matt Spinler69f93512018-11-26 14:55:58 -0600338
Patrick Williams9a529a62022-07-22 19:26:54 -0500339void Handler::idReleased(sdbusplus::message_t& /* msg */)
Matt Spinler69f93512018-11-26 14:55:58 -0600340{
341 std::string groupPath{ledGroupBasePath};
342 groupPath += ID_LED_GROUP;
343
344 auto service = getService(groupPath, ledGroupIface);
345
346 if (service.empty())
347 {
George Liu9fb15972022-06-20 14:54:38 +0800348 lg2::info("No found {GROUP} during ID button press:", "GROUP",
349 groupPath);
Matt Spinler69f93512018-11-26 14:55:58 -0600350 return;
351 }
352
353 try
354 {
355 auto method = bus.new_method_call(service.c_str(), groupPath.c_str(),
356 propertyIface, "Get");
357 method.append(ledGroupIface, "Asserted");
358 auto result = bus.call(method);
359
Patrick Williams5ed4cc02020-05-13 17:52:15 -0500360 std::variant<bool> state;
Matt Spinler69f93512018-11-26 14:55:58 -0600361 result.read(state);
362
Patrick Williams51f5e8b2020-05-13 11:33:44 -0500363 state = !std::get<bool>(state);
Matt Spinler69f93512018-11-26 14:55:58 -0600364
George Liu9fb15972022-06-20 14:54:38 +0800365 lg2::info(
366 "Changing ID LED group state on ID LED press, GROUP = {GROUP}, STATE = {STATE}",
367 "GROUP", groupPath, "STATE", std::get<bool>(state));
Matt Spinler69f93512018-11-26 14:55:58 -0600368
369 method = bus.new_method_call(service.c_str(), groupPath.c_str(),
370 propertyIface, "Set");
371
372 method.append(ledGroupIface, "Asserted", state);
373 result = bus.call(method);
374 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500375 catch (const sdbusplus::exception_t& e)
Matt Spinler69f93512018-11-26 14:55:58 -0600376 {
George Liu9fb15972022-06-20 14:54:38 +0800377 lg2::error("Error toggling ID LED group on ID button press: {ERROR}",
378 "ERROR", e);
Matt Spinler69f93512018-11-26 14:55:58 -0600379 }
380}
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530381
382void Handler::increaseHostSelectorPosition()
383{
384 try
385 {
386 auto HSService = getService(HS_DBUS_OBJECT_NAME, hostSelectorIface);
387
388 if (HSService.empty())
389 {
390 lg2::error("Host selector service not available");
391 return;
392 }
393
394 auto method =
395 bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME,
396 phosphor::button::propertyIface, "GetAll");
397 method.append(phosphor::button::hostSelectorIface);
398 auto result = bus.call(method);
399 std::unordered_map<std::string, std::variant<size_t>> properties;
400 result.read(properties);
401
402 auto maxPosition = std::get<size_t>(properties.at("MaxPosition"));
403 auto position = std::get<size_t>(properties.at("Position"));
404
405 std::variant<size_t> HSPositionVariant =
406 (position < maxPosition) ? (position + 1) : 0;
407
408 method = bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME,
409 phosphor::button::propertyIface, "Set");
410 method.append(phosphor::button::hostSelectorIface, "Position");
411
412 method.append(HSPositionVariant);
413 result = bus.call(method);
414 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600415 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530416 {
417 lg2::error("Error modifying host selector position : {ERROR}", "ERROR",
418 e);
419 }
420}
421
Patrick Williamse3b4e112022-11-26 09:41:58 -0600422void Handler::debugHostSelectorReleased(sdbusplus::message_t& /* msg */)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530423{
424 try
425 {
426 increaseHostSelectorPosition();
427 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600428 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530429 {
430 lg2::error(
431 "Failed power process debug host selector button press : {ERROR}",
432 "ERROR", e);
433 }
434}
435
Matt Spinlerfb35a322018-11-26 14:30:30 -0600436} // namespace button
437} // namespace phosphor