RDK Documentation (Open Sourced RDK Components)
setFPTextDisplay.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 <iostream>
32 #include <unistd.h>
33 #include <stdlib.h>
34 #include "manager.hpp"
35 
36 #include "frontPanelConfig.hpp"
38 #include <stdlib.h>
39 
40 
41 #include "libIBus.h"
42 
43 
44 
45 
46 int main(int argc, char *argv[])
47 {
48 
49  int i = 0;
50 
51  IARM_Bus_Init("SampleDSClient");
53 
55 
56  if (argc != 2) {
57  printf("%s : <Text Message [3 Chars]>\n", argv[0]);
58  return 0;
59  }
60  char *Message = argv[1];
61 
63  printf("Power : brightness is %d\n",bright);
65  printf("Message : brightness is %d\n",bright);
67  printf("Record : brightness is %d\n",bright);
69  printf("RfByPass : brightness is %d\n",bright);
71  printf("Text : brightness is %d\n",bright);
72 
73  sleep(20);
74 
80 
81  sleep(20);
82 
84  printf("Power : brightness is %d\n",bright);
86  printf("Message : brightness is %d\n",bright);
88  printf("Record : brightness is %d\n",bright);
90  printf("RfByPass : brightness is %d\n",bright);
92  printf("Text : brightness is %d\n",bright);
93 
94  try {
95  printf("Sample Application: set text display------- %s\n",Message);
97 
98  for (i=10;i < 100 ; )
99  {
100  printf("Sample Application: set text brightness------- %d\n",i);
103  i = i+ 10;
104  sleep(10);
105  }
106 
108  printf("Power : brightness is %d\n",bright);
110  printf("Message : brightness is %d\n",bright);
112  printf("Record : brightness is %d\n",bright);
114  printf("RfByPass : brightness is %d\n",bright);
116  printf("Text : brightness is %d\n",bright);
117  }
118  catch (...) {
119  printf("Exception Caught during [%s]\r\n", argv[0]);
120  }
121 
123 
124 
126  IARM_Bus_Term();
127 
128  return 0;
129 }
130 
131 
132 /** @} */
133 /** @} */
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
frontPanelTextDisplay.hpp
Classes and structures for front panel text display are defined here.
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