Skip to content

Commit

Permalink
Merge pull request rdkcentral#3253 from npoltorapavlo/move_to_22q4
Browse files Browse the repository at this point in the history
Move to 22q4
  • Loading branch information
anand-ky authored and npoltorapavlo committed Oct 18, 2022
1 parent ea781ac commit 93a9a38
Show file tree
Hide file tree
Showing 52 changed files with 3,224 additions and 2,678 deletions.
92 changes: 40 additions & 52 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ env:
INTERFACES_REF: "f61d710cc51628819d0fd80b8cc65e55eeec12b4"

jobs:
all:
unit-tests:
name: Build and run unit tests
runs-on: ubuntu-latest

steps:
- name: Set up cache
# Cache Thunder/ThunderInterfaces.
# https://github.com/actions/cache
# https://docs.github.com/en/rest/actions/cache
# Modify the key if changing the list.
if: ${{ !env.ACT }}
id: cache
uses: actions/cache@v3
Expand Down Expand Up @@ -63,8 +65,7 @@ jobs:
cmake-version: '3.16.x'

- name: Install packages
run: >
sudo apt update && sudo apt install -y libsqlite3-dev libcurl4-openssl-dev
run: sudo apt update && sudo apt install -y libsqlite3-dev libcurl4-openssl-dev

- name: Checkout Thunder
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -86,15 +87,11 @@ jobs:
- name: Build ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--build build/ThunderTools -j8
run: cmake --build build/ThunderTools -j8

- name: Install ThunderTools
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--install build/ThunderTools
run: cmake --install build/ThunderTools

- name: Configure Thunder
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -110,15 +107,11 @@ jobs:
- name: Build Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--build build/Thunder -j8
run: cmake --build build/Thunder -j8

- name: Install Thunder
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--install build/Thunder
run: cmake --install build/Thunder

- name: Checkout ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
Expand All @@ -139,15 +132,11 @@ jobs:
- name: Build ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--build build/ThunderInterfaces -j8
run: cmake --build build/ThunderInterfaces -j8

- name: Install ThunderInterfaces
if: steps.cache.outputs.cache-hit != 'true'
run: >
cmake
--install build/ThunderInterfaces
run: cmake --install build/ThunderInterfaces

- name: Checkout rdkservices
uses: actions/checkout@v3
Expand All @@ -166,59 +155,63 @@ jobs:
-I ${{github.workspace}}/rdkservices/Tests/headers/rdk/ds
-I ${{github.workspace}}/rdkservices/Tests/headers/rdk/iarmbus
-I ${{github.workspace}}/rdkservices/Tests/headers/rdk/iarmmgrs-hal
--coverage -Wall -Werror -Wno-unused-parameter -Wno-unused-result -Wl,-wrap,system
--coverage -Wall -Werror -Wno-unused-parameter -Wno-unused-result -Wl,-wrap,system -Wl,-wrap,popen
-DENABLE_TELEMETRY_LOGGING
-DUSE_IARMBUS"
-DUSE_IARMBUS
-DENABLE_SYSTEM_GET_STORE_DEMO_LINK
-DENABLE_DEEP_SLEEP
-DENABLE_SET_WAKEUP_SRC_CONFIG
-DENABLE_THERMAL_PROTECTION
-DHAS_API_SYSTEM
-DHAS_API_POWERSTATE
-DENABLE_DEVICE_MANUFACTURER_INFO"
-DCOMCAST_CONFIG=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_DS=ON
-DCMAKE_DISABLE_FIND_PACKAGE_IARMBus=ON
-DCMAKE_DISABLE_FIND_PACKAGE_Udev=ON
-DCMAKE_DISABLE_FIND_PACKAGE_RFC=ON
-DPLUGIN_DATACAPTURE=ON
-DPLUGIN_DEVICEDIAGNOSTICS=ON
-DPLUGIN_LOCATIONSYNC=ON
-DPLUGIN_PERSISTENTSTORE=ON
-DPLUGIN_TIMER=ON
-DPLUGIN_SECURITYAGENT=ON
-DPLUGIN_DEVICEIDENTIFICATION=ON
-DBUILD_REALTEK=ON
-DPLUGIN_FRAMERATE=ON
-DCMAKE_DISABLE_FIND_PACKAGE_DS=ON
-DCMAKE_DISABLE_FIND_PACKAGE_IARMBus=ON
-DPLUGIN_AVINPUT=ON
-DPLUGIN_TELEMETRY=ON
-DPLUGIN_USBACCESS=ON
-DPLUGIN_LOGGINGPREFERENCES=ON
-DPLUGIN_USERPREFERENCES=ON
-DCMAKE_DISABLE_FIND_PACKAGE_Udev=ON
-DPLUGIN_MESSENGER=ON
-DPLUGIN_DEVICEINFO=ON
-DPLUGIN_SYSTEMSERVICES=ON
-DCMAKE_DISABLE_FIND_PACKAGE_RFC=ON
-DRDK_SERVICES_TEST=ON
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build rdkservices
run: >
cmake
--build build/rdkservices -j8
run: cmake --build build/rdkservices -j8

