RDK Documentation (Open Sourced RDK Components)
getFPBrightness.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 "frontPanelIndicator.hpp"
34 #include "manager.hpp"
35 #include "exception.hpp"
36 
37 
38 #include "libIBus.h"
39 
40 
41 int main(int argc, char *argv[])
42 {
43 
44  IARM_Bus_Init("SampleDSClient");
46 
48 
49 
50  if (argc != 2) {
51  printf("%s : <Indicator - Message|Power|Record|Remote|RfByPass>\n", argv[0]);
52  return 0;
53  }
54  char *pIndicatorName = argv[1];
55 
56  try {
57  printf("Sample Application: get FrontPanel brightness\n");
58  int bright = device::FrontPanelIndicator::getInstance(pIndicatorName).getBrightness();
59  printf("Sample Application: brightness is %d\n", bright);
60  }
61  catch (...) {
62  printf("Exception Caught during [%s]\r\n", argv[0]);
63  }
64 
66 
67  sleep(1);
69  IARM_Bus_Term();
70  sleep(1);
71  return 0;
72 }
73 
74 
75 /** @} */
76 /** @} */
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
manager.hpp
It contains class referenced by manager.cpp file.
frontPanelIndicator.hpp
Structures and classes for front panel indicator are defined here.
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.
device::FrontPanelIndicator::getInstance
static FrontPanelIndicator & getInstance(int id)
This function gets the FrontPanelIndicator instance corresponding to the id parameter,...
Definition: frontPanelIndicator.cpp:208
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::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