20 #ifndef _PRODUCT_TRAITS_
21 #define _PRODUCT_TRAITS_
26 #include "libIBusDaemon.h"
28 namespace pwrMgrProductTraits
37 DEFAULT_STB_PROFILE = 0,
39 DEFAULT_STB_PROFILE_EUROPE,
40 DEFAULT_TV_PROFILE_EUROPE,
54 POWER_MODE_LIGHT_SLEEP,
55 POWER_MODE_LAST_KNOWN,
56 POWER_MODE_UNSPECIFIED,
60 enum class reboot_type_t { HARD, SOFT, UNAVAILABLE};
77 deviceType_t deviceType;
78 bool invalidateAsyncBootloaderPattern;
79 bool firstPowerTransitionComplete;
80 mutable std::mutex mutex;
82 bool enableMultiColourLedSupport;
84 bool ledEnabledInStandby;
85 int ledColorInStandby;
87 bool ledEnabledInOnState;
88 int ledColorInOnState;
90 powerModeTrait_t preferedPowerModeOnReboot;
91 bool enableSilentRebootSupport;
95 void initialize_safe_defaults();
96 void sync_power_led_with_power_state(IARM_Bus_PWRMgr_PowerState_t state)
const;
97 inline void sync_display_ports_with_power_state(IARM_Bus_PWRMgr_PowerState_t state)
const;
98 bool _set_bootloader_pattern(mfrBlPattern_t pattern)
const;
99 void _set_bootloader_pattern_async(mfrBlPattern_t pattern)
const;
100 bool set_bootloader_pattern(mfrBlPattern_t pattern);
101 bool set_bootloader_pattern_fault_tolerant(mfrBlPattern_t pattern);
104 static bool initialize_ux_controller(
unsigned int profile_id);
106 ux_controller(
unsigned int in_id,
const std::string &in_name, deviceType_t in_device_type);
109 virtual bool applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state) {
return false;};
110 virtual bool applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
const {
return false;}
111 virtual bool applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state) {
return false;}
112 virtual bool applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state) {
return false;}
113 virtual IARM_Bus_PWRMgr_PowerState_t getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state)
const {
return prev_state;}
114 virtual void sync_display_ports_with_reboot_reason(reboot_type_t type) {};
123 virtual bool applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
124 virtual bool applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
const override;
125 virtual bool applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
override;
126 virtual bool applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
127 virtual IARM_Bus_PWRMgr_PowerState_t getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state)
const override;
134 virtual bool applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
135 virtual bool applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
const override;
136 virtual bool applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
override;
137 virtual bool applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
138 virtual IARM_Bus_PWRMgr_PowerState_t getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state)
const override;
145 virtual bool applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
146 virtual bool applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
const override;
147 virtual bool applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
override;
148 virtual bool applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
149 virtual IARM_Bus_PWRMgr_PowerState_t getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state)
const override;
150 virtual void sync_display_ports_with_reboot_reason(reboot_type_t type)
override;
157 virtual bool applyPowerStateChangeConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
158 virtual bool applyPreRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
const override;
159 virtual bool applyPreMaintenanceRebootConfig(IARM_Bus_PWRMgr_PowerState_t current_state)
override;
160 virtual bool applyPostRebootConfig(IARM_Bus_PWRMgr_PowerState_t new_state, IARM_Bus_PWRMgr_PowerState_t prev_state)
override;
161 virtual IARM_Bus_PWRMgr_PowerState_t getPreferredPostRebootPowerState(IARM_Bus_PWRMgr_PowerState_t prev_state)
const override;