RDK Documentation (Open Sourced RDK Components)
ms12ProfileTest.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 "videoOutputPort.hpp"
32 #include "videoOutputPortType.hpp"
33 #include "host.hpp"
34 #include "audioOutputPort.hpp"
35 #include "dsUtl.h"
36 #include "dsError.h"
37 #include "stdlib.h"
38 #include "manager.hpp"
39 
40 
41 
42 #include "libIBus.h"
43 
44 
45 #include <string>
46 
47 
48 
49 int main(int argc, char *argv[])
50 {
51 
52  IARM_Bus_Init("SampleDSClient");
54 
56 
57 
58  if (argc != 4) {
59  printf("%s : <Port Type - HDMI, SPEAKER> <Port Number-0, 1, 2...> <Profile Name to configure>\r\n", argv[0]);
60  return 0;
61  }
62 
63  char *portType = argv[1];
64  char *portId = argv[2];
65  std::string profileSet = argv[3];
66  std::vector<std::string> list;
67 
68  try {
69  printf("Sample Application: Get Audio profile List \r\n");
70  device::AudioOutputPort aPort = device::Host::getInstance().getAudioOutputPort(std::string(portType).append(portId));
71  list = aPort.getMS12AudioProfileList();
72  for(int i=0; i<list.size(); i++) {
73  printf("Profile[%d]: %s \n",i+1,list.at(i).c_str());
74  }
75 
76  printf("Current configured profile: %s\n",aPort.getMS12AudioProfile().c_str());
77  printf("Configure new profile : %s\n",profileSet.c_str());
78  aPort.setMS12AudioProfile(profileSet);
79  printf("(Check) Configured profile after set: %s\n",aPort.getMS12AudioProfile().c_str());
80  }
81  catch (...) {
82  printf("Exception Caught during [%s]\r\n", argv[0]);
83  }
84 
87  IARM_Bus_Term();
88 
89  return 0;
90 }
91 
92 
93 /** @} */
94 /** @} */
device::AudioOutputPort::setMS12AudioProfile
void setMS12AudioProfile(std::string profile)
This API is used to set MS12 Audio Profile.
Definition: audioOutputPort.cpp:1154
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
device::AudioOutputPort::getMS12AudioProfileList
std::vector< std::string > getMS12AudioProfileList() const
This API is used to get the supported MS12 Audio profiles.
Definition: audioOutputPort.cpp:1173
manager.hpp
It contains class referenced by manager.cpp file.
dsError.h
Device Settings HAL error codes.
dsUtl.h
Device Settings HAL utilities.
device::AudioOutputPort
Class extending Enumerable to implement the audiooutputport interface.
Definition: audioOutputPort.hpp:60
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::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::Host::getAudioOutputPort
AudioOutputPort & getAudioOutputPort(const std::string &name)
This API is used to get the reference to the audio output port by its name. The name of the port must...
Definition: host.cpp:388
videoOutputPort.hpp
It contains class and structure refrenced by the videooutputport.cpp file.
device::AudioOutputPort::getMS12AudioProfile
const std::string getMS12AudioProfile() const
This API is used to get the current MS12 Audio profile.
Definition: audioOutputPort.cpp:1125
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::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
audioOutputPort.hpp
It contain variables,stuctures,class and functions referenced by audiooutputport code.
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