Skip to content

Commit ff42a39

Browse files
committed
Merge branch 'release/1.6.0'
2 parents 3163354 + 0f153b3 commit ff42a39

12 files changed

+722
-0
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [1.6.0](https://github.com/rdkcentral/entservices-softwareupdate/compare/1.5.4...1.6.0)
8+
9+
- RDKEMW-7762: Create a skeleton plugin for FirmwareDownload [`#159`](https://github.com/rdkcentral/entservices-softwareupdate/pull/159)
10+
- Merge tag '1.5.4' into develop [`ba7db74`](https://github.com/rdkcentral/entservices-softwareupdate/commit/ba7db742213f58bf382976770850abf6f195b3f0)
11+
712
#### [1.5.4](https://github.com/rdkcentral/entservices-softwareupdate/compare/1.5.3...1.5.4)
813

14+
> 24 November 2025
15+
916
- RDKEMW-9216 : Improve L1 test coverage for FirmwareUpdate plugin [`#162`](https://github.com/rdkcentral/entservices-softwareupdate/pull/162)
17+
- 1.5.4 release changelog updates [`e0dff94`](https://github.com/rdkcentral/entservices-softwareupdate/commit/e0dff9496a2f1f00e6ed08b29b781f540ee550c6)
1018
- Merge tag '1.5.3' into develop [`b399345`](https://github.com/rdkcentral/entservices-softwareupdate/commit/b3993455ba8efe4374b856b5847fdfb3fad37355)
1119

1220
#### [1.5.3](https://github.com/rdkcentral/entservices-softwareupdate/compare/1.5.2...1.5.3)

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ if(PLUGIN_MAINTENANCEMANAGER)
6363
add_subdirectory(MaintenanceManager)
6464
endif()
6565

66+
if(PLUGIN_FIRMWAREDOWNLOAD)
67+
add_subdirectory(FirmwareDownload)
68+
endif()
69+
6670
if(WPEFRAMEWORK_CREATE_IPKG_TARGETS)
6771
set(CPACK_GENERATOR "DEB")
6872
set(CPACK_DEB_COMPONENT_INSTALL ON)

FirmwareDownload/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this RDK Service will be documented in this file.
4+
5+
* Each RDK Service has a CHANGELOG file that contains all changes done so far. When version is updated, add a entry in the CHANGELOG.md at the top with user friendly information on what was changed with the new version. Please don't mention JIRA tickets in CHANGELOG.
6+
7+
* Please Add entry in the CHANGELOG for each version change and indicate the type of change with these labels:
8+
* **Added** for new features.
9+
* **Changed** for changes in existing functionality.
10+
* **Deprecated** for soon-to-be removed features.
11+
* **Removed** for now removed features.
12+
* **Fixed** for any bug fixes.
13+
* **Security** in case of vulnerabilities.
14+
15+
* 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.
16+

FirmwareDownload/CMakeLists.txt

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
2+
# If not stated otherwise in this file or this component's LICENSE file the
3+
# following copyright and licenses apply:
4+
#
5+
# Copyright 2025 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+
set(PLUGIN_NAME FirmwareDownload)
20+
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})
21+
set(PLUGIN_IMPLEMENTATION ${MODULE_NAME}Implementation)
22+
23+
set(PLUGIN_FIRMWAREDOWNLOAD_AUTOSTART "false" CACHE STRING "Automatically start FirmwareDownload plugin")
24+
25+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
26+
27+
find_package(${NAMESPACE}Plugins REQUIRED)
28+
find_package(${NAMESPACE}Definitions REQUIRED)
29+
find_package(CompileSettingsDebug CONFIG REQUIRED)
30+
31+
add_library(${MODULE_NAME} SHARED
32+
FirmwareDownload.cpp
33+
Module.cpp)
34+
35+
set_target_properties(${MODULE_NAME} PROPERTIES
36+
CXX_STANDARD 11
37+
CXX_STANDARD_REQUIRED YES)
38+
39+
target_link_libraries(${MODULE_NAME}
40+
PRIVATE
41+
CompileSettingsDebug::CompileSettingsDebug
42+
${NAMESPACE}Plugins::${NAMESPACE}Plugins
43+
${NAMESPACE}Definitions::${NAMESPACE}Definitions)
44+
45+
install(TARGETS ${MODULE_NAME}
46+
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)
47+
48+
add_library(${PLUGIN_IMPLEMENTATION} SHARED
49+
FirmwareDownloadImplementation.cpp
50+
Module.cpp)
51+
52+
include_directories(
53+
../helpers)
54+
55+
set_target_properties(${PLUGIN_IMPLEMENTATION} PROPERTIES
56+
CXX_STANDARD 11
57+
CXX_STANDARD_REQUIRED YES)
58+
59+
target_link_libraries(${PLUGIN_IMPLEMENTATION}
60+
PRIVATE
61+
CompileSettingsDebug::CompileSettingsDebug
62+
${NAMESPACE}Plugins::${NAMESPACE}Plugins)
63+
64+
install(TARGETS ${PLUGIN_IMPLEMENTATION}
65+
DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/${STORAGE_DIRECTORY}/plugins)
66+
67+
write_config(${PLUGIN_NAME})
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
precondition = ["Platform"]
2+
callsign = "org.rdk.FirmwareDownload"
3+
autostart = "false"
4+
startuporder = "@PLUGIN_FIRMWAREDOWNLOAD_STARTUPORDER@"
5+
6+
configuration = JSON()
7+
rootobject = JSON()
8+
9+
rootobject.add("mode", "@PLUGIN_FIRMWAREDOWNLOAD_MODE@")
10+
rootobject.add("locator", "lib@[email protected]")
11+
12+
configuration.add("root", rootobject)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
set (autostart false)
2+
set (preconditions Platform)
3+
set (callsign "org.rdk.FirmwareDownload")
4+
5+
if(PLUGIN_MIGRATION_STARTUPORDER)
6+
set (startuporder ${PLUGIN_FIRMWAREDOWNLOAD_STARTUPORDER})
7+
endif()
8+
9+
map()
10+
key(root)
11+
map()
12+
kv(mode ${PLUGIN_FIRMWAREDOWNLOAD_MODE})
13+
kv(locator lib${PLUGIN_IMPLEMENTATION}.so)
14+
end()
15+
end()
16+
ans(configuration)
Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
/*
2+
* If not stated otherwise in this file or this component's LICENSE file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2025 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+
#include "FirmwareDownload.h"
21+
22+
#define API_VERSION_NUMBER_MAJOR 1
23+
#define API_VERSION_NUMBER_MINOR 0
24+
#define API_VERSION_NUMBER_PATCH 0
25+
26+
namespace WPEFramework
27+
{
28+
29+
namespace {
30+
31+
static Plugin::Metadata<Plugin::FirmwareDownload> metadata(
32+
// Version (Major, Minor, Patch)
33+
API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH,
34+
// Preconditions
35+
{},
36+
// Terminations
37+
{},
38+
// Controls
39+
{}
40+
);
41+
}
42+
43+
namespace Plugin
44+
{
45+
46+
/*
47+
*Register FirmwareDownload module as wpeframework plugin
48+
**/
49+
SERVICE_REGISTRATION(FirmwareDownload, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);
50+
51+
FirmwareDownload::FirmwareDownload() : _service(nullptr), _connectionId(0), _firmwareDownload(nullptr), _firmwareDownloadNotification(this)
52+
{
53+
SYSLOG(Logging::Startup, (_T("FirmwareDownload Constructor")));
54+
}
55+
56+
FirmwareDownload::~FirmwareDownload()
57+
{
58+
SYSLOG(Logging::Shutdown, (string(_T("FirmwareDownload Destructor"))));
59+
}
60+
61+
const string FirmwareDownload::Initialize(PluginHost::IShell* service)
62+
{
63+
string message="";
64+
65+
ASSERT(nullptr != service);
66+
ASSERT(nullptr == _service);
67+
ASSERT(nullptr == _firmwareDownload);
68+
ASSERT(0 == _connectionId);
69+
70+
SYSLOG(Logging::Startup, (_T("FirmwareDownload::Initialize: PID=%u"), getpid()));
71+
72+
_service = service;
73+
_service->AddRef();
74+
_service->Register(&_firmwareDownloadNotification);
75+
_firmwareDownload = _service->Root<Exchange::IFirmwareDownload>(_connectionId, 5000, _T("FirmwareDownloadImplementation"));
76+
77+
if(nullptr != _firmwareDownload)
78+
{
79+
// Register for notifications
80+
_firmwareDownload->Register(&_firmwareDownloadNotification);
81+
// Invoking Plugin API register to wpeframework
82+
Exchange::JFirmwareDownload::Register(*this, _firmwareDownload);
83+
}
84+
else
85+
{
86+
SYSLOG(Logging::Startup, (_T("FirmwareDownload::Initialize: Failed to initialise FirmwareDownload plugin")));
87+
message = _T("FirmwareDownload plugin could not be initialised");
88+
}
89+
90+
return message;
91+
}
92+
93+
void FirmwareDownload::Deinitialize(PluginHost::IShell* service)
94+
{
95+
ASSERT(_service == service);
96+
97+
SYSLOG(Logging::Shutdown, (string(_T("FirmwareDownload::Deinitialize"))));
98+
99+
// Make sure the Activated and Deactivated are no longer called before we start cleaning up..
100+
_service->Unregister(&_firmwareDownloadNotification);
101+
102+
if (nullptr != _firmwareDownload)
103+
{
104+
105+
_firmwareDownload->Unregister(&_firmwareDownloadNotification);
106+
Exchange::JFirmwareDownload::Unregister(*this);
107+
108+
// Stop processing:
109+
RPC::IRemoteConnection* connection = service->RemoteConnection(_connectionId);
110+
VARIABLE_IS_NOT_USED uint32_t result = _firmwareDownload->Release();
111+
112+
_firmwareDownload = nullptr;
113+
114+
// It should have been the last reference we are releasing,
115+
// so it should endup in a DESTRUCTION_SUCCEEDED, if not we
116+
// are leaking...
117+
ASSERT(result == Core::ERROR_DESTRUCTION_SUCCEEDED);
118+
119+
// If this was running in a (container) process...
120+
if (nullptr != connection)
121+
{
122+
// Lets trigger the cleanup sequence for
123+
// out-of-process code. Which will guard
124+
// that unwilling processes, get shot if
125+
// not stopped friendly :-)
126+
try
127+
{
128+
connection->Terminate();
129+
// Log success if needed
130+
LOGWARN("Connection terminated successfully.");
131+
}
132+
catch (const std::exception& e)
133+
{
134+
std::string errorMessage = "Failed to terminate connection: ";
135+
errorMessage += e.what();
136+
LOGWARN("%s",errorMessage.c_str());
137+
}
138+
139+
connection->Release();
140+
}
141+
}
142+
143+
_connectionId = 0;
144+
_service->Release();
145+
_service = nullptr;
146+
SYSLOG(Logging::Shutdown, (string(_T("FirmwareDownload de-initialised"))));
147+
}
148+
149+
string FirmwareDownload::Information() const
150+
{
151+
return string();
152+
}
153+
154+
void FirmwareDownload::Deactivated(RPC::IRemoteConnection* connection)
155+
{
156+
if (connection->Id() == _connectionId) {
157+
ASSERT(nullptr != _service);
158+
Core::IWorkerPool::Instance().Submit(PluginHost::IShell::Job::Create(_service, PluginHost::IShell::DEACTIVATED, PluginHost::IShell::FAILURE));
159+
}
160+
}
161+
} // namespace Plugin
162+
} // namespace WPEFramework

0 commit comments

Comments
 (0)