- name: Install rdkservices
run: >
cmake
--install build/rdkservices
run: cmake --install build/rdkservices

- name: Install valgrind
run: >
sudo apt update && sudo apt install -y valgrind
- name: Start servers
# nohup to keep it running.
run: |
nohup python rdkservices/Tests/source/tr69hostif.py &
sleep 0.1
run: sudo apt update && sudo apt install -y valgrind

- name: Set up files
run: |
printf 'MFG_NAME=Pace\nFRIENDLY_ID="Pace Xi5"\n' | sudo tee /etc/device.properties
printf 'deviceType=IpStb\n' | sudo tee /etc/authService.conf
printf 'imagename:PX051AEI_VBN_2203_sprint_20220331225312sdy_NG\nSDK_VERSION=17.3\nMEDIARITE=8.3.53\nYOCTO_VERSION=dunfell\n' | sudo tee /version.txt
run: >
sudo mkdir -p -m 777
/opt/persistent
/opt/secure /opt/secure/reboot /opt/secure/persistent /opt/secure/persistent/System
/opt/logs &&
sudo touch
/opt/standbyReason.txt /opt/tmtryoptout /opt/fwdnldstatus.txt
/etc/device.properties /etc/authService.conf
/version.txt &&
sudo chmod 777
/opt/standbyReason.txt /opt/tmtryoptout /opt/fwdnldstatus.txt
/etc/device.properties /etc/authService.conf
/version.txt
- name: Run unit tests
run: >
Expand All @@ -233,13 +226,8 @@ jobs:
--fair-sched=try
RdkServicesTest
- name: Stop servers
run: |
pkill -f rdkservices/Tests/source/tr69hostif.py
- name: Install lcov
run: >
sudo apt update && sudo apt install -y lcov
run: sudo apt update && sudo apt install -y lcov

- name: Generate coverage
run: >
Expand Down
16 changes: 2 additions & 14 deletions DisplaySettings/DisplaySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ namespace
}
#endif

#define registerMethod(...) Register(__VA_ARGS__);GetHandler(2)->Register<JsonObject, JsonObject>(__VA_ARGS__)
// TODO: remove this
#define registerMethod(...) for (uint8_t i = 1; GetHandler(i); i++) GetHandler(i)->Register<JsonObject, JsonObject>(__VA_ARGS__)

