Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SsoWeather Plugin #755

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b550615
Notus S2 keys updated (#663)
Divya-563 Oct 3, 2022
afd85c0
Merge branch 'master' into R4
Divya-563 Oct 18, 2022
1bcde26
Merge branch 'master' into R4
Divya-563 Oct 28, 2022
bd83d76
Merge branch 'master' into R4
Divya-563 Oct 31, 2022
1e5a854
Merge branch 'master' into R4
Divya-563 Nov 14, 2022
12279bb
Merge branch 'master' into R4
Divya-563 Nov 15, 2022
c540696
Merge branch 'master' into R4
Divya-563 Nov 23, 2022
a55a662
Merge branch 'master' into R4
Divya-563 Nov 23, 2022
92e11f1
Merge branch 'master' into R4
Divya-563 Dec 5, 2022
12241a2
[BluetoothControl] Advertising/Discoverable modes (#688)
sebaszm Dec 7, 2022
9dd64f2
RemoteControl: std::ptr_fun is depricated in gcc12 (#689)
bramoosterhuis Dec 15, 2022
c107af6
Remove Deinitialize call from the Initialization method, since it is …
HaseenaSainul Jan 3, 2023
56c5e45
COM-RPC example stress test (#691)
sebaszm Jan 3, 2023
6078869
_service call usage changes (#693)
HaseenaSainul Jan 5, 2023
ae46f4d
Add null check before usage, during deinit sequence to avoid accessin…
HaseenaSainul Jan 9, 2023
f9809b2
[NAMING] Non-happy day reporting is now dangling i.s.o. Clenup. (#696)
pwielders Feb 3, 2023
b70447a
[VERSION] Drop Version call if it is not used.. (#697)
pwielders Feb 6, 2023
0e36db6
Creating GitHub Actions to build ThunderNanoServices (#698)
VeithMetro Feb 8, 2023
388c2f1
TimeSync: set deferred config as deprecated (#695)
HaseenaSainul Feb 9, 2023
aebd84d
Development/multiple touch (#699)
pwielders Feb 10, 2023
bf2533d
[RUSTBRIDGE] Has been moved to the RDKServices repository. (#701)
pwielders Feb 14, 2023
4ea2e12
[JSONRPC] Moved a bit of the methods around to work with the JSONRPC …
pwielders Feb 15, 2023
20f0c24
Development/multiple touch (#700)
pwielders Feb 15, 2023
54ecfb9
[FIXES] Warning free build, Touch Realse only on > 0 and the composit…
pwielders Feb 21, 2023
bed9316
Merge branch 'master' into R4
Divya-563 Mar 15, 2023
8522ab7
Merge branch 'master' into R4
Divya-563 Apr 4, 2023
9f051b6
Merge branch 'master' into R4
Divya-563 Apr 4, 2023
1577d99
[NetworkControl] Return error if asked for empty interface name (#722)
sebaszm Apr 4, 2023
f1d8b7e
Move Tracing to Messaging (#723)
HaseenaSainul Apr 7, 2023
30e0809
[SUBSYSTEM] The Webserver did not control the WebSource although it s…
pwielders Apr 13, 2023
2d208f6
[Bluetooth] Support advertising events (#725)
sebaszm Apr 14, 2023
98f2b0d
[ReleaseNotes] 4.3 (#726)
MFransen69 Apr 19, 2023
3122e7f
[WARNINGFREE] Suppress the ABI warnings. We always build all from scr…
pwielders Apr 19, 2023
be5c38d
Merge branch 'master' into R4
Divya-563 May 23, 2023
73f9517
Merge branch 'master' into R4
Divya-563 May 23, 2023
57d980b
WebServer, BlueToothControl, SwitchBoard, IOConnector, NetworkControl…
HaseenaSainul May 24, 2023
8c4f57f
Development/compositor2304 (#730)
bramoosterhuis Jun 2, 2023
6c11667
[COMPOSITOR] Only install weston.ini if it is a WESTON build. (#731)
bramoosterhuis Jun 2, 2023
a1251a8
Doggo: add initial watchdog plugin (#732)
bramoosterhuis Jun 2, 2023
8b5324e
[COMRPC] Make sure the AnnounceMessage is used correctly. (#734)
pwielders Jun 22, 2023
508abca
Compositor:RPI: Remove Announcements calls, since it is removed from …
HaseenaSainul Jun 26, 2023
1adb42f
Merge branch 'master' into R4
Divya-563 Jun 26, 2023
ca390d7
[GCC12] Found warnins, Analyzed them, supressed them. (#736)
pwielders Jun 30, 2023
c6b40ac
add SsoWeather dummy plugin
szymon-sobczak-comcast Oct 2, 2023
7318dcb
introduce interface implementation draft
szymon-sobczak-comcast Oct 4, 2023
ab1b1d7
create SsoWeather implementation
szymon-sobczak-comcast Oct 7, 2023
6de875e
fix minor issues with function definitions
szymon-sobczak-comcast Oct 11, 2023
d323256
add weather change notifications
szymon-sobczak-comcast Oct 11, 2023
262cd63
generate documentation and improve json-rpc implementation
szymon-sobczak-comcast Oct 18, 2023
cf09193
remove excessive logs, code clean-up
szymon-sobczak-comcast Oct 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 97 additions & 0 deletions .github/workflows/Build ThunderNanoServices.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CMake ThunderNanoServices

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

jobs:
ThunderInterfaces:
uses: rdkcentral/ThunderInterfaces/.github/workflows/Build ThunderInterfaces.yml@master

Interfaces:
needs: ThunderInterfaces

runs-on: ubuntu-latest

strategy:
matrix:
build_type: [Debug, Release, MinSizeRel]

name: Build type - ${{matrix.build_type}}
steps:
- name: Install necessary packages
uses: nick-fields/retry@v2
with:
timeout_minutes: 10
max_attempts: 10
command: |
sudo gem install apt-spy2
sudo apt-spy2 fix --commit --launchpad --country=US
sudo apt-get update
sudo apt install python3-pip
pip install jsonref
sudo apt install build-essential cmake ninja-build libusb-1.0-0-dev zlib1g-dev libssl-dev

- name: Checkout Thunder
uses: actions/checkout@v3
with:
path: Thunder
repository: ${{github.repository_owner}}/Thunder

- name: Checkout ThunderInterfaces
uses: actions/checkout@v3
with:
path: ThunderInterfaces
repository: ${{github.repository_owner}}/ThunderInterfaces

- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: ThunderInterfaces-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}

- name: Unpack files
run: |
tar -xvzf ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz
rm ${{matrix.build_type}}/${{matrix.build_type}}.tar.gz

- name: Checkout ThunderNanoServices
uses: actions/checkout@v3
with:
path: ThunderNanoServices
repository: ${{github.repository_owner}}/ThunderNanoServices

- name: Build ThunderNanoServices
run: |
cmake -G Ninja -S ThunderNanoServices -B ${{matrix.build_type}}/build/ThunderNanoServices \
-DCMAKE_INSTALL_PREFIX="${{matrix.build_type}}/install/usr" \
-DCMAKE_MODULE_PATH="${PWD}/${{matrix.build_type}}/install/usr/include/WPEFramework/Modules" \
-DPLUGIN_CECCONTROL=ON \
-DPLUGIN_COMMANDER=ON \
-DPLUGIN_DHCPSERVER=ON \
-DPLUGIN_DIALSERVER=ON \
-DPLUGIN_DICTIONARY=ON \
-DPLUGIN_FILETRANSFER=ON \
-DPLUGIN_IOCONNECTOR=ON \
-DPLUGIN_INPUTSWITCH=ON \
-DPLUGIN_NETWORKCONTROL=ON \
-DPLUGIN_PROCESSMONITOR=ON \
-DPLUGIN_RESOURCEMONITOR=ON \
-DPLUGIN_SYSTEMCOMMANDS=ON \
-DPLUGIN_SWITCHBOARD=ON \
-DPLUGIN_WEBPROXY=ON \
-DPLUGIN_WEBSERVER=ON \
-DPLUGIN_WEBSHELL=ON \
-DPLUGIN_WIFICONTROL=ON
cmake --build ${{matrix.build_type}}/build/ThunderNanoServices --target install

- name: Tar files
run: tar -czvf ${{matrix.build_type}}.tar.gz ${{matrix.build_type}}

- name: Upload
uses: actions/upload-artifact@v3
with:
name: ThunderNanoServices-${{matrix.build_type}}-artifact
path: ${{matrix.build_type}}.tar.gz
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ option(PLUGIN_WEBSERVER "Include WebServer plugin" OFF)
option(PLUGIN_WEBSHELL "Include WebShell plugin" OFF)
option(PLUGIN_WIFICONTROL "Include WifiControl plugin" OFF)
option(PLUGIN_FILETRANSFER "Include FileTransfer plugin" OFF)
option(PLUGIN_SSOWEATHER "Include SsoWeather plugin" OFF)

if(BUILD_REFERENCE)
add_definitions(-DBUILD_REFERENCE=${BUILD_REFERENCE})
Expand Down Expand Up @@ -186,6 +187,10 @@ if(PLUGIN_SPARK)
add_subdirectory(Spark)
endif()

if(PLUGIN_SSOWEATHER)
add_subdirectory(SsoWeather)
endif()

if(PLUGIN_STREAMER)
add_subdirectory(Streamer)
endif()
Expand Down
8 changes: 6 additions & 2 deletions DHCPServer/DHCPServer.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,12 @@ namespace Plugin {

// Convert identifier to bytes
uint8_t buffer[DHCPServerImplementation::Identifier::maxLength];
uint16_t identifierLength = Core::FromHexString(Name.Value(), buffer, DHCPServerImplementation::Identifier::maxLength);
DHCPServerImplementation::Identifier identifier(buffer, static_cast<uint8_t>(identifierLength));
uint8_t identifierLength = static_cast<uint8_t>(Core::FromHexString(Name.Value(), buffer, sizeof(buffer)));

// The compiler is not aware that in the line above, we limit the result to the size of the buffer (last param)
PUSH_WARNING(DISABLE_WARNING_STRING_OPERATION_OVERREAD);
DHCPServerImplementation::Identifier identifier(buffer, identifierLength);
POP_WARNING();

return DHCPServerImplementation::Lease(identifier, ip.s_addr, Expires.Value());
}
Expand Down
57 changes: 57 additions & 0 deletions SsoWeather/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2020 Metrological
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

project(SsoWeather)

cmake_minimum_required(VERSION 3.3)

find_package(WPEFramework)

project_version(1.0.0)

set(PLUGIN_NAME SsoWeather)

set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})
message("Setup ${MODULE_NAME} v${PROJECT_VERSION}")

set(PLUGIN_SSOWEATHER_MODE "Local" CACHE STRING "Controls if the SsoWeather should run in its own process, in process or remote.")

find_package(${NAMESPACE}Plugins REQUIRED)
find_package(CompileSettingsDebug CONFIG REQUIRED)

add_library(${MODULE_NAME} SHARED
SsoWeather.cpp
Module.cpp
SsoWeatherImplementation.cpp)

set_target_properties(${MODULE_NAME} PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES)

target_link_libraries(${MODULE_NAME}
PRIVATE
CompileSettingsDebug::CompileSettingsDebug
${NAMESPACE}Plugins::${NAMESPACE}Plugins)

target_include_directories(${MODULE_NAME}
PRIVATE
${CMAKE_CURRENT_LIST_DIR})

install(TARGETS ${MODULE_NAME}
DESTINATION lib/${STORAGE_DIRECTORY}/plugins)

write_config()
22 changes: 22 additions & 0 deletions SsoWeather/Module.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "Module.h"

MODULE_NAME_DECLARATION(BUILD_REFERENCE)
32 changes: 32 additions & 0 deletions SsoWeather/Module.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef OPENPLUGIN_SSOWEATHER_MODULE_H
#define OPENPLUGIN_SSOWEATHER_MODULE_H

#ifndef MODULE_NAME
#define MODULE_NAME SsoWeather
#endif

#include <plugins/plugins.h>

#undef EXTERNAL
#define EXTERNAL

#endif // OPENPLUGIN_SSOWEATHER_MODULE_H
5 changes: 5 additions & 0 deletions SsoWeather/SsoWeather.conf.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
configuration = JSON()

rootobject = JSON()
rootobject.add("mode", "@PLUGIN_SSOWEATHER_MODE@")
configuration.add("root", rootobject)
108 changes: 108 additions & 0 deletions SsoWeather/SsoWeather.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2020 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "SsoWeather.h"

namespace WPEFramework {
namespace Plugin {
namespace {

static Metadata<SsoWeather> metadata(
// Version
1, 0, 0,
// Preconditions
{},
// Terminations
{},
// Controls
{}
);
}

const string SsoWeather::Initialize(PluginHost::IShell* service)
{
string message = EMPTY_STRING;

ASSERT (_service == nullptr);
ASSERT (service != nullptr);
ASSERT (_implementation == nullptr);
ASSERT (_connectionId == 0);

_service = service;
_service->AddRef();
_service->Register(&_notification);

_implementation = _service->Root<Exchange::ISsoWeather>(_connectionId, 2000, _T("SsoWeatherImplementation"));
if (_implementation == nullptr) {
message = _T("Couldn't create SsoWeather instance");
} else {
_implementation->Register(&_weatherNotification);
Exchange::JSsoWeather::Register(*this, _implementation);
}

return (message);
}

/* virtual */ void SsoWeather::Deinitialize(PluginHost::IShell* service)
{
if (_service != nullptr) {
ASSERT (_service == service);

service->Unregister(&_notification);

if (_implementation != nullptr) {

Exchange::JSsoWeather::Unregister(*this);
_implementation->Unregister(&_weatherNotification);

RPC::IRemoteConnection* connection(_service->RemoteConnection(_connectionId));
VARIABLE_IS_NOT_USED uint32_t result = _implementation->Release();
_implementation = nullptr;

ASSERT(result == Core::ERROR_DESTRUCTION_SUCCEEDED);

if (connection != nullptr) {
connection->Terminate();
connection->Release();
}
}

_service->Release();
_service = nullptr;
_connectionId = 0;
}
}

/* virtual */ string SsoWeather::Information() const
{
return (EMPTY_STRING);
}

void SsoWeather::Deactivated(RPC::IRemoteConnection* connection)
{
if (connection->Id() == _connectionId) {
ASSERT(_service != nullptr);
Core::IWorkerPool::Instance().Submit(PluginHost::IShell::Job::Create(_service,
PluginHost::IShell::DEACTIVATED,
PluginHost::IShell::FAILURE));
}
}

} // namespace Plugin
} // namespace WPEFramework
Loading