|
RDK Documentation (Open Sourced RDK Components)
|
Go to the documentation of this file.
41 #include "illegalArgumentException.hpp"
51 std::string numberToString (
int number)
58 int stringToNumber (std::string text)
61 stringstream convert (text);
63 if (!(convert >> number) )
71 const char *_colorNames[] = {
80 const int _colorsValues[] = {
89 inline const bool isColorValid(
int id) {
90 return ((
id >= 0) && (
id <
dsUTL_DIM(_colorNames)));
93 const char *_indicatorNames[] = {
103 inline const bool isIndicatorValid(
int id) {
111 typedef int _SafetyCheck[(
dsUTL_DIM(_indicatorNames) == dsFPD_INDICATOR_MAX) ? 1 : -1];
127 const int FrontPanelIndicator::kMax = dsFPD_INDICATOR_MAX;
147 if (::isColorValid(
id)) {
148 return FrontPanelConfig::getInstance().getColor(
id);
169 for (
size_t i = 0; i <
dsUTL_DIM(_colorNames); i++) {
170 if (name.compare(_colorNames[i]) == 0) {
171 return FrontPanelConfig::getInstance().getColor(i);
177 FrontPanelIndicator::Color::Color(
int id)
180 if (::isColorValid(
id)) {
182 _name = std::string(_colorNames[
id]);
202 FrontPanelIndicator::Blink::Blink(
int interval,
int iteration)
204 if(interval < 0 || iteration < 0)
206 _interval = interval;
207 _iteration = iteration;
224 if (::isIndicatorValid(
id)) {
225 return FrontPanelConfig::getInstance().getIndicator(
id);
228 throw IllegalArgumentException(
"Bad front panel indicator id");
249 for (
size_t i = 0; i <
dsUTL_DIM(_indicatorNames); i++) {
250 if (name.compare(_indicatorNames[i]) == 0) {
251 return FrontPanelConfig::getInstance().getIndicator(i);
272 FrontPanelIndicator::FrontPanelIndicator(
int id,
int maxBrightness,
int maxCycleRate,
int levels ,
int colorMode):
273 _maxBrightness(maxBrightness), _maxCycleRate(maxCycleRate), _levels(levels),_colorMode(colorMode)
279 if (::isIndicatorValid(
id)) {
281 _name = std::string(_indicatorNames[
id]);
308 bool IsPersist = toPersist;
481 bool IsPersist = toPersist;
488 bool isValidColor =
false;
490 for (uint j = 0; j < supportedColors.size(); j++)
492 if( supportedColors.at(j).getId() == color.
getId())
500 throw IllegalArgumentException(
"Invalid color object");
503 dsFPDColor_t colorValue = _colorsValues[color.
getId()];
507 throw IllegalArgumentException(
"dsSetFPDColor failed");
525 bool IsPersist = toPersist;
526 bool isValidColor =
false;
int _id
Indicates the id of the instance inheriting this class.
int _maxBrightness
Indicates maximum brightness value for the FP indicators.
virtual ~FrontPanelIndicator()
This function is the default constructor for FrontPanelIndicator.
Blink _blink
A Blink instance to control blink iterations and intervals of the LED.
dsError_t dsSetFPState(dsFPDIndicator_t eIndicator, dsFPDState_t state)
This function will enable or disable the specified discrete LED on the front panel display.
static FrontPanelConfig & getInstance()
This API gets the instance of the FrontPanelConfig. When called for the first time,...
This class is implemented using templates and it is used to maintain a container with the list of sup...
void setColor(const Color &newColor, const bool toPersist=true)
This API sets the color of the front panel indicator.
void getBrightnessLevels(int &levels, int &min, int &max)
This function gets the maximum brightness, minimum brightness and the brightness level set for the fr...
List< FrontPanelIndicator::Color > getColors()
This API gets the list of colors supported by front panel indicators.
int getColorMode()
This function is used to get the color mode of the front panel indicator. The color mode is device sp...
Device Settings HAL types.
dsError_t dsGetFPState(dsFPDIndicator_t eIndicator, dsFPDState_t *state)
This function will Get the ON or OFF state of Specified LEDs.
dsError_t dsSetFPBlink(dsFPDIndicator_t eIndicator, unsigned int uBlinkDuration, unsigned int uBlinkIterations)
Set LED blinking mode.
int _state
Indicates the FP indicator is enabled if true.
uint32_t dsFPDBrightness_t
dsError_t dsSetFPDBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t eBrightness, bool toPersist)
This function will set the brightness of the specified discrete LED on the front panel display to the...
dsError_t dsGetFPBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t *pBrightness)
Get the brightness level for Front Panel Display LEDs.
dsError_t dsGetFPColor(dsFPDIndicator_t eIndicator, dsFPDColor_t *pColor)
Get LED color.
Structures and classes for front panel indicator are defined here.
void setBrightness(const int &brightness, const bool toPersist=true)
This API sets the brightness or intensity of the front panel indicators.
Device Settings HAL error codes.
#define dsFPD_COLOR_GREEN
void enable()
This function is used to indicate that the port or port attribute calling this function are enabled.
int getInterval() const
This API is used to get the blink intervals of front panel indicator.
#define dsFPD_INDICATOR_RECORD
#define dsFPD_INDICATOR_MESSAGE
int _brightness
Indicates the brightness of the LED indicator.
enum __dsFPDState_t dsFPDState_t
#define dsFPD_COLOR_YELLOW
const List< Color > getSupportedColors() const
This API gets the list of supported colors for front panel indicator.
#define dsFPDIndicator_isValid(t)
bool getState()
This API gets the State of the specified LED indicators.
Structures and classes to manage front panel are defined here.
std::string _name
Indicates the name string of the instance inheriting this class.
uint32_t getColor()
This API gets the color of the front panel indicator/LED.
void setBlink(const Blink &blink)
This API sets the blink iteration and blink interval for the LED.
#define dsFPD_COLOR_ORANGE
#define dsFPD_INDICATOR_REMOTE
int getIteration() const
This API is used to get the blink iterations of front panel indicator.
This class extends Exception class to manage unsupported operations in devicesettings.
int _levels
Indicates the brightness level.
This class handles exceptions occurring in DS module.
This class extents DSConstant to manage front panel indicators color, blink sequence and brightness.
int _colorMode
Indicates the color mode of the LED indicator (single or multicolor mode).
This class extends Exception class to manage the expections caused due to illegal arguments.
dsError_t dsSetFPDColor(dsFPDIndicator_t eIndicator, dsFPDColor_t eColor, bool toPersist)
This function sets the color of the specified LED on the front panel in multi-app mode using iarmbus ...
#define dsFPD_INDICATOR_RFBYPASS
#define dsUTL_DIM(arr)
Device Settings general Array dimension calculation inline definition.
This file defines UnsupportedOperationException class.
int getBrightness()
This API gets the brightness of the specified LED indicators.
dsError_t
Device Settings API Error return codes.
#define dsFPD_COLOR_WHITE
void setState(const bool &enable)
This API is used to enable or disable the front panel indicator.
virtual int getId() const
This function is used to get the id.
uint32_t _color_rgb32
Indicates the color id of the LED.
#define dsFPD_INDICATOR_POWER