RDK Documentation (Open Sourced RDK Components)
testFrontPanel.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 // TODO: Include your class to test here.
21 
22 
23 /**
24 * @defgroup devicesettings
25 * @{
26 * @defgroup sample
27 * @{
28 **/
29 
30 
31 #include <unistd.h>
32 #include <iostream>
33 #include <stdlib.h>
34 #include "manager.hpp"
35 
36 #include "frontPanelConfig.hpp"
37 #include <stdlib.h>
38 
39 
40 #include "libIBus.h"
41 
42 
43 
44 
45 int main(int argc, char *argv[])
46 {
47 
48  int i = 0;
49 
50  IARM_Bus_Init("SampleDSClient");
52 
54 
55  if (argc != 2) {
56  printf("%s : <Text Message [3 Chars]>\n", argv[0]);
57  return 0;
58  }
59  char *Message = argv[1];
60 
62  printf("Power : brightness is %d\n",bright);
64  printf("Message : brightness is %d\n",bright);
66  printf("Record : brightness is %d\n",bright);
68  printf("RfByPass : brightness is %d\n",bright);
70  printf("Text : brightness is %d\n",bright);
71 
72  sleep(20);
73 
79 
80  sleep(20);
81 
83  printf("Power : brightness is %d\n",bright);
85  printf("Message : brightness is %d\n",bright);
87  printf("Record : brightness is %d\n",bright);
89  printf("RfByPass : brightness is %d\n",bright);
91  printf("Text : brightness is %d\n",bright);
92 
93  try {
94  printf("Sample Application: set text display------- %s\n",Message);
96 
97  for (i=10;i < 100 ; )
98  {
99  printf("Sample Application: set text brightness------- %d\n",i);
102  i = i+ 10;
103  sleep(10);
104  }
105 
107  printf("Power : brightness is %d\n",bright);
109  printf("Message : brightness is %d\n",bright);
111  printf("Record : brightness is %d\n",bright);
113  printf("RfByPass : brightness is %d\n",bright);
115  printf("Text : brightness is %d\n",bright);
116  }
117  catch (...) {
118  printf("Exception Caught during [%s]\r\n", argv[0]);
119  }
120 
122 
123 
125  IARM_Bus_Term();
126 
127  return 0;
128 }
129 
130 
131 /** @} */
132 /** @} */
device::FrontPanelTextDisplay::setTextBrightness
void setTextBrightness(const int &brightness)
This API sets the brightness value for the front panel LED.
Definition: frontPanelTextDisplay.cpp:221
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
device::FrontPanelConfig::getTextDisplay
FrontPanelTextDisplay & getTextDisplay(int id)
This function gets the FrontPanelTextDisplay instance corresponding to the specified id,...
Definition: frontPanelConfig.cpp:224
device::FrontPanelConfig::getInstance
static FrontPanelConfig & getInstance()
This API gets the instance of the FrontPanelConfig. When called for the first time,...
Definition: frontPanelConfig.cpp:82
manager.hpp
It contains class referenced by manager.cpp file.
device::FrontPanelIndicator::setBrightness
void setBrightness(const int &brightness, const bool toPersist=true)
This API sets the brightness or intensity of the front panel indicators.
Definition: frontPanelIndicator.cpp:306
IARM_Bus_Disconnect
IARM_Result_t IARM_Bus_Disconnect(void)
This API disconnect Application from IARM Bus so the application will not receive any IARM event or R...
device::Manager::Initialize
static void Initialize()
This API is used to initialize the Device Setting module. Each API should be called by any client of ...
Definition: manager.cpp:97
libIBus.h
RDK IARM-Bus API Declarations.
frontPanelConfig.hpp
Structures and classes to manage front panel are defined here.
device::FrontPanelConfig::getIndicator
FrontPanelIndicator & getIndicator(int id)
This function gets an instance of the FrontPanelndicator with the specified id, only if the id passed...
Definition: frontPanelConfig.cpp:147
device::FrontPanelTextDisplay::setText
void setText(const std::string &text)
This API sets the text LED display, by switching the text display to text mode.
Definition: frontPanelTextDisplay.cpp:187
device::Manager::DeInitialize
static void DeInitialize()
This API is used to deinitialize the device settings module. DeInitialize() must be called to release...
Definition: manager.cpp:138
IARM_Bus_Connect
IARM_Result_t IARM_Bus_Connect(void)
This API is used to connect application to the IARM bus daemon. After connected, the application can ...
Definition: iarmMgrMocks.cpp:33
device::FrontPanelTextDisplay::getTextBrightness
int getTextBrightness()
This API gets the text LED brightness value.
Definition: frontPanelTextDisplay.cpp:240
device::FrontPanelIndicator::getBrightness
int getBrightness()
This API gets the brightness of the specified LED indicators.
Definition: frontPanelIndicator.cpp:374
IARM_Bus_Init
IARM_Result_t IARM_Bus_Init(const char *name)
This API is used to initialize the IARM-Bus library.
Definition: iarmMgrMocks.cpp:38