RDK Documentation (Open Sourced RDK Components)
productTraits.cpp
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 #include <iostream>
21 #include <thread>
22 #include <chrono>
23 #include <fstream>
24 #include <unistd.h>
25 #include <glib.h>
26 #include "pwrlogger.h"
27 #include "mfrTypes.h"
28 #include "mfrMgr.h"
29 #include "productTraits.h"
30 #include "frontPanelIndicator.hpp"
31 
32 using namespace pwrMgrProductTraits;
33 extern bool isTVOperatingInFactory();
34 extern int _SetAVPortsPowerState(IARM_Bus_PWRMgr_PowerState_t powerState);
35 /*
36  Following profiles are supported:
37  * default-stb
38  * default-tv
39  * default-stb-eu
40  * default-tv-eu
41 */
42 const unsigned int REBOOT_REASON_RETRY_INTERVAL_SECONDS = 2;
43 ux_controller * ux_controller::singleton = nullptr;
44 static reboot_type_t getRebootType()
45 {
46  const char * file_updated_flag = "/tmp/Update_rebootInfo_invoked";
47  const char * reboot_info_file_name = "/opt/secure/reboot/previousreboot.info";
48  const char * hard_reboot_match_string = R"("reason":"POWER_ON_RESET")";
49  reboot_type_t ret = reboot_type_t::SOFT;
50 
51  //Check whether file has been updated first. If not, the data we read from the file is not valid.
52  if(0 != access(file_updated_flag, F_OK))
53  {
54  LOG("%s: Error! Reboot info file isn't updated yet.\n", __func__);
55  ret = reboot_type_t::UNAVAILABLE;
56  }
57  else
58  {
59  std::ifstream reboot_info_file(reboot_info_file_name);
60  std::string line;
61  if (true == reboot_info_file.is_open())
62  {
63  while(std::getline(reboot_info_file, line))
64  {
65  if(std::string::npos != line.find(hard_reboot_match_string))
66  {
67  LOG("%s: Detected hard reboot.\n", __func__);
68  ret = reboot_type_t::HARD;
69  break;
70  }
71  }
72  }
73  else
74  LOG("%s: Failed to open file\n", __func__);
75  }
76  return ret;
77 }
78 
79 static gboolean reboot_reason_cb(gpointer data)
80 {
81  static unsigned int count = 0;
82  constexpr unsigned int max_count = 120 / REBOOT_REASON_RETRY_INTERVAL_SECONDS; //Stop after 2 minutes.
83 
84  reboot_type_t reboot_type = getRebootType();
85  if(reboot_type_t::UNAVAILABLE == reboot_type)
86  {
87  if(max_count >= count++)
88  {
89  return G_SOURCE_CONTINUE;
90  }
91  else
92  {
93  LOG("%s: Exceeded retry limit.\n", __func__);
94  return G_SOURCE_REMOVE;
95  }
96  }
97  else
98  {
99  LOG("%s: Got reboot reason in async check. Applying display configuration.\n", __func__);
100  ux_controller * ptr = static_cast <ux_controller *> (data);
101  ptr->sync_display_ports_with_reboot_reason(reboot_type);
102  return G_SOURCE_REMOVE;
103  }
104 }
105 
106 static inline bool doForceDisplayOnPostReboot() //Note: only to be used when the power state before reboot was ON.
107 {
108  const char * flag_filename = "/opt/force_display_on_after_reboot";
109  bool ret = false;
110  if(0 == access(flag_filename, F_OK))
111  ret = true;
112  LOG("%s: %s\n", __func__, (true == ret ? "true" : "false"));
113  return ret;
114 }
115 
116 namespace pwrMgrProductTraits
117 {
118 
119 /********************************* Begin base class definitions ********************************/
120  bool ux_controller::set_bootloader_pattern(mfrBlPattern_t pattern)
121  {
122  mutex.lock();
123  invalidateAsyncBootloaderPattern = true;
124  mutex.unlock();
125  return _set_bootloader_pattern(pattern);
126  }
127 
128  bool ux_controller::_set_bootloader_pattern(mfrBlPattern_t pattern) const
129  {
130  bool ret = true;
131 
132  if (false == enableSilentRebootSupport)
133  return true; // No-op on platforms that don't support it. Not logged was a warning/error as this is normal for many devices.
134 
136  mfrparam.pattern = pattern;
137  if (IARM_RESULT_SUCCESS != IARM_Bus_Call(IARM_BUS_MFRLIB_NAME, IARM_BUS_MFRLIB_API_SetBootLoaderPattern, (void *)&mfrparam, sizeof(mfrparam)))
138  {
139  LOG("Warning! Call to IARM_BUS_MFRLIB_API_SetBootLoaderPattern failed.\n");
140  ret = false;
141  }
142  else
143  {
144  LOG("%s: successfully set pattern %d\n", __func__, (int) pattern);
145  }
146  return ret;
147  }
148  void ux_controller::_set_bootloader_pattern_async(mfrBlPattern_t pattern) const
149  {
150  bool ret = true;
151  const unsigned int retry_interval_seconds = 5;
152  unsigned int remaining_retries = 12; //Give up after spending 1 minute trying to set pattern.
153  LOG("%s start for pattern 0x%x\n", __func__, pattern);
154  do
155  {
156  std::this_thread::sleep_for(std::chrono::seconds(retry_interval_seconds));
157  std::unique_lock <std::mutex> lock (mutex);
158  if(false == invalidateAsyncBootloaderPattern)
159  {
160  ret = _set_bootloader_pattern(pattern);
161  }
162  else
163  {
164  LOG("%s: bootloader pattern invalidated. Aborting.\n", __func__);
165  break;
166  }
167 
168  } while ((false == ret) && (0 < --remaining_retries));
169 
170 
171  LOG("%s returns.\n", __func__);
172  }
173 
174  bool ux_controller::set_bootloader_pattern_fault_tolerant(mfrBlPattern_t pattern) //Handy when you suspect that mfrmgr isn't up yet and may need retries to make this work.
175  {
176  /* Note: this function is only meant to be used once, and that too immediately after a reboot, when setting bootloader pattern for the first time. It is not meant to
177  be invoked more than once and is not safe for use in such a manner; it can be race prone. */
178  bool ret = true;
179  ret = _set_bootloader_pattern(pattern);
180  if(false == ret)
181  {
182  //Failed to set bootloader pattern. This could be because mfrmgr isn't up yet. Fork a thread and retry repeatedly for a while.
183  mutex.lock();
184  invalidateAsyncBootloaderPattern = false;
185  mutex.unlock();
186  std::thread retry_thread(&ux_controller::_set_bootloader_pattern_async, this, pattern);
187  retry_thread.detach();
188  }
189  return ret;
190  }
191 
192  ux_controller::ux_controller(unsigned int in_id, const std::string &in_name, deviceType_t in_deviceType) : id(in_id), name(in_name), deviceType(in_deviceType)
193  {
194  LOG("%s: initializing for profile id %d, name %s\n", __func__, id, name.c_str());
195  initialize_safe_defaults();
196  }
197 
198  void ux_controller::initialize_safe_defaults()
199  {
200  enableMultiColourLedSupport = false;
201  enableSilentRebootSupport = true;
202  preferedPowerModeOnReboot = POWER_MODE_LAST_KNOWN;
203  invalidateAsyncBootloaderPattern = false;
204  firstPowerTransitionComplete = false;
205 
206  if (DEVICE_TYPE_STB == deviceType)
207  {
208  ledEnabledInStandby = false;
209  ledEnabledInOnState = true;
210  }
211  else
212  {
213  ledEnabledInStandby = true;
214  ledEnabledInOnState = true;
215  }
216  }
217 
218  void ux_controller::sync_power_led_with_power_state(IARM_Bus_PWRMgr_PowerState_t power_state) const
219  {
220  if (true == enableMultiColourLedSupport)
221  {
222  LOG("Warning! Device supports multi-colour LEDs but it isn't handled.");
223  }
224 
225  bool led_state;
226  if (IARM_BUS_PWRMGR_POWERSTATE_ON == power_state)
227  led_state = ledEnabledInOnState;
228  else
229  led_state = ledEnabledInStandby;
230 
231  try
232  {
233  LOG("%s: setting power LED State to %s\n", __func__, (led_state ? "ON" : "FALSE"));
235  }
236  catch (...)
237  {
238  LOG("%s: Warning! exception caught when trying to change FP state\n", __func__);
239  }
240  }
241 
242  void ux_controller::sync_display_ports_with_power_state(IARM_Bus_PWRMgr_PowerState_t power_state) const
243  {
244  _SetAVPortsPowerState(power_state);
245  }
246  bool ux_controller::initialize_ux_controller(unsigned int profile_id) // Not thread-safe
247  {
248  bool ret = true;
249  switch(profile_id)
250  {
251  case DEFAULT_STB_PROFILE:
252  singleton = new ux_controller_stb(profile_id, "default-stb");
253  break;
254 
255  case DEFAULT_TV_PROFILE:
256  singleton = new ux_controller_tv(profile_id, "default-tv");
257  break;
258 
259  case DEFAULT_STB_PROFILE_EUROPE:
260  singleton = new ux_controller_stb_eu(profile_id, "default-stb-eu");
261  break;
262 
263  case DEFAULT_TV_PROFILE_EUROPE:
264  singleton = new ux_controller_tv_eu(profile_id, "default-tv-eu");
265  break;
266 
267  default:
268  LOG("Error! Unsupported product profile id %d\n", profile_id);
269  ret = false;
270  }
271  return ret;
272  }
273 
274  ux_controller * ux_controller::get_instance() //Not thread-safe.
275  {
276  return singleton;
277  }
278 /********************************* End base class definitions ********************************/
279 
280 
281 
282 
283 /********************************* Begin ux_controller_tv_eu class definitions ********************************/
284 
285 
286  ux_controller_tv_eu::ux_controller_tv_eu(unsigned int in_id, const std::string &in_name) : ux_controller(in_id, in_name, DEVICE_TYPE_TV)
287  {
288  preferedPowerModeOnReboot = POWER_MODE_LIGHT_SLEEP;
289  }
290 
291  bool ux_controller_tv_eu::applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
292  {
293  bool ret = true;
294  sync_display_ports_with_power_state(new_state);
295  ret = set_bootloader_pattern((IARM_BUS_PWRMGR_POWERSTATE_ON == new_state ? mfrBL_PATTERN_NORMAL : mfrBL_PATTERN_SILENT_LED_ON));
296  return ret;
297  }
298 
299  bool ux_controller_tv_eu::applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state) const
300  {
301  return true;
302  }
303  bool ux_controller_tv_eu::applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
304  {
305  bool ret = true;
306  if (IARM_BUS_PWRMGR_POWERSTATE_ON != current_state) // Silent reboot only applies if maintenance reboot is triggered while TV is in one of the standby states.
307  {
308  ret = set_bootloader_pattern(mfrBL_PATTERN_SILENT);
309  }
310  return ret;
311  }
312 
313  bool ux_controller_tv_eu::applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t target_state, IARM_Bus_PWRMgr_PowerState_t last_known_state /*last knnown power state from previous power cycle*/)
314  {
315  bool ret = true;
316  /* Note: the product requires a special LED pattern that's set by bootloader/kernel as it boots. Since power manager
317  doesn't support any fancy patterns yet, skip setting the LED configuration here so that we retain the boot pattern
318  until app takes over. */
319  if ((IARM_BUS_PWRMGR_POWERSTATE_ON == last_known_state) && (IARM_BUS_PWRMGR_POWERSTATE_STANDBY == target_state))
320  {
321  /* Special handling. Although the new power state is standby, leave display enabled. App will transition TV to ON state immediately afterwards anyway,
322  and if we turn off the display to match standby state here, it'll confuse the user into thinking that TV has gone into standby for good. */
323  sync_display_ports_with_power_state(IARM_BUS_PWRMGR_POWERSTATE_ON);
324  }
325  else
326  {
327  sync_display_ports_with_power_state(target_state);
328  }
329 
330  /* Reset applicable 'silent reboot' flags to appropriate values.
331  This device is booting into 'target_state' power state. Sync the bootloader flags to match the this state. That means, if the new state is ON,
332  set up BL display and LED flags to match ON state. If the new state is STANDBY, set up BL and LED flags to match STANDBY state.
333  */
334  mfrBlPattern_t pattern = mfrBL_PATTERN_NORMAL;
335  switch (target_state)
336  {
337  case IARM_BUS_PWRMGR_POWERSTATE_ON:
338  //Do nothing. Pattern is already set to normal.
339  break;
340 
341  case IARM_BUS_PWRMGR_POWERSTATE_STANDBY: //deliberate fall-through
342  case IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP: //deliberate fall-through
343  case IARM_BUS_PWRMGR_POWERSTATE_STANDBY_DEEP_SLEEP:
344  pattern = mfrBL_PATTERN_SILENT_LED_ON;
345  break;
346  default:
347  LOG("%s: Warning! Unhandled power transition. New state: %d\n", __func__, target_state);
348  break;
349  }
350  ret = set_bootloader_pattern_fault_tolerant(pattern);
351  return ret;
352  }
353 
354  IARM_Bus_PWRMgr_PowerState_t ux_controller_tv_eu::getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state) const
355  {
356  return IARM_BUS_PWRMGR_POWERSTATE_STANDBY;
357  }
358 
359 /********************************* End ux_controller_tv_eu class definitions ********************************/
360 
361 
362 
363 /********************************* Begin ux_controller_stb_eu class definitions ********************************/
364  ux_controller_stb_eu::ux_controller_stb_eu(unsigned int in_id, const std::string &in_name) : ux_controller(in_id, in_name, DEVICE_TYPE_STB)
365  {
366  preferedPowerModeOnReboot = POWER_MODE_LIGHT_SLEEP;
367  }
368 
369  bool ux_controller_stb_eu::applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
370  {
371  sync_display_ports_with_power_state(new_state);
372  sync_power_led_with_power_state(new_state);
373  return true;
374  }
375 
376  bool ux_controller_stb_eu::applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state) const
377  {
378  return true; //No-op
379  }
380  bool ux_controller_stb_eu::applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
381  {
382  bool ret = true;
383  if (IARM_BUS_PWRMGR_POWERSTATE_ON != current_state) // Silent reboot only applies if maintenance reboot is triggered while STB is in one of the standby states.
384  {
385  ret = set_bootloader_pattern(mfrBL_PATTERN_SILENT);
386  }
387  return ret;
388  }
389 
390  bool ux_controller_stb_eu::applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t target_state, IARM_Bus_PWRMgr_PowerState_t last_known_state /*last knnown power state from previous power cycle*/)
391  {
392  bool ret = true;
393  if ((IARM_BUS_PWRMGR_POWERSTATE_ON == last_known_state) && (IARM_BUS_PWRMGR_POWERSTATE_STANDBY == target_state))
394  {
395  //Special handling. Although the new power state is standby, leave display and LED enabled.
396  sync_power_led_with_power_state(IARM_BUS_PWRMGR_POWERSTATE_ON);
397  sync_display_ports_with_power_state(IARM_BUS_PWRMGR_POWERSTATE_ON);
398  }
399  else
400  {
401  sync_power_led_with_power_state(target_state);
402  sync_display_ports_with_power_state(target_state);
403  }
404 
405  /* Reset applicable 'silent reboot' flags to appropriate values.*/
406  ret = set_bootloader_pattern_fault_tolerant(mfrBL_PATTERN_NORMAL);
407  return ret;
408  }
409 
410  IARM_Bus_PWRMgr_PowerState_t ux_controller_stb_eu::getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state) const
411  {
412  return IARM_BUS_PWRMGR_POWERSTATE_STANDBY;
413  }
414 /********************************* End ux_controller_stb_eu class definitions ********************************/
415 
416 
417 
418 /********************************* Begin ux_controller_tv class definitions ********************************/
419  ux_controller_tv::ux_controller_tv(unsigned int in_id, const std::string &in_name) : ux_controller(in_id, in_name, DEVICE_TYPE_TV)
420  {
421  preferedPowerModeOnReboot = POWER_MODE_LIGHT_SLEEP;
422  }
423 
424  bool ux_controller_tv::applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
425  {
426  mutex.lock();
427  if(false == firstPowerTransitionComplete)
428  firstPowerTransitionComplete = true; //In case we're still polling for reboot reason to turn on/off display, this will effectively cancel that job.
429  //The new power state takes precedence.
430  mutex.unlock();
431 
432  sync_display_ports_with_power_state(new_state);
433  bool ret = set_bootloader_pattern((IARM_BUS_PWRMGR_POWERSTATE_ON == new_state ? mfrBL_PATTERN_NORMAL : mfrBL_PATTERN_SILENT_LED_ON));
434  return ret;
435  }
436 
437  bool ux_controller_tv::applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state) const
438  {
439  return true;
440  }
441  bool ux_controller_tv::applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
442  {
443  bool ret = true;
444  if (IARM_BUS_PWRMGR_POWERSTATE_ON != current_state) // Silent reboot only applies if maintenance reboot is triggered while TV is in one of the standby states.
445  {
446  ret = set_bootloader_pattern(mfrBL_PATTERN_SILENT_LED_ON);
447  }
448  return ret;
449  }
450 
451  bool ux_controller_tv::applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t target_state, IARM_Bus_PWRMgr_PowerState_t last_known_state /*last knnown power state from previous power cycle*/)
452  {
453  bool ret = true;
454  sync_power_led_with_power_state(target_state);
455 
456  if ((IARM_BUS_PWRMGR_POWERSTATE_ON == last_known_state) && (IARM_BUS_PWRMGR_POWERSTATE_STANDBY == target_state))
457  {
458  /* Special handling:
459  Although the new power state is standby, leave display enabled. If last known power state is ON, app will transition TV to ON state
460  immediately afterwards anyway, so if we turn off the display to match standby state here, it'll confuse the user into thinking that TV has gone into
461  standby for good.
462 
463  An exception to this criteria is if we just got here after a hard reboot. In that case, the product requirement is to go straight to standby
464  and stay there. Therefore we won't turn on the display here. This is to account for use cases where there is a power failure and power is restored
465  when user is away - in that scenario, we assume that there is no audience and keep the TV in standby.
466 
467  Important: The above behaviour can be a nuisance during production or testing as it can lead to the TV going dark during various production/QA stages immediately
468  after a hard reboot. Use isTVOperatingInFactory() and doForceDisplayOnPostReboot() to detect those scenarios and act accordingly.
469  */
470  if(true == doForceDisplayOnPostReboot() || (true == isTVOperatingInFactory()))
471  sync_display_ports_with_power_state(IARM_BUS_PWRMGR_POWERSTATE_ON);
472  else
473  {
474  reboot_type_t isHardReboot = getRebootType();
475  switch (isHardReboot)
476  {
477  case reboot_type_t::HARD:
478  sync_display_ports_with_power_state(IARM_BUS_PWRMGR_POWERSTATE_STANDBY);
479  break;
480 
481  case reboot_type_t::SOFT:
482  sync_display_ports_with_power_state(IARM_BUS_PWRMGR_POWERSTATE_ON);
483  break;
484 
485  default: //Unavailable. Take no action now, but keep checking every N seconds.
486  g_timeout_add_seconds(REBOOT_REASON_RETRY_INTERVAL_SECONDS, reboot_reason_cb, this);
487  break;
488  }
489  }
490  }
491  else
492  {
493  sync_display_ports_with_power_state(target_state);
494  }
495 
496  /* Reset applicable 'silent reboot' flags to appropriate values.
497  This device is booting into 'target_state' power state. Sync the bootloader flags to match the this state. That means, if the new state is ON,
498  set up BL display and LED flags to match ON state. If the new state is STANDBY, set up BL and LED flags to match STANDBY state.
499  */
500  mfrBlPattern_t pattern = mfrBL_PATTERN_NORMAL;
501  switch (target_state)
502  {
503  case IARM_BUS_PWRMGR_POWERSTATE_ON:
504  //Do nothing. Pattern is already set to normal.
505  break;
506 
507  case IARM_BUS_PWRMGR_POWERSTATE_STANDBY: //deliberate fall-through
508  case IARM_BUS_PWRMGR_POWERSTATE_STANDBY_LIGHT_SLEEP: //deliberate fall-through
509  case IARM_BUS_PWRMGR_POWERSTATE_STANDBY_DEEP_SLEEP:
510  pattern = mfrBL_PATTERN_SILENT_LED_ON;
511  break;
512  default:
513  LOG("%s: Warning! Unhandled power transition. New state: %d\n", __func__, target_state);
514  break;
515  }
516  ret = set_bootloader_pattern_fault_tolerant(pattern);
517  return ret;
518  }
519 
520  IARM_Bus_PWRMgr_PowerState_t ux_controller_tv::getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state) const
521  {
522  return IARM_BUS_PWRMGR_POWERSTATE_STANDBY;
523  }
524 
525  void ux_controller_tv::sync_display_ports_with_reboot_reason(reboot_type_t reboot_type)
526  {
527  // Assumes the TV is rebooting from ON state to STANDBY state.
528  mutex.lock();
529  if(false == firstPowerTransitionComplete)
530  {
531  mutex.unlock();
532  sync_display_ports_with_power_state(reboot_type_t::HARD == reboot_type? IARM_BUS_PWRMGR_POWERSTATE_STANDBY : IARM_BUS_PWRMGR_POWERSTATE_ON);
533  }
534  else // Do nothing, as we're already past the first power transition and display configuration has already been set as appropriate.
535  mutex.unlock();
536  }
537 /********************************* End ux_controller_tv class definitions ********************************/
538 
539 
540 
541 /********************************* Begin ux_controller_stb class definitions ********************************/
542  ux_controller_stb::ux_controller_stb(unsigned int in_id, const std::string &in_name) : ux_controller(in_id, in_name, DEVICE_TYPE_STB)
543  {
544  preferedPowerModeOnReboot = POWER_MODE_LAST_KNOWN;
545  enableSilentRebootSupport = false;
546  }
547 
548  bool ux_controller_stb::applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
549  {
550  sync_display_ports_with_power_state(new_state);
551  sync_power_led_with_power_state(new_state);
552  return true;
553  }
554 
555  bool ux_controller_stb::applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state) const
556  {
557  return true; //No-op
558  }
559  bool ux_controller_stb::applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
560  {
561  bool ret = true;
562  return ret;
563  }
564 
565  bool ux_controller_stb::applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t target_state, IARM_Bus_PWRMgr_PowerState_t last_known_state /*last knnown power state from previous power cycle*/)
566  {
567  bool ret = true;
568  sync_power_led_with_power_state(target_state);
569  sync_display_ports_with_power_state(target_state);
570  return ret;
571  }
572 
573  IARM_Bus_PWRMgr_PowerState_t ux_controller_stb::getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state) const
574  {
575  return prev_state;
576  }
577 
578 /********************************* End ux_controller_stb class definitions ********************************/
579 
580 
581 }
pwrMgrProductTraits::ux_controller
Definition: productTraits.h:72
_IARM_Bus_MFRLib_SetBLPattern_Param_t
Definition: mfrMgr.h:149
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57
frontPanelIndicator.hpp
Structures and classes for front panel indicator are defined here.
pwrMgrProductTraits::ux_controller_tv
Definition: productTraits.h:141
pwrMgrProductTraits::ux_controller_stb
Definition: productTraits.h:153
pwrMgrProductTraits::ux_controller_stb_eu
Definition: productTraits.h:130
pwrMgrProductTraits::ux_controller_tv_eu
Definition: productTraits.h:119
IARM_BUS_MFRLIB_API_SetBootLoaderPattern
#define IARM_BUS_MFRLIB_API_SetBootLoaderPattern
Definition: mfrMgr.h:109
device::FrontPanelIndicator::getInstance
static FrontPanelIndicator & getInstance(int id)
This function gets the FrontPanelIndicator instance corresponding to the id parameter,...
Definition: frontPanelIndicator.cpp:208
IARM_BUS_MFRLIB_NAME
#define IARM_BUS_MFRLIB_NAME
Definition: mfrMgr.h:98
device::FrontPanelIndicator::setState
void setState(const bool &enable)
This API is used to enable or disable the front panel indicator.
Definition: frontPanelIndicator.cpp:350