blob: 27a9333bb02b244b83739108827319b3ac92ef35 [file] [log] [blame]
George Liud6a1bae2022-06-20 13:47:31 +08001#include "config.h"
Matt Spinlerfb35a322018-11-26 14:30:30 -06002
George Liud6a1bae2022-06-20 13:47:31 +08003#include "button_handler.hpp"
Matt Spinler69f93512018-11-26 14:55:58 -06004
George Liu9fb15972022-06-20 14:54:38 +08005#include <phosphor-logging/lg2.hpp>
Matt Spinler963c65f2018-11-26 14:46:41 -06006#include <xyz/openbmc_project/State/Chassis/server.hpp>
7#include <xyz/openbmc_project/State/Host/server.hpp>
Matt Spinlerfb35a322018-11-26 14:30:30 -06008namespace phosphor
9{
10namespace button
11{
Matt Spinler963c65f2018-11-26 14:46:41 -060012
13namespace sdbusRule = sdbusplus::bus::match::rules;
14using namespace sdbusplus::xyz::openbmc_project::State::server;
Matt Spinler963c65f2018-11-26 14:46:41 -060015
Matt Spinler963c65f2018-11-26 14:46:41 -060016constexpr auto chassisIface = "xyz.openbmc_project.State.Chassis";
17constexpr auto hostIface = "xyz.openbmc_project.State.Host";
18constexpr auto powerButtonIface = "xyz.openbmc_project.Chassis.Buttons.Power";
Matt Spinler69f93512018-11-26 14:55:58 -060019constexpr auto idButtonIface = "xyz.openbmc_project.Chassis.Buttons.ID";
Matt Spinler06a5bdd2018-11-26 14:50:48 -060020constexpr auto resetButtonIface = "xyz.openbmc_project.Chassis.Buttons.Reset";
Matt Spinler69f93512018-11-26 14:55:58 -060021constexpr auto ledGroupIface = "xyz.openbmc_project.Led.Group";
Naveen Moses3bd1cfc2022-02-14 18:04:20 +053022constexpr auto ledGroupBasePath = "/xyz/openbmc_project/led/groups/";
23constexpr auto hostSelectorIface =
24 "xyz.openbmc_project.Chassis.Buttons.HostSelector";
25constexpr auto debugHostSelectorIface =
Naveen Mosesa6d4e652022-04-13 19:27:25 +053026 "xyz.openbmc_project.Chassis.Buttons.Button";
Naveen Moses3bd1cfc2022-02-14 18:04:20 +053027
28constexpr auto propertyIface = "org.freedesktop.DBus.Properties";
29constexpr auto mapperIface = "xyz.openbmc_project.ObjectMapper";
Matt Spinler963c65f2018-11-26 14:46:41 -060030
31constexpr auto mapperObjPath = "/xyz/openbmc_project/object_mapper";
32constexpr auto mapperService = "xyz.openbmc_project.ObjectMapper";
Naveen Moses3bd1cfc2022-02-14 18:04:20 +053033constexpr auto BMC_POSITION = 0;
Matt Spinler963c65f2018-11-26 14:46:41 -060034
Patrick Williams9a529a62022-07-22 19:26:54 -050035Handler::Handler(sdbusplus::bus_t& bus) : bus(bus)
Matt Spinlerfb35a322018-11-26 14:30:30 -060036{
Matt Spinler963c65f2018-11-26 14:46:41 -060037 try
38 {
39 if (!getService(POWER_DBUS_OBJECT_NAME, powerButtonIface).empty())
40 {
George Liu9fb15972022-06-20 14:54:38 +080041 lg2::info("Starting power button handler");
Matt Spinler963c65f2018-11-26 14:46:41 -060042 powerButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
43 bus,
44 sdbusRule::type::signal() + sdbusRule::member("Released") +
45 sdbusRule::path(POWER_DBUS_OBJECT_NAME) +
46 sdbusRule::interface(powerButtonIface),
Naveen Mosesab8dac52022-07-15 19:32:27 +053047 std::bind(std::mem_fn(&Handler::powerReleased), this,
Matt Spinler963c65f2018-11-26 14:46:41 -060048 std::placeholders::_1));
49
Naveen Mosesab8dac52022-07-15 19:32:27 +053050 powerButtonLongPressed = std::make_unique<sdbusplus::bus::match_t>(
51 bus,
52 sdbusRule::type::signal() + sdbusRule::member("PressedLong") +
53 sdbusRule::path(POWER_DBUS_OBJECT_NAME) +
54 sdbusRule::interface(powerButtonIface),
55 std::bind(std::mem_fn(&Handler::longPowerPressed), this,
56 std::placeholders::_1));
Matt Spinler963c65f2018-11-26 14:46:41 -060057 }
58 }
Patrick Williams9a529a62022-07-22 19:26:54 -050059 catch (const sdbusplus::exception_t& e)
Matt Spinler963c65f2018-11-26 14:46:41 -060060 {
61 // The button wasn't implemented
62 }
Matt Spinler06a5bdd2018-11-26 14:50:48 -060063
64 try
65 {
Matt Spinler69f93512018-11-26 14:55:58 -060066 if (!getService(ID_DBUS_OBJECT_NAME, idButtonIface).empty())
67 {
George Liu9fb15972022-06-20 14:54:38 +080068 lg2::info("Registering ID button handler");
Matt Spinler69f93512018-11-26 14:55:58 -060069 idButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
70 bus,
71 sdbusRule::type::signal() + sdbusRule::member("Released") +
72 sdbusRule::path(ID_DBUS_OBJECT_NAME) +
73 sdbusRule::interface(idButtonIface),
Naveen Mosesab8dac52022-07-15 19:32:27 +053074 std::bind(std::mem_fn(&Handler::idReleased), this,
Matt Spinler69f93512018-11-26 14:55:58 -060075 std::placeholders::_1));
76 }
77 }
Patrick Williams9a529a62022-07-22 19:26:54 -050078 catch (const sdbusplus::exception_t& e)
Matt Spinler69f93512018-11-26 14:55:58 -060079 {
80 // The button wasn't implemented
81 }
82
83 try
84 {
Matt Spinler06a5bdd2018-11-26 14:50:48 -060085 if (!getService(RESET_DBUS_OBJECT_NAME, resetButtonIface).empty())
86 {
George Liu9fb15972022-06-20 14:54:38 +080087 lg2::info("Registering reset button handler");
Matt Spinler06a5bdd2018-11-26 14:50:48 -060088 resetButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
89 bus,
90 sdbusRule::type::signal() + sdbusRule::member("Released") +
91 sdbusRule::path(RESET_DBUS_OBJECT_NAME) +
92 sdbusRule::interface(resetButtonIface),
Naveen Mosesab8dac52022-07-15 19:32:27 +053093 std::bind(std::mem_fn(&Handler::resetReleased), this,
Matt Spinler06a5bdd2018-11-26 14:50:48 -060094 std::placeholders::_1));
95 }
96 }
Patrick Williams9a529a62022-07-22 19:26:54 -050097 catch (const sdbusplus::exception_t& e)
Matt Spinler06a5bdd2018-11-26 14:50:48 -060098 {
99 // The button wasn't implemented
100 }
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530101 try
102 {
103 if (!getService(DBG_HS_DBUS_OBJECT_NAME, debugHostSelectorIface)
104 .empty())
105 {
106 lg2::info("Registering debug host selector button handler");
107 debugHSButtonReleased = std::make_unique<sdbusplus::bus::match_t>(
108 bus,
109 sdbusRule::type::signal() + sdbusRule::member("Released") +
110 sdbusRule::path(DBG_HS_DBUS_OBJECT_NAME) +
111 sdbusRule::interface(debugHostSelectorIface),
112 std::bind(std::mem_fn(&Handler::debugHostSelectorReleased),
113 this, std::placeholders::_1));
114 }
115 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600116 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530117 {
118 // The button wasn't implemented
119 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600120}
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530121bool Handler::isMultiHost()
122{
123 // return true in case host selector object is available
124 return (!getService(HS_DBUS_OBJECT_NAME, hostSelectorIface).empty());
125}
Matt Spinler963c65f2018-11-26 14:46:41 -0600126std::string Handler::getService(const std::string& path,
127 const std::string& interface) const
128{
129 auto method = bus.new_method_call(mapperService, mapperObjPath, mapperIface,
130 "GetObject");
131 method.append(path, std::vector{interface});
Thang Q. Nguyen42507852022-08-12 09:11:35 +0700132 try
133 {
134 auto result = bus.call(method);
135 std::map<std::string, std::vector<std::string>> objectData;
136 result.read(objectData);
137 return objectData.begin()->first;
138 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600139 catch (const sdbusplus::exception_t& e)
Thang Q. Nguyen42507852022-08-12 09:11:35 +0700140 {
141 return std::string();
142 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600143}
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530144size_t Handler::getHostSelectorValue()
Matt Spinler963c65f2018-11-26 14:46:41 -0600145{
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530146 auto HSService = getService(HS_DBUS_OBJECT_NAME, hostSelectorIface);
147
148 if (HSService.empty())
149 {
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530150 lg2::info("Host selector dbus object not available");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530151 throw std::invalid_argument("Host selector dbus object not available");
152 }
153
154 try
155 {
156 auto method = bus.new_method_call(
157 HSService.c_str(), HS_DBUS_OBJECT_NAME, propertyIface, "Get");
158 method.append(hostSelectorIface, "Position");
159 auto result = bus.call(method);
160
161 std::variant<size_t> HSPositionVariant;
162 result.read(HSPositionVariant);
163
164 auto position = std::get<size_t>(HSPositionVariant);
165 return position;
166 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500167 catch (const sdbusplus::exception_t& e)
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530168 {
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530169 lg2::error("Error reading host selector position: {ERROR}", "ERROR", e);
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530170 throw;
171 }
172}
173bool Handler::poweredOn(size_t hostNumber) const
174{
Potin Laic0fee462022-12-23 14:19:23 +0800175 auto hostObjectName = HOST_STATE_OBJECT_NAME + std::to_string(hostNumber);
176 auto service = getService(hostObjectName.c_str(), hostIface);
177 auto method = bus.new_method_call(service.c_str(), hostObjectName.c_str(),
178 propertyIface, "Get");
179 method.append(hostIface, "CurrentHostState");
Matt Spinler963c65f2018-11-26 14:46:41 -0600180 auto result = bus.call(method);
181
Patrick Williams5ed4cc02020-05-13 17:52:15 -0500182 std::variant<std::string> state;
Matt Spinler963c65f2018-11-26 14:46:41 -0600183 result.read(state);
184
Potin Laic0fee462022-12-23 14:19:23 +0800185 return Host::HostState::Off !=
186 Host::convertHostStateFromString(std::get<std::string>(state));
Matt Spinler963c65f2018-11-26 14:46:41 -0600187}
188
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530189void Handler::handlePowerEvent(PowerEvent powerEventType)
Matt Spinler963c65f2018-11-26 14:46:41 -0600190{
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530191 std::string objPathName;
192 std::string dbusIfaceName;
193 std::string transitionName;
194 std::variant<Host::Transition, Chassis::Transition> transition;
Matt Spinler963c65f2018-11-26 14:46:41 -0600195
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530196 size_t hostNumber = 0;
197 auto isMultiHostSystem = isMultiHost();
198 if (isMultiHostSystem)
Matt Spinler963c65f2018-11-26 14:46:41 -0600199 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530200 hostNumber = getHostSelectorValue();
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530201 lg2::info("Multi-host system detected : {POSITION}", "POSITION",
George Liu9fb15972022-06-20 14:54:38 +0800202 hostNumber);
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530203 }
204
205 std::string hostNumStr = std::to_string(hostNumber);
206
207 // ignore power and reset button events if BMC is selected.
208 if (isMultiHostSystem && (hostNumber == BMC_POSITION) &&
Potin Laie2d0f422022-12-20 13:43:58 +0800209 (powerEventType != PowerEvent::longPowerPressed))
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530210 {
George Liu9fb15972022-06-20 14:54:38 +0800211 lg2::info(
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530212 "handlePowerEvent : BMC selected on multi-host system. ignoring power and reset button events...");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530213 return;
214 }
215
216 switch (powerEventType)
217 {
Naveen Mosesab8dac52022-07-15 19:32:27 +0530218 case PowerEvent::powerReleased:
George Liu5b98f4d2022-06-20 13:31:14 +0800219 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530220 objPathName = HOST_STATE_OBJECT_NAME + hostNumStr;
221 dbusIfaceName = hostIface;
222 transitionName = "RequestedHostTransition";
223
224 transition = Host::Transition::On;
225
226 if (poweredOn(hostNumber))
227 {
228 transition = Host::Transition::Off;
229 }
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530230 lg2::info("handlePowerEvent : Handle power button press ");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530231
232 break;
233 }
Potin Laie2d0f422022-12-20 13:43:58 +0800234 case PowerEvent::longPowerPressed:
George Liu5b98f4d2022-06-20 13:31:14 +0800235 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530236 dbusIfaceName = chassisIface;
237 transitionName = "RequestedPowerTransition";
238 objPathName = CHASSIS_STATE_OBJECT_NAME + hostNumStr;
239 transition = Chassis::Transition::Off;
240
241 /* multi host system :
242 hosts (1 to N) - host shutdown
243 bmc (0) - sled cycle
244 single host system :
245 host(0) - host shutdown
246 */
247 if (isMultiHostSystem && (hostNumber == BMC_POSITION))
248 {
249#if CHASSIS_SYSTEM_RESET_ENABLED
250 objPathName = CHASSISSYSTEM_STATE_OBJECT_NAME + hostNumStr;
251 transition = Chassis::Transition::PowerCycle;
252#else
253 return;
254#endif
255 }
256 else if (!poweredOn(hostNumber))
257 {
George Liu9fb15972022-06-20 14:54:38 +0800258 lg2::info("Power is off so ignoring long power button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530259 return;
260 }
George Liu9fb15972022-06-20 14:54:38 +0800261 lg2::info("handlePowerEvent : handle long power button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530262
263 break;
Matt Spinler963c65f2018-11-26 14:46:41 -0600264 }
265
Naveen Mosesab8dac52022-07-15 19:32:27 +0530266 case PowerEvent::resetReleased:
George Liu5b98f4d2022-06-20 13:31:14 +0800267 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530268 objPathName = HOST_STATE_OBJECT_NAME + hostNumStr;
269 dbusIfaceName = hostIface;
270 transitionName = "RequestedHostTransition";
Matt Spinler963c65f2018-11-26 14:46:41 -0600271
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530272 if (!poweredOn(hostNumber))
273 {
George Liu9fb15972022-06-20 14:54:38 +0800274 lg2::info("Power is off so ignoring reset button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530275 return;
276 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600277
George Liu9fb15972022-06-20 14:54:38 +0800278 lg2::info("Handling reset button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530279 transition = Host::Transition::Reboot;
280 break;
281 }
George Liu5b98f4d2022-06-20 13:31:14 +0800282 default:
283 {
George Liu9fb15972022-06-20 14:54:38 +0800284 lg2::error("{EVENT} is invalid power event. skipping...", "EVENT",
285 static_cast<std::underlying_type_t<PowerEvent>>(
286 powerEventType));
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530287
288 return;
289 }
290 }
291 auto service = getService(objPathName.c_str(), dbusIfaceName);
292 auto method = bus.new_method_call(service.c_str(), objPathName.c_str(),
293 propertyIface, "Set");
294 method.append(dbusIfaceName, transitionName, transition);
295 bus.call(method);
296}
Patrick Williams9a529a62022-07-22 19:26:54 -0500297void Handler::powerReleased(sdbusplus::message_t& /* msg */)
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530298{
299 try
300 {
Naveen Mosesab8dac52022-07-15 19:32:27 +0530301 handlePowerEvent(PowerEvent::powerReleased);
Matt Spinler963c65f2018-11-26 14:46:41 -0600302 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500303 catch (const sdbusplus::exception_t& e)
Matt Spinler963c65f2018-11-26 14:46:41 -0600304 {
George Liu9fb15972022-06-20 14:54:38 +0800305 lg2::error("Failed power state change on a power button press: {ERROR}",
306 "ERROR", e);
Matt Spinler963c65f2018-11-26 14:46:41 -0600307 }
308}
Patrick Williams9a529a62022-07-22 19:26:54 -0500309void Handler::longPowerPressed(sdbusplus::message_t& /* msg */)
Matt Spinler963c65f2018-11-26 14:46:41 -0600310{
311 try
312 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530313 handlePowerEvent(PowerEvent::longPowerPressed);
Matt Spinler963c65f2018-11-26 14:46:41 -0600314 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500315 catch (const sdbusplus::exception_t& e)
Matt Spinler963c65f2018-11-26 14:46:41 -0600316 {
George Liu9fb15972022-06-20 14:54:38 +0800317 lg2::error("Failed powering off on long power button press: {ERROR}",
318 "ERROR", e);
Matt Spinler963c65f2018-11-26 14:46:41 -0600319 }
Matt Spinlerfb35a322018-11-26 14:30:30 -0600320}
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600321
Patrick Williams9a529a62022-07-22 19:26:54 -0500322void Handler::resetReleased(sdbusplus::message_t& /* msg */)
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600323{
324 try
325 {
Naveen Mosesab8dac52022-07-15 19:32:27 +0530326 handlePowerEvent(PowerEvent::resetReleased);
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600327 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500328 catch (const sdbusplus::exception_t& e)
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600329 {
George Liu9fb15972022-06-20 14:54:38 +0800330 lg2::error("Failed power state change on a reset button press: {ERROR}",
331 "ERROR", e);
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600332 }
333}
Matt Spinler69f93512018-11-26 14:55:58 -0600334
Patrick Williams9a529a62022-07-22 19:26:54 -0500335void Handler::idReleased(sdbusplus::message_t& /* msg */)
Matt Spinler69f93512018-11-26 14:55:58 -0600336{
337 std::string groupPath{ledGroupBasePath};
338 groupPath += ID_LED_GROUP;
339
340 auto service = getService(groupPath, ledGroupIface);
341
342 if (service.empty())
343 {
George Liu9fb15972022-06-20 14:54:38 +0800344 lg2::info("No found {GROUP} during ID button press:", "GROUP",
345 groupPath);
Matt Spinler69f93512018-11-26 14:55:58 -0600346 return;
347 }
348
349 try
350 {
351 auto method = bus.new_method_call(service.c_str(), groupPath.c_str(),
352 propertyIface, "Get");
353 method.append(ledGroupIface, "Asserted");
354 auto result = bus.call(method);
355
Patrick Williams5ed4cc02020-05-13 17:52:15 -0500356 std::variant<bool> state;
Matt Spinler69f93512018-11-26 14:55:58 -0600357 result.read(state);
358
Patrick Williams51f5e8b2020-05-13 11:33:44 -0500359 state = !std::get<bool>(state);
Matt Spinler69f93512018-11-26 14:55:58 -0600360
George Liu9fb15972022-06-20 14:54:38 +0800361 lg2::info(
362 "Changing ID LED group state on ID LED press, GROUP = {GROUP}, STATE = {STATE}",
363 "GROUP", groupPath, "STATE", std::get<bool>(state));
Matt Spinler69f93512018-11-26 14:55:58 -0600364
365 method = bus.new_method_call(service.c_str(), groupPath.c_str(),
366 propertyIface, "Set");
367
368 method.append(ledGroupIface, "Asserted", state);
369 result = bus.call(method);
370 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500371 catch (const sdbusplus::exception_t& e)
Matt Spinler69f93512018-11-26 14:55:58 -0600372 {
George Liu9fb15972022-06-20 14:54:38 +0800373 lg2::error("Error toggling ID LED group on ID button press: {ERROR}",
374 "ERROR", e);
Matt Spinler69f93512018-11-26 14:55:58 -0600375 }
376}
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530377
378void Handler::increaseHostSelectorPosition()
379{
380 try
381 {
382 auto HSService = getService(HS_DBUS_OBJECT_NAME, hostSelectorIface);
383
384 if (HSService.empty())
385 {
386 lg2::error("Host selector service not available");
387 return;
388 }
389
390 auto method =
391 bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME,
392 phosphor::button::propertyIface, "GetAll");
393 method.append(phosphor::button::hostSelectorIface);
394 auto result = bus.call(method);
395 std::unordered_map<std::string, std::variant<size_t>> properties;
396 result.read(properties);
397
398 auto maxPosition = std::get<size_t>(properties.at("MaxPosition"));
399 auto position = std::get<size_t>(properties.at("Position"));
400
401 std::variant<size_t> HSPositionVariant =
402 (position < maxPosition) ? (position + 1) : 0;
403
404 method = bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME,
405 phosphor::button::propertyIface, "Set");
406 method.append(phosphor::button::hostSelectorIface, "Position");
407
408 method.append(HSPositionVariant);
409 result = bus.call(method);
410 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600411 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530412 {
413 lg2::error("Error modifying host selector position : {ERROR}", "ERROR",
414 e);
415 }
416}
417
Patrick Williamse3b4e112022-11-26 09:41:58 -0600418void Handler::debugHostSelectorReleased(sdbusplus::message_t& /* msg */)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530419{
420 try
421 {
422 increaseHostSelectorPosition();
423 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600424 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530425 {
426 lg2::error(
427 "Failed power process debug host selector button press : {ERROR}",
428 "ERROR", e);
429 }
430}
431
Matt Spinlerfb35a322018-11-26 14:30:30 -0600432} // namespace button
433} // namespace phosphor