namespace WPEFramework {

Expand Down Expand Up @@ -2190,7 +2191,6 @@ namespace WPEFramework {
JsonObject params;
audioFormatToString(audioFormat, params);
sendNotify("audioFormatChanged", params);
GetHandler(2)->Notify("audioFormatChanged", params);
}

void DisplaySettings::notifyVideoFormatChange(dsHDRStandard_t videoFormat)
Expand All @@ -2200,39 +2200,34 @@ namespace WPEFramework {

params["supportedVideoFormat"] = getSupportedVideoFormats();
sendNotify("videoFormatChanged", params);
GetHandler(2)->Notify("videoFormatChanged", params);
}

void DisplaySettings::notifyAssociatedAudioMixingChange(bool mixing)
{
JsonObject params;
params["mixing"] = mixing;
sendNotify("associatedAudioMixingChanged", params);
GetHandler(2)->Notify("associatedAudioMixingChanged", params);
}

void DisplaySettings::notifyFaderControlChange(bool mixerbalance)
{
JsonObject params;
params["mixerBalance"] = mixerbalance;
sendNotify("faderControlChanged", params);
GetHandler(2)->Notify("faderControlChanged", params);
}

void DisplaySettings::notifyPrimaryLanguageChange(std::string pLang)
{
JsonObject params;
params["primaryLanguage"] = pLang;
sendNotify("primaryLanguageChanged", params);
GetHandler(2)->Notify("primaryLanguageChanged", params);
}

void DisplaySettings::notifySecondaryLanguageChange(std::string sLang)
{
JsonObject params;
params["secondaryLanguage"] = sLang;
sendNotify("secondaryLanguageChanged", params);
GetHandler(2)->Notify("secondaryLanguageChanged", params);
}

uint32_t DisplaySettings::getBassEnhancer(const JsonObject& parameters, JsonObject& response)
Expand Down Expand Up @@ -5221,7 +5216,6 @@ namespace WPEFramework {
void DisplaySettings::resolutionPreChange()
{
sendNotify("resolutionPreChange", JsonObject());
GetHandler(2)->Notify("resolutionPreChange", JsonObject());
}

void DisplaySettings::resolutionChanged(int width, int height)
Expand Down Expand Up @@ -5257,7 +5251,6 @@ namespace WPEFramework {
params["videoDisplayType"] = display;
params["resolution"] = resolution;
sendNotify("resolutionChanged", params);
GetHandler(2)->Notify("resolutionChanged", params);
return;
}
else if (!firstResolutionSet)
Expand All @@ -5277,7 +5270,6 @@ namespace WPEFramework {
params["videoDisplayType"] = firstDisplay;
params["resolution"] = firstResolution;
sendNotify("resolutionChanged", params);
GetHandler(2)->Notify("resolutionChanged", params);
}
}

Expand All @@ -5288,15 +5280,13 @@ namespace WPEFramework {
params["zoomSetting"] = zoomSetting;
params["videoDisplayType"] = "all";
sendNotify("zoomSettingUpdated", params);
GetHandler(2)->Notify("zoomSettingUpdated", params);
}

void DisplaySettings::activeInputChanged(bool activeInput)
{
JsonObject params;
params["activeInput"] = activeInput;
sendNotify("activeInputChanged", params);
GetHandler(2)->Notify("activeInputChanged", params);
}

void DisplaySettings::connectedVideoDisplaysUpdated(int hdmiHotPlugEvent)
Expand All @@ -5320,7 +5310,6 @@ namespace WPEFramework {
JsonObject params;
params["connectedVideoDisplays"] = connectedDisplays;
sendNotify("connectedVideoDisplaysUpdated", params);
GetHandler(2)->Notify("connectedVideoDisplaysUpdated", params);
}
previousStatus = hdmiHotPlugEvent;
}
Expand Down Expand Up @@ -5358,7 +5347,6 @@ namespace WPEFramework {
}
LOGWARN ("Thunder sends notification %s audio port hotplug status %s", sPortName.c_str(), sPortStatus.c_str());
sendNotify("connectedAudioPortUpdated", params);
GetHandler(2)->Notify("connectedAudioPortUpdated", params);
}

//End events
Expand Down
43 changes: 11 additions & 32 deletions FrameRate/FrameRate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
#define DEFAULT_MIN_FPS_VALUE 60
#define DEFAULT_MAX_FPS_VALUE -1

