blob: 29ae1bc0e38939c60c79cf90dab1f145d57dc2ba [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{
175 auto chassisObjectName =
176 CHASSIS_STATE_OBJECT_NAME + std::to_string(hostNumber);
177 auto service = getService(chassisObjectName.c_str(), chassisIface);
Matt Spinler963c65f2018-11-26 14:46:41 -0600178 auto method = bus.new_method_call(
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530179 service.c_str(), chassisObjectName.c_str(), propertyIface, "Get");
Matt Spinler963c65f2018-11-26 14:46:41 -0600180 method.append(chassisIface, "CurrentPowerState");
181 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
186 return Chassis::PowerState::On ==
Patrick Williams51f5e8b2020-05-13 11:33:44 -0500187 Chassis::convertPowerStateFromString(std::get<std::string>(state));
Matt Spinler963c65f2018-11-26 14:46:41 -0600188}
189
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530190void Handler::handlePowerEvent(PowerEvent powerEventType)
Matt Spinler963c65f2018-11-26 14:46:41 -0600191{
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530192 std::string objPathName;
193 std::string dbusIfaceName;
194 std::string transitionName;
195 std::variant<Host::Transition, Chassis::Transition> transition;
Matt Spinler963c65f2018-11-26 14:46:41 -0600196
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530197 size_t hostNumber = 0;
198 auto isMultiHostSystem = isMultiHost();
199 if (isMultiHostSystem)
Matt Spinler963c65f2018-11-26 14:46:41 -0600200 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530201 hostNumber = getHostSelectorValue();
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530202 lg2::info("Multi-host system detected : {POSITION}", "POSITION",
George Liu9fb15972022-06-20 14:54:38 +0800203 hostNumber);
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530204 }
205
206 std::string hostNumStr = std::to_string(hostNumber);
207
208 // ignore power and reset button events if BMC is selected.
209 if (isMultiHostSystem && (hostNumber == BMC_POSITION) &&
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530210 (powerEventType != PowerEvent::longPowerReleased))
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530211 {
George Liu9fb15972022-06-20 14:54:38 +0800212 lg2::info(
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530213 "handlePowerEvent : BMC selected on multi-host system. ignoring power and reset button events...");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530214 return;
215 }
216
217 switch (powerEventType)
218 {
Naveen Mosesab8dac52022-07-15 19:32:27 +0530219 case PowerEvent::powerReleased:
George Liu5b98f4d2022-06-20 13:31:14 +0800220 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530221 objPathName = HOST_STATE_OBJECT_NAME + hostNumStr;
222 dbusIfaceName = hostIface;
223 transitionName = "RequestedHostTransition";
224
225 transition = Host::Transition::On;
226
227 if (poweredOn(hostNumber))
228 {
229 transition = Host::Transition::Off;
230 }
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530231 lg2::info("handlePowerEvent : Handle power button press ");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530232
233 break;
234 }
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530235 case PowerEvent::longPowerReleased:
George Liu5b98f4d2022-06-20 13:31:14 +0800236 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530237 dbusIfaceName = chassisIface;
238 transitionName = "RequestedPowerTransition";
239 objPathName = CHASSIS_STATE_OBJECT_NAME + hostNumStr;
240 transition = Chassis::Transition::Off;
241
242 /* multi host system :
243 hosts (1 to N) - host shutdown
244 bmc (0) - sled cycle
245 single host system :
246 host(0) - host shutdown
247 */
248 if (isMultiHostSystem && (hostNumber == BMC_POSITION))
249 {
250#if CHASSIS_SYSTEM_RESET_ENABLED
251 objPathName = CHASSISSYSTEM_STATE_OBJECT_NAME + hostNumStr;
252 transition = Chassis::Transition::PowerCycle;
253#else
254 return;
255#endif
256 }
257 else if (!poweredOn(hostNumber))
258 {
George Liu9fb15972022-06-20 14:54:38 +0800259 lg2::info("Power is off so ignoring long power button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530260 return;
261 }
George Liu9fb15972022-06-20 14:54:38 +0800262 lg2::info("handlePowerEvent : handle long power button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530263
264 break;
Matt Spinler963c65f2018-11-26 14:46:41 -0600265 }
266
Naveen Mosesab8dac52022-07-15 19:32:27 +0530267 case PowerEvent::resetReleased:
George Liu5b98f4d2022-06-20 13:31:14 +0800268 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530269 objPathName = HOST_STATE_OBJECT_NAME + hostNumStr;
270 dbusIfaceName = hostIface;
271 transitionName = "RequestedHostTransition";
Matt Spinler963c65f2018-11-26 14:46:41 -0600272
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530273 if (!poweredOn(hostNumber))
274 {
George Liu9fb15972022-06-20 14:54:38 +0800275 lg2::info("Power is off so ignoring reset button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530276 return;
277 }
Matt Spinler963c65f2018-11-26 14:46:41 -0600278
George Liu9fb15972022-06-20 14:54:38 +0800279 lg2::info("Handling reset button press");
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530280 transition = Host::Transition::Reboot;
281 break;
282 }
George Liu5b98f4d2022-06-20 13:31:14 +0800283 default:
284 {
George Liu9fb15972022-06-20 14:54:38 +0800285 lg2::error("{EVENT} is invalid power event. skipping...", "EVENT",
286 static_cast<std::underlying_type_t<PowerEvent>>(
287 powerEventType));
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530288
289 return;
290 }
291 }
292 auto service = getService(objPathName.c_str(), dbusIfaceName);
293 auto method = bus.new_method_call(service.c_str(), objPathName.c_str(),
294 propertyIface, "Set");
295 method.append(dbusIfaceName, transitionName, transition);
296 bus.call(method);
297}
Patrick Williams9a529a62022-07-22 19:26:54 -0500298void Handler::powerReleased(sdbusplus::message_t& /* msg */)
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530299{
300 try
301 {
Naveen Mosesab8dac52022-07-15 19:32:27 +0530302 handlePowerEvent(PowerEvent::powerReleased);
Matt Spinler963c65f2018-11-26 14:46:41 -0600303 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500304 catch (const sdbusplus::exception_t& e)
Matt Spinler963c65f2018-11-26 14:46:41 -0600305 {
George Liu9fb15972022-06-20 14:54:38 +0800306 lg2::error("Failed power state change on a power button press: {ERROR}",
307 "ERROR", e);
Matt Spinler963c65f2018-11-26 14:46:41 -0600308 }
309}
Patrick Williams9a529a62022-07-22 19:26:54 -0500310void Handler::longPowerPressed(sdbusplus::message_t& /* msg */)
Matt Spinler963c65f2018-11-26 14:46:41 -0600311{
312 try
313 {
Naveen Moses3bd1cfc2022-02-14 18:04:20 +0530314 handlePowerEvent(PowerEvent::longPowerPressed);
Matt Spinler963c65f2018-11-26 14:46:41 -0600315 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500316 catch (const sdbusplus::exception_t& e)
Matt Spinler963c65f2018-11-26 14:46:41 -0600317 {
George Liu9fb15972022-06-20 14:54:38 +0800318 lg2::error("Failed powering off on long power button press: {ERROR}",
319 "ERROR", e);
Matt Spinler963c65f2018-11-26 14:46:41 -0600320 }
Matt Spinlerfb35a322018-11-26 14:30:30 -0600321}
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600322
Patrick Williams9a529a62022-07-22 19:26:54 -0500323void Handler::resetReleased(sdbusplus::message_t& /* msg */)
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600324{
325 try
326 {
Naveen Mosesab8dac52022-07-15 19:32:27 +0530327 handlePowerEvent(PowerEvent::resetReleased);
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600328 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500329 catch (const sdbusplus::exception_t& e)
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600330 {
George Liu9fb15972022-06-20 14:54:38 +0800331 lg2::error("Failed power state change on a reset button press: {ERROR}",
332 "ERROR", e);
Matt Spinler06a5bdd2018-11-26 14:50:48 -0600333 }
334}
Matt Spinler69f93512018-11-26 14:55:58 -0600335
Patrick Williams9a529a62022-07-22 19:26:54 -0500336void Handler::idReleased(sdbusplus::message_t& /* msg */)
Matt Spinler69f93512018-11-26 14:55:58 -0600337{
338 std::string groupPath{ledGroupBasePath};
339 groupPath += ID_LED_GROUP;
340
341 auto service = getService(groupPath, ledGroupIface);
342
343 if (service.empty())
344 {
George Liu9fb15972022-06-20 14:54:38 +0800345 lg2::info("No found {GROUP} during ID button press:", "GROUP",
346 groupPath);
Matt Spinler69f93512018-11-26 14:55:58 -0600347 return;
348 }
349
350 try
351 {
352 auto method = bus.new_method_call(service.c_str(), groupPath.c_str(),
353 propertyIface, "Get");
354 method.append(ledGroupIface, "Asserted");
355 auto result = bus.call(method);
356
Patrick Williams5ed4cc02020-05-13 17:52:15 -0500357 std::variant<bool> state;
Matt Spinler69f93512018-11-26 14:55:58 -0600358 result.read(state);
359
Patrick Williams51f5e8b2020-05-13 11:33:44 -0500360 state = !std::get<bool>(state);
Matt Spinler69f93512018-11-26 14:55:58 -0600361
George Liu9fb15972022-06-20 14:54:38 +0800362 lg2::info(
363 "Changing ID LED group state on ID LED press, GROUP = {GROUP}, STATE = {STATE}",
364 "GROUP", groupPath, "STATE", std::get<bool>(state));
Matt Spinler69f93512018-11-26 14:55:58 -0600365
366 method = bus.new_method_call(service.c_str(), groupPath.c_str(),
367 propertyIface, "Set");
368
369 method.append(ledGroupIface, "Asserted", state);
370 result = bus.call(method);
371 }
Patrick Williams9a529a62022-07-22 19:26:54 -0500372 catch (const sdbusplus::exception_t& e)
Matt Spinler69f93512018-11-26 14:55:58 -0600373 {
George Liu9fb15972022-06-20 14:54:38 +0800374 lg2::error("Error toggling ID LED group on ID button press: {ERROR}",
375 "ERROR", e);
Matt Spinler69f93512018-11-26 14:55:58 -0600376 }
377}
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530378
379void Handler::increaseHostSelectorPosition()
380{
381 try
382 {
383 auto HSService = getService(HS_DBUS_OBJECT_NAME, hostSelectorIface);
384
385 if (HSService.empty())
386 {
387 lg2::error("Host selector service not available");
388 return;
389 }
390
391 auto method =
392 bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME,
393 phosphor::button::propertyIface, "GetAll");
394 method.append(phosphor::button::hostSelectorIface);
395 auto result = bus.call(method);
396 std::unordered_map<std::string, std::variant<size_t>> properties;
397 result.read(properties);
398
399 auto maxPosition = std::get<size_t>(properties.at("MaxPosition"));
400 auto position = std::get<size_t>(properties.at("Position"));
401
402 std::variant<size_t> HSPositionVariant =
403 (position < maxPosition) ? (position + 1) : 0;
404
405 method = bus.new_method_call(HSService.c_str(), HS_DBUS_OBJECT_NAME,
406 phosphor::button::propertyIface, "Set");
407 method.append(phosphor::button::hostSelectorIface, "Position");
408
409 method.append(HSPositionVariant);
410 result = bus.call(method);
411 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600412 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530413 {
414 lg2::error("Error modifying host selector position : {ERROR}", "ERROR",
415 e);
416 }
417}
418
Patrick Williamse3b4e112022-11-26 09:41:58 -0600419void Handler::debugHostSelectorReleased(sdbusplus::message_t& /* msg */)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530420{
421 try
422 {
423 increaseHostSelectorPosition();
424 }
Patrick Williamse3b4e112022-11-26 09:41:58 -0600425 catch (const sdbusplus::exception_t& e)
Naveen Mosesa6d4e652022-04-13 19:27:25 +0530426 {
427 lg2::error(
428 "Failed power process debug host selector button press : {ERROR}",
429 "ERROR", e);
430 }
431}
432
Matt Spinlerfb35a322018-11-26 14:30:30 -0600433} // namespace button
434} // namespace phosphor