Skip to content

Commit adb215f

Browse files
RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo (… (rdkcentral#6292)
* RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo (rdkcentral#6285) * RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo Reason for change: Add chipset and ReleaseVersion property to DeviceInfo Plugin Test Procedure: verify build success and basic test Risks: Low Priority: P1 Signed-off-by: [email protected] * RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo Reason for change: Add chipset and ReleaseVersion property to DeviceInfo Plugin Test Procedure: verify build success and basic test Risks: Low Priority: P1 Signed-off-by: [email protected] * RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo Reason for change: Add chipset and ReleaseVersion property to DeviceInfo Plugin Test Procedure: verify build success and basic test Risks: Low Priority: P1 Signed-off-by: [email protected] * RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo Reason for change: Add chipset and ReleaseVersion property to DeviceInfo Plugin Test Procedure: verify build success and basic test Risks: Low Priority: P1 Signed-off-by: [email protected] * RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo Reason for change: Add chipset and ReleaseVersion property to DeviceInfo Plugin Test Procedure: verify build success and basic test Risks: Low Priority: P1 Signed-off-by: [email protected] --------- Signed-off-by: [email protected] Co-authored-by: Anand Kandasamy <[email protected]> * RDKEMW-2565 Add deviceIdentification plugin details into deviceinfo Reason for change: Add chipset and ReleaseVersion property to DeviceInfo Plugin Test Procedure: verify build success and basic test Risks: Low Priority: P1 Signed-off-by: [email protected] --------- Signed-off-by: [email protected] Co-authored-by: Anand Kandasamy <[email protected]>
1 parent fe2dc9d commit adb215f

File tree

10 files changed

+376
-3
lines changed

10 files changed

+376
-3
lines changed

.github/workflows/L1-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ jobs:
141141
run: |
142142
cd ThunderInterfaces
143143
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/DeviceInfo_brand_R2_L1tests.patch
144+
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0001-RDKEMW-2565-Add-deviceIdentification-plugin-details-.patch
144145
cd ..
145146
146147
- name: Build ThunderInterfaces

DeviceInfo/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ All notable changes to this RDK Service will be documented in this file.
1515
* Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development.
1616

1717
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
18+
## [1.1.2] - 2025-06-19
19+
### Added
20+
- Added API to get Chipset and ReleaseVersion
1821

1922
## [1.1.1] - 2025-6-18
2023
### Changed

DeviceInfo/DeviceInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#define API_VERSION_NUMBER_MAJOR 1
2323
#define API_VERSION_NUMBER_MINOR 1
24-
#define API_VERSION_NUMBER_PATCH 1
24+
#define API_VERSION_NUMBER_PATCH 2
2525

2626
namespace WPEFramework {
2727
namespace {

DeviceInfo/DeviceInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ namespace Plugin {
120120
uint32_t get_brandname(JsonData::DeviceInfo::BrandnameData& response) const;
121121
uint32_t get_devicetype(JsonData::DeviceInfo::DevicetypeData& response) const;
122122
uint32_t get_distributorid(JsonData::DeviceInfo::DistributoridData& response) const;
123+
uint32_t get_releaseversion(JsonData::DeviceInfo::ReleaseversionData& response) const;
124+
uint32_t get_chipset(JsonData::DeviceInfo::ChipsetData& response) const;
123125
uint32_t get_supportedaudioports(JsonData::DeviceInfo::SupportedaudioportsData& response) const;
124126
uint32_t get_supportedvideodisplays(JsonData::DeviceInfo::SupportedvideodisplaysData& response) const;
125127
uint32_t get_hostedid(JsonData::DeviceInfo::HostedidData& response) const;

DeviceInfo/DeviceInfo.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,50 @@
595595
}
596596
]
597597
},
598+
"releaseversion": {
599+
"summary": "Release version of Image . If unable to find the Release version default value is 99.99.0.0",
600+
"readonly": true,
601+
"params": {
602+
"type": "object",
603+
"properties": {
604+
"releaseversion": {
605+
"type": "string",
606+
"example": "8.2.0.0"
607+
}
608+
},
609+
"required": [
610+
"releaseversion"
611+
]
612+
},
613+
"errors": [
614+
{
615+
"description": "General error",
616+
"$ref": "#/common/errors/general"
617+
}
618+
]
619+
},
620+
"chipset": {
621+
"summary": "Chipset used for this device",
622+
"readonly": true,
623+
"params": {
624+
"type": "object",
625+
"properties": {
626+
"chipset": {
627+
"type": "string",
628+
"example": "T962X3"
629+
}
630+
},
631+
"required": [
632+
"chipset"
633+
]
634+
},
635+
"errors": [
636+
{
637+
"description": "General error",
638+
"$ref": "#/common/errors/general"
639+
}
640+
]
641+
},
598642
"distributorid": {
599643
"summary": "Partner ID or distributor ID for device",
600644
"readonly": true,

DeviceInfo/DeviceInfoJsonRpc.cpp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ namespace Plugin {
4242
Property<BrandnameData>(_T("brandname"), &DeviceInfo::get_brandname, nullptr, this);
4343
Property<DevicetypeData>(_T("devicetype"), &DeviceInfo::get_devicetype, nullptr, this);
4444
Property<DistributoridData>(_T("distributorid"), &DeviceInfo::get_distributorid, nullptr, this);
45+
Property<ReleaseversionData>(_T("releaseversion"), &DeviceInfo::get_releaseversion, nullptr, this);
46+
Property<ChipsetData>(_T("chipset"), &DeviceInfo::get_chipset, nullptr, this);
4547
Property<SupportedaudioportsData>(_T("supportedaudioports"), &DeviceInfo::get_supportedaudioports, nullptr, this);
4648
Property<SupportedvideodisplaysData>(_T("supportedvideodisplays"), &DeviceInfo::get_supportedvideodisplays, nullptr, this);
4749
Property<HostedidData>(_T("hostedid"), &DeviceInfo::get_hostedid, nullptr, this);
@@ -66,6 +68,8 @@ namespace Plugin {
6668
Unregister(_T("brandname"));
6769
Unregister(_T("devicetype"));
6870
Unregister(_T("distributorid"));
71+
Unregister(_T("releaseversion"));
72+
Unregister(_T("chipset"));
6973
Unregister(_T("supportedaudioports"));
7074
Unregister(_T("supportedvideodisplays"));
7175
Unregister(_T("hostedid"));
@@ -283,6 +287,52 @@ namespace Plugin {
283287
return result;
284288
}
285289

290+
// Property: releaseversion - ReleaseVersion of the Image
291+
// Return codes:
292+
// - ERROR_NONE: Success
293+
// - ERROR_GENERAL: General error
294+
uint32_t DeviceInfo::get_releaseversion(ReleaseversionData& response) const
295+
{
296+
297+
string releaseversion = "";
298+
299+
auto result = _deviceInfo->ReleaseVersion(releaseversion);
300+
if (result == Core::ERROR_NONE) {
301+
response.Releaseversion = releaseversion;
302+
LOGINFO("ReleaseVersion of the Image: %s\n", releaseversion.c_str());
303+
return Core::ERROR_NONE;
304+
}
305+
else
306+
{
307+
LOGERR("Unable to get releaseVersion of the Image:\n");
308+
return Core::ERROR_GENERAL;
309+
}
310+
311+
}
312+
313+
// Property: chipset - chipset of the device
314+
// Return codes:
315+
// - ERROR_NONE: Success
316+
// - ERROR_GENERAL: General error
317+
uint32_t DeviceInfo::get_chipset(ChipsetData& response) const
318+
{
319+
320+
string chipset = "";
321+
322+
auto result = _deviceInfo->ChipSet(chipset);
323+
if (result == Core::ERROR_NONE) {
324+
response.Chipset = chipset;
325+
LOGINFO("Chipset of the device: %s\n", chipset.c_str());
326+
return Core::ERROR_NONE;
327+
}
328+
else
329+
{
330+
LOGERR("Unable to get Chipset of the device \n");
331+
return Core::ERROR_GENERAL;
332+
}
333+
334+
}
335+
286336
// Property: supportedaudioports - Audio ports supported on the device (all ports that are physically present)
287337
// Return codes:
288338
// - ERROR_NONE: Success

DeviceInfo/Implementation/DeviceInfo.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,42 @@ namespace Plugin {
155155
? Core::ERROR_NONE
156156
: GetRFCData(_T("Device.DeviceInfo.X_RDKCENTRAL-COM_Syndication.PartnerId"), distributorId);
157157
}
158+
159+
160+
Core::hresult DeviceInfoImplementation::ReleaseVersion(string& releaseVersion ) const
161+
{
162+
const std::string defaultVersion = "99.99.0.0";
163+
std::regex pattern(R"((\d+)\.(\d+)[sp])");
164+
std::smatch match;
165+
std::string imagename = "";
166+
if(Core::ERROR_NONE == GetFileRegex(_T("/version.txt"), std::regex("^imagename:([^\\n]+)$"), imagename))
167+
{
168+
if (std::regex_search(imagename, match, pattern)) {
169+
std::string major = match[1];
170+
std::string minor = match[2];
171+
releaseVersion = major + "." + minor + ".0.0";
172+
}
173+
else
174+
{
175+
releaseVersion = defaultVersion ;
176+
LOGERR("Unable to get releaseVersion of the Image:%s.So default releaseVersion is: %s ",imagename.c_str(),releaseVersion.c_str());
177+
}
178+
}
179+
else
180+
{
181+
releaseVersion = defaultVersion ;
182+
LOGERR("Unable to read from /version.txt. So default releaseVersion is: %s ",releaseVersion.c_str());
183+
184+
}
185+
186+
return Core::ERROR_NONE;
187+
}
188+
189+
uint32_t DeviceInfoImplementation::ChipSet(string& chipset) const
190+
{
191+
auto result = GetFileRegex(_T("/etc/device.properties"),std::regex("^CHIPSET_NAME(?:\\s*)=(?:\\s*)(?:\"{0,1})([^\"\\n]+)(?:\"{0,1})(?:\\s*)$"), chipset);
192+
return result;
193+
}
194+
158195
}
159196
}

DeviceInfo/Implementation/DeviceInfo.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ namespace Plugin {
3030
uint32_t DeviceType(string& deviceType) const override;
3131
uint32_t DistributorId(string& distributorId) const override;
3232
uint32_t Brand(string& brand) const override;
33+
Core::hresult ReleaseVersion(string& releaseVersion ) const override;
34+
Core::hresult ChipSet(string& chipSet ) const override;
3335
};
3436
}
3537
}
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
From 63ee428b1ec6585c8cf4b7bf30b1b3ecb052abdc Mon Sep 17 00:00:00 2001
2+
From: ramkumarpraba <[email protected]>
3+
Date: Fri, 13 Jun 2025 13:39:27 +0000
4+
Subject: [PATCH] RDKEMW-2565 Add deviceIdentification plugin details into
5+
deviceinfo
6+
7+
Reason for change: Add chipset and ReleaseVersion property to DeviceInfo Plugin
8+
Test Procedure: verify build success and basic test
9+
Risks: Low
10+
Priority: P1
11+
Signed-off-by: [email protected]
12+
---
13+
interfaces/IDeviceInfo2.h | 2 ++
14+
jsonrpc/DeviceInfo.json | 44 +++++++++++++++++++++++++++++++++++++++
15+
2 files changed, 46 insertions(+)
16+
17+
diff --git a/interfaces/IDeviceInfo2.h b/interfaces/IDeviceInfo2.h
18+
index 0e56da9..1ebdc9a 100644
19+
--- a/interfaces/IDeviceInfo2.h
20+
+++ b/interfaces/IDeviceInfo2.h
21+
@@ -19,6 +19,8 @@ namespace Exchange {
22+
virtual uint32_t DeviceType(string& deviceType /* @out */) const = 0;
23+
virtual uint32_t DistributorId(string& distributorId /* @out */) const = 0;
24+
virtual uint32_t Brand(string& brand /* @out */) const = 0;
25+
+ virtual Core::hresult ReleaseVersion(string& releaseVersion /* @out */) const = 0;
26+
+ virtual Core::hresult ChipSet(string& chipSet /* @out */) const = 0;
27+
};
28+
29+
struct EXTERNAL IDeviceAudioCapabilities : virtual public Core::IUnknown {
30+
diff --git a/jsonrpc/DeviceInfo.json b/jsonrpc/DeviceInfo.json
31+
index 1f7997e..d90879c 100644
32+
--- a/jsonrpc/DeviceInfo.json
33+
+++ b/jsonrpc/DeviceInfo.json
34+
@@ -524,6 +524,50 @@
35+
}
36+
]
37+
},
38+
+ "releaseversion": {
39+
+ "summary": "Release version of Image",
40+
+ "readonly": true,
41+
+ "params": {
42+
+ "type": "object",
43+
+ "properties": {
44+
+ "releaseversion": {
45+
+ "type": "string",
46+
+ "example": "8.2.0.0"
47+
+ }
48+
+ },
49+
+ "required": [
50+
+ "releaseversion"
51+
+ ]
52+
+ },
53+
+ "errors": [
54+
+ {
55+
+ "description": "General error",
56+
+ "$ref": "#/common/errors/general"
57+
+ }
58+
+ ]
59+
+ },
60+
+ "chipset": {
61+
+ "summary": "Chipset used for this device",
62+
+ "readonly": true,
63+
+ "params": {
64+
+ "type": "object",
65+
+ "properties": {
66+
+ "chipset": {
67+
+ "type": "string",
68+
+ "example": "T962X3"
69+
+ }
70+
+ },
71+
+ "required": [
72+
+ "chipset"
73+
+ ]
74+
+ },
75+
+ "errors": [
76+
+ {
77+
+ "description": "General error",
78+
+ "$ref": "#/common/errors/general"
79+
+ }
80+
+ ]
81+
+ },
82+
"make": {
83+
"summary": "Device manufacturer",
84+
"readonly": true,
85+
--
86+
2.25.1
87+

0 commit comments

Comments
 (0)