RDK Documentation (Open Sourced RDK Components)
getDSHalVersion.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 <iostream>
30 #include "host.hpp"
31 #include "dsUtl.h"
32 #include "dsError.h"
33 #include "manager.hpp"
34 #include "list.hpp"
35 #include "libIBus.h"
36 #include "sleepMode.hpp"
37 #include <string>
38 #include "list.hpp"
39 #include "dsConstant.hpp"
40 #include "dsTypes.h"
41 
42 int main(int argc, char *argv[])
43 {
44  uint32_t versionNumber;
45 
46  IARM_Bus_Init("SampleDSClient");
49 
50  versionNumber = device::Host::getInstance().getVersion();
51  printf("DS HAL Version Number before setting is: 0x%08X \r\n",versionNumber);
52  printf("DS HAL Version before setting is - %d.%d \r\n",dsHAL_APIVER_MAJOR(versionNumber),dsHAL_APIVER_MINOR(versionNumber));
53 
54 
55  versionNumber = 0x20000;
56  device::Host::getInstance().setVersion(versionNumber);
57  printf("DS HAL Version Number Updated to: 0x%08X \r\n",versionNumber);
58  printf("DS HAL Version Updated to- %d.%d \r\n",dsHAL_APIVER_MAJOR(versionNumber),dsHAL_APIVER_MINOR(versionNumber));
59 
60 
61  versionNumber = device::Host::getInstance().getVersion();
62  printf("DS HAL Version Number after setting is: 0x%08X \r\n",versionNumber);
63  printf("DS HAL Version after settings is - %d.%d \r\n",dsHAL_APIVER_MAJOR(versionNumber),dsHAL_APIVER_MINOR(versionNumber));
64 
65 
68  IARM_Bus_Term();
69  return 0;
70 }
71 
72 
73 /** @} */
74 /** @} */
IARM_Bus_Term
IARM_Result_t IARM_Bus_Term(void)
This API is used to terminate the IARM-Bus library.
dsConstant.hpp
This file defines DSConstant class which is inherited by most of the device settings classes.
dsTypes.h
Device Settings HAL types.
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...
device::Host::getVersion
uint32_t getVersion(void)
Get DS HAL API Version.
Definition: host.cpp:485
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.
dsHAL_APIVER_MINOR
#define dsHAL_APIVER_MINOR(x)
Definition: dsTypes.h:1161
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
dsHAL_APIVER_MAJOR
#define dsHAL_APIVER_MAJOR(x)
Definition: dsTypes.h:1159
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
sleepMode.hpp
This file defines SleepMode class for device settings.