// TODO: remove this
#define registerMethod(...) for (uint8_t i = 1; GetHandler(i); i++) GetHandler(i)->Register<JsonObject, JsonObject>(__VA_ARGS__)

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 1
Expand Down Expand Up @@ -80,39 +83,21 @@ namespace WPEFramework
{
FrameRate::_instance = this;

Register(METHOD_SET_COLLECTION_FREQUENCY, &FrameRate::setCollectionFrequencyWrapper, this);
Register(METHOD_START_FPS_COLLECTION, &FrameRate::startFpsCollectionWrapper, this);
Register(METHOD_STOP_FPS_COLLECTION, &FrameRate::stopFpsCollectionWrapper, this);
Register(METHOD_UPDATE_FPS_COLLECTION, &FrameRate::updateFpsWrapper, this);

CreateHandler({2});
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_SET_COLLECTION_FREQUENCY, &FrameRate::setCollectionFrequencyWrapper, this);
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_START_FPS_COLLECTION, &FrameRate::startFpsCollectionWrapper, this);
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_STOP_FPS_COLLECTION, &FrameRate::stopFpsCollectionWrapper, this);
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_UPDATE_FPS_COLLECTION, &FrameRate::updateFpsWrapper, this);
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_SET_FRAME_MODE, &FrameRate::setFrmMode, this);
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_GET_FRAME_MODE, &FrameRate::getFrmMode, this);
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_GET_DISPLAY_FRAME_RATE, &FrameRate::getDisplayFrameRate, this);
GetHandler(2)->Register<JsonObject, JsonObject>(METHOD_SET_DISPLAY_FRAME_RATE, &FrameRate::setDisplayFrameRate, this);
registerMethod(METHOD_SET_COLLECTION_FREQUENCY, &FrameRate::setCollectionFrequencyWrapper, this);
registerMethod(METHOD_START_FPS_COLLECTION, &FrameRate::startFpsCollectionWrapper, this);
registerMethod(METHOD_STOP_FPS_COLLECTION, &FrameRate::stopFpsCollectionWrapper, this);
registerMethod(METHOD_UPDATE_FPS_COLLECTION, &FrameRate::updateFpsWrapper, this);
registerMethod(METHOD_SET_FRAME_MODE, &FrameRate::setFrmMode, this);
registerMethod(METHOD_GET_FRAME_MODE, &FrameRate::getFrmMode, this);
registerMethod(METHOD_GET_DISPLAY_FRAME_RATE, &FrameRate::getDisplayFrameRate, this);
registerMethod(METHOD_SET_DISPLAY_FRAME_RATE, &FrameRate::setDisplayFrameRate, this);

m_reportFpsTimer.connect( std::bind( &FrameRate::onReportFpsTimer, this ) );
}

FrameRate::~FrameRate()
{
Unregister(METHOD_SET_COLLECTION_FREQUENCY);
Unregister(METHOD_START_FPS_COLLECTION);
Unregister(METHOD_STOP_FPS_COLLECTION);
Unregister(METHOD_UPDATE_FPS_COLLECTION);

GetHandler(2)->Unregister(METHOD_SET_COLLECTION_FREQUENCY);
GetHandler(2)->Unregister(METHOD_START_FPS_COLLECTION);
GetHandler(2)->Unregister(METHOD_STOP_FPS_COLLECTION);
GetHandler(2)->Unregister(METHOD_UPDATE_FPS_COLLECTION);
GetHandler(2)->Unregister(METHOD_SET_FRAME_MODE);
GetHandler(2)->Unregister(METHOD_GET_FRAME_MODE);
GetHandler(2)->Unregister(METHOD_GET_DISPLAY_FRAME_RATE);
GetHandler(2)->Unregister(METHOD_SET_DISPLAY_FRAME_RATE);
}

const string FrameRate::Initialize(PluginHost::IShell * /* service */)
Expand Down Expand Up @@ -435,8 +420,6 @@ namespace WPEFramework
params["max"] = maxFps;

sendNotify(EVENT_FPS_UPDATE, params);

GetHandler(2)->Notify(EVENT_FPS_UPDATE, params);
}

void FrameRate::onReportFpsTimer()
Expand Down Expand Up @@ -481,8 +464,6 @@ namespace WPEFramework
void FrameRate::frameRatePreChange()
{
sendNotify(EVENT_FRAMERATE_PRECHANGE, JsonObject());

GetHandler(2)->Notify(EVENT_FRAMERATE_PRECHANGE, JsonObject());
}

void FrameRate::FrameRatePostChange(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
Expand All @@ -496,8 +477,6 @@ namespace WPEFramework
void FrameRate::frameRatePostChange()
{
sendNotify(EVENT_FRAMERATE_POSTCHANGE, JsonObject());

GetHandler(2)->Notify(EVENT_FRAMERATE_POSTCHANGE, JsonObject());
}


Expand Down
Loading

0 comments on commit 93a9a38

Please sign in to comment.