RDK Documentation (Open Sourced RDK Components)
getDisplayAttributes.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 
21 /**
22 * @defgroup devicesettings
23 * @{
24 * @defgroup sample
25 * @{
26 **/
27 
28 
29  #include <stdint.h>
30 #include <iostream>
31 #include "host.hpp"
32 #include "videoOutputPort.hpp"
33 #include "videoOutputPortType.hpp"
34 #include "videoResolution.hpp"
35 #include "manager.hpp"
36 
37 #include "dsUtl.h"
38 #include "dsError.h"
39 #include "list.hpp"
40 
41 
42 #include "libIBus.h"
43 
44 
45 
46 int main(int argc, char *argv[])
47 {
48 
49  uint8_t physicalAddressA=1,physicalAddressB=0,physicalAddressC =0,physicalAddressD=0;
50 
51  IARM_Bus_Init("SampleDSClient");
53 
55 
57 
58  if (vPort.isDisplayConnected()) {
59 
60  printf("\t Display [%s] connected\r\n", vPort.isDisplayConnected() ? "is" : "is NOT");
61 
62  printf("\t Display has AspectRatio [%s]\r\n", vPort.getDisplay().getAspectRatio().getName().c_str());
63 
64  printf("\t Display has EDID [week=%d, year=%d, pcode=0x%x, pserial=0x%x]\r\n",
67  vPort.getDisplay().getProductCode(),
68  vPort.getDisplay().getSerialNumber());
69 
70  printf("\t Display Connected Device is [%s]\r\n", vPort.getDisplay().getConnectedDeviceType() ? "HDMI" : "DVI");
71  vPort.getDisplay().getPhysicallAddress(physicalAddressA,physicalAddressB,physicalAddressC,physicalAddressD);
72  printf("Physical Addres is %d.%d.%d.%d \r\n", physicalAddressA,physicalAddressB,physicalAddressC,physicalAddressD);
73 
74 
75 
76  }
77  else
78  {
79  printf("\t Display [%s] connected\r\n", vPort.isDisplayConnected() ? "is" : "is NOT");
80  }
81 
84  IARM_Bus_Term();
85 
86  return 0;
87 }
88 
89 
90 /** @} */
91 /** @} */
device::VideoOutputPort::Display::getManufacturerYear
int getManufacturerYear() const
This function returns the year of manufacture of the EDID video display device.
Definition: videoOutputPort.hpp:135
device::VideoOutputPort::Display::getConnectedDeviceType
int getConnectedDeviceType() const
This function returns the device type of the EDID video display device.
Definition: videoOutputPort.hpp:155
device::VideoOutputPort::Display::getPhysicallAddress
void getPhysicallAddress(uint8_t &physicalAddressA, uint8_t &physicalAddressB, uint8_t &physicalAddressC, uint8_t &physicalAddressD) const
This function gets the physical address of the HDMI node of the video display device.
Definition: videoOutputPort.hpp:196
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
device::VideoOutputPort::Display::getAspectRatio
const AspectRatio & getAspectRatio() const
This function returns the instance of the aspect ratio that is used currently in connected display de...
Definition: videoOutputPort.hpp:182
device::VideoOutputPort::isDisplayConnected
bool isDisplayConnected() const
This API is used to Check if the port is currently connected to any display device.
Definition: videoOutputPort.cpp:381
device::VideoOutputPort
Class extending enumerable to implement the videoooutputport interface.
Definition: videoOutputPort.hpp:59
manager.hpp
It contains class referenced by manager.cpp file.
dsError.h
Device Settings HAL error codes.
dsUtl.h
Device Settings HAL utilities.
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...
videoOutputPortType.hpp
It contains structures and class referenced by the videoOutputportTypes.cpp file.
device::VideoOutputPort::getDisplay
const VideoOutputPort::Display & getDisplay()
This API is used to get the display device information currently connected to the output port....
Definition: videoOutputPort.cpp:328
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
videoResolution.hpp
It contains class and structure refrenced by the videoResolution.cpp file.
libIBus.h
RDK IARM-Bus API Declarations.
device::DSConstant::getName
virtual const std::string & getName() const
This function is used to the get the data member name.
Definition: dsConstant.hpp:141
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
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
device::Host::getVideoOutputPort
VideoOutputPort & getVideoOutputPort(const std::string &name)
This API is used to get the reference to the video output port by its name. The name of the port must...
Definition: host.cpp:350
device::Host::getInstance
static Host & getInstance(void)
This API is used to get a reference to the single instance of the Host object.
Definition: host.cpp:88
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::VideoOutputPort::Display::getProductCode
int getProductCode() const
This function returns the product code of the EDID video display device.
Definition: videoOutputPort.hpp:117
device::VideoOutputPort::Display::getSerialNumber
int getSerialNumber() const
This function returns the serial number of the EDID video display device.
Definition: videoOutputPort.hpp:126
device::VideoOutputPort::Display::getManufacturerWeek
int getManufacturerWeek() const
This function returns the week of manufacture of the EDID video display device.
Definition: videoOutputPort.hpp:144
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