Skip to content

Commit

Permalink
Merge branch 'rdkcentral:sprint/24Q2' into sprint/NetworkManger
Browse files Browse the repository at this point in the history
  • Loading branch information
cmuhammedrafi authored Apr 25, 2024
2 parents 470f4b9 + e325b48 commit 5c16325
Show file tree
Hide file tree
Showing 72 changed files with 1,029 additions and 659 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/L2-PersistentStore-grpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ jobs:
run: |
cmake -S ${GITHUB_REPOSITORY}/PersistentStore/grpc/l2test -B build/grpcl2test -DCMAKE_INSTALL_PREFIX="install/usr" -DCMAKE_CXX_FLAGS="-Wall -Werror"
cmake --build build/grpcl2test --target install
# (Optional)
# Rebuild with real token (here: kToken = "Bearer TOKEN"):
# cmake --build build/grpcl2test --target install
# Run:
# PATH=${PWD}/install/usr/bin:${PATH} LD_LIBRARY_PATH=${PWD}/install/usr/lib:${LD_LIBRARY_PATH} valgrind --tool=memcheck --log-file=valgrind_log --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try grpcl2test
45 changes: 45 additions & 0 deletions .github/workflows/L2-PersistentStore.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: L2-PersistentStore

on:
push:
paths:
- PersistentStore/**
pull_request:
paths:
- PersistentStore/**

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
path: ${{github.repository}}

- name: Install cmake, sqlite, protoc, grpc_cpp_plugin, grpc
run: |
sudo apt update
sudo apt install -y cmake libsqlite3-dev protobuf-compiler protobuf-compiler-grpc libgrpc++-dev
- name: Build Thunder
working-directory: ${{github.workspace}}
run: sh +x ${GITHUB_REPOSITORY}/.github/workflows/BuildThunder.sh

- name: Build
working-directory: ${{github.workspace}}
run: |
cmake -S ${GITHUB_REPOSITORY}/PersistentStore -B build/PersistentStore -DCMAKE_INSTALL_PREFIX="install/usr" -DCMAKE_CXX_FLAGS="-Wall -Werror" -DPLUGIN_PERSISTENTSTORE_PATH="/tmp/persistentstore/l2test/test"
cmake --build build/PersistentStore --target install
# (Optional)
# Thunder startup:
# PATH=${PWD}/install/usr/bin:${PATH} LD_LIBRARY_PATH=${PWD}/install/usr/lib:${LD_LIBRARY_PATH} valgrind --tool=memcheck --log-file=valgrind_log --leak-check=yes --show-reachable=yes --track-fds=yes --fair-sched=try WPEFramework -f -c ${PWD}/install/etc/WPEFramework/config.json
# (to stop press q & enter)
# API test:
# curl -d '{"jsonrpc":"2.0","id":0,"method":"org.rdk.PersistentStore.setValue","params":{"namespace":"test","key":"key1","value":"1","ttl":100}}' http://localhost:55555/jsonrpc
# curl -d '{"jsonrpc":"2.0","id":0,"method":"org.rdk.PersistentStore.getValue","params":{"namespace":"test","key":"key1"}}' http://localhost:55555/jsonrpc
# Crash test:
# kill -SIGFPE $(pidof WPEProcess)
# Deactivate test:
# curl -d '{"jsonrpc":"2.0","id":0,"method":"Controller.1.deactivate", "params":{"callsign":"org.rdk.PersistentStore"}}' http://localhost:55555/jsonrpc
2 changes: 1 addition & 1 deletion Bluetooth/Bluetooth.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.Bluetooth"
autostart = "false"
autostart = "@PLUGIN_BLUETOOTH_AUTOSTART@"
startuporder = "@PLUGIN_BLUETOOTH_STARTUPORDER@"
2 changes: 1 addition & 1 deletion Bluetooth/Bluetooth.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (autostart false)
set (autostart ${PLUGIN_BLUETOOTH_AUTOSTART})
set (preconditions Platform)
set (callsign "org.rdk.Bluetooth")

Expand Down
1 change: 1 addition & 0 deletions Bluetooth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(PLUGIN_NAME Bluetooth)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(PLUGIN_BLUETOOTH_STARTUPORDER "" CACHE STRING "To configure startup order of Bluetooth plugin")
set(PLUGIN_BLUETOOTH_AUTOSTART false CACHE STRING "To automatically start Bluetooth plugin.")

find_package(${NAMESPACE}Plugins REQUIRED)

Expand Down
1 change: 1 addition & 0 deletions DataCapture/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(PLUGIN_NAME DataCapture)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(PLUGIN_DATACAPTURE_STARTUPORDER "" CACHE STRING "To configure startup order of DataCapture plugin")
set(PLUGIN_DATACAPTURE_AUTOSTART false CACHE STRING "To automatically start DataCapture plugin.")

find_package(${NAMESPACE}Plugins REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion DataCapture/DataCapture.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.dataCapture"
autostart = "false"
autostart = "@PLUGIN_DATACAPTURE_AUTOSTART@"
startuporder = "@PLUGIN_DATACAPTURE_STARTUPORDER@"
2 changes: 1 addition & 1 deletion DataCapture/DataCapture.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (autostart false)
set (autostart ${PLUGIN_DATACAPTURE_AUTOSTART})
set (preconditions Platform)
set (callsign org.rdk.dataCapture)

Expand Down
1 change: 1 addition & 0 deletions DeviceDiagnostics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(PLUGIN_NAME DeviceDiagnostics)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(PLUGIN_DEVICEDIAGNOSTICS_STARTUPORDER "" CACHE STRING "To configure startup order of DeviceDiagnostics plugin")
set(PLUGIN_DEVICEDIAGNOSTICS_AUTOSTART false CACHE STRING "To automatically start DeviceDiagnostics plugin.")

find_package(${NAMESPACE}Plugins REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion DeviceDiagnostics/DeviceDiagnostics.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.DeviceDiagnostics"
autostart = "false"
autostart = "@PLUGIN_DEVICEDIAGNOSTICS_AUTOSTART@"
startuporder = "@PLUGIN_DEVICEDIAGNOSTICS_STARTUPORDER@"
2 changes: 1 addition & 1 deletion DeviceDiagnostics/DeviceDiagnostics.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (autostart false)
set (autostart ${PLUGIN_DEVICEDIAGNOSTICS_AUTOSTART})
set (preconditions Platform)
set (callsign "org.rdk.DeviceDiagnostics")

Expand Down
76 changes: 50 additions & 26 deletions DeviceIdentification/Implementation/Broadcom/Broadcom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,39 +78,63 @@ class DeviceImplementation : public PluginHost::ISubSystem::IIdentifier {
private:
inline void UpdateDeviceInfo(string& identifier, string& chipset, string& firmwareVersion) const
{
static constexpr uint8_t MaxInfoCollection = 3;
static constexpr const TCHAR ChipsetKey[] = _T("Chip ID");
static constexpr const TCHAR IdentifierKey[] = _T("CHIPID");
static constexpr const TCHAR FirmwareVersionKey[] = _T("Nexus Release");
identifier.assign(extractSerialNumber());
chipset.assign(extractChipId());
firmwareVersion.assign(extractFirmwareVersion());
}

inline std::string extractSerialNumber() const
{
std::string serialNumber;
std::ifstream serialNumberFile("/proc/device-tree/serial-number");

if (serialNumberFile.is_open())
{
getline(serialNumberFile,serialNumber);
serialNumberFile.close();
}

return serialNumber;
}

inline std::string extractChipId() const
{
std::string chipId;
std::ifstream chipIdFile("/proc/device-tree/model");

if (chipIdFile.is_open())
{
getline(chipIdFile, chipId);
chipIdFile.close();
}

return chipId;
}

inline std::string extractFirmwareVersion() const
{
std::string versionIdentifier("VERSION");
std::ifstream versionFile("/version.txt");
std::string line;
std::ifstream file(PlatformFile);
uint32_t collectedInfo = 0;

if (file.is_open()) {
while (getline(file, line) && (collectedInfo < MaxInfoCollection)) {
if ((identifier.empty() == true) && (line.find(IdentifierKey) != std::string::npos)) {
std::size_t position = line.find(IdentifierKey) + sizeof(IdentifierKey);
if (position != std::string::npos) {
identifier.assign(line.substr(position, line.find(']')-position));
collectedInfo++;
}
} else if ((chipset.empty() == true) && (line.find(ChipsetKey) != std::string::npos)) {
std::size_t position = line.find(ChipsetKey) + sizeof(ChipsetKey);
if (position != std::string::npos) {
chipset.assign(line.substr(position, std::string::npos));
collectedInfo++;
}
} else if ((firmwareVersion.empty() == true) &&
(line.find(FirmwareVersionKey) != std::string::npos)) {
std::size_t position = line.find(FirmwareVersionKey) + sizeof(FirmwareVersionKey);
if (position != std::string::npos) {
std::string firmwareVersion;

if (versionFile.is_open())
{
while (getline(versionFile, line))
{
if (0 == line.find(versionIdentifier))
{
std::size_t position = line.find(versionIdentifier) + versionIdentifier.length() + 1; // +1 is to skip '='
if (position != std::string::npos)
{
firmwareVersion.assign(line.substr(position, std::string::npos));
collectedInfo++;
}
}
}
versionFile.close();
}

return firmwareVersion;
}

private:
Expand Down
9 changes: 9 additions & 0 deletions DisplaySettings/DisplaySettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5593,6 +5593,15 @@ void DisplaySettings::sendMsgThread()
m_timer.stop();
}
}

if(!isCecEnabled){
try {
isCecEnabled = getHdmiCecSinkCecEnableStatus();
}
catch (const device::Exception& err){
LOG_DEVICE_EXCEPTION1(string("HDMI_ARC0"));
}
}

if(m_subscribed) {
//Need to send power on request as this timer might have started based on standby out or boot up scenario
Expand Down
1 change: 1 addition & 0 deletions FrameRate/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(PLUGIN_NAME FrameRate)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(PLUGIN_FRAMERATE_STARTUPORDER "" CACHE STRING "To configure startup order of FrameRate plugin")
set(PLUGIN_FRAMERATE_AUTOSTART false CACHE STRING "To automatically start FrameRate plugin.")

find_package(${NAMESPACE}Plugins REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion FrameRate/FrameRate.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.FrameRate"
autostart = "false"
autostart = "@PLUGIN_FRAMERATE_AUTOSTART@"
startuporder = "@PLUGIN_FRAMERATE_STARTUPORDER@"
2 changes: 1 addition & 1 deletion FrameRate/FrameRate.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (autostart false)
set (autostart ${PLUGIN_FRAMERATE_AUTOSTART})
set (preconditions Platform)
set (callsign "org.rdk.FrameRate")

Expand Down
1 change: 1 addition & 0 deletions FrontPanel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(PLUGIN_NAME FrontPanel)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(PLUGIN_FRONTPANEL_STARTUPORDER "" CACHE STRING "To configure startup order of FrontPanel plugin")
set(PLUGIN_FRONTPANEL_AUTOSTART false CACHE STRING "To automatically start FrontPanel plugin.")

find_package(${NAMESPACE}Plugins REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion FrontPanel/FrontPanel.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.FrontPanel"
autostart = "false"
autostart = "@PLUGIN_FRONTPANEL_AUTOSTART@"
startuporder = "@PLUGIN_FRONTPANEL_STARTUPORDER@"
2 changes: 1 addition & 1 deletion FrontPanel/FrontPanel.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (autostart false)
set (autostart ${PLUGIN_FRONTPANEL_AUTOSTART})
set (preconditions Platform)
set (callsign "org.rdk.FrontPanel")

Expand Down
1 change: 1 addition & 0 deletions HdmiCec_2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(PLUGIN_NAME HdmiCec_2)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(PLUGIN_HDMICEC2_STARTUPORDER "" CACHE STRING "To configure startup order of HdmiCec_2 plugin")
set(PLUGIN_HDMICEC2_AUTOSTART false CACHE STRING "To automatically start HdmiCec_2 plugin.")
set_source_files_properties(HdmiCec_2.cpp PROPERTIES COMPILE_FLAGS "-fexceptions")

find_package(${NAMESPACE}Plugins REQUIRED)
Expand Down
2 changes: 1 addition & 1 deletion HdmiCec_2/HdmiCec_2.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.HdmiCec_2"
autostart = "false"
autostart = "@PLUGIN_HDMICEC2_AUTOSTART@"
startuporder = "@PLUGIN_HDMICEC2_STARTUPORDER@"
2 changes: 1 addition & 1 deletion HdmiCec_2/HdmiCec_2.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (autostart false)
set (autostart ${PLUGIN_HDMICEC2_AUTOSTART})
set (preconditions Platform)
set (callsign "org.rdk.HdmiCec_2")

Expand Down
1 change: 1 addition & 0 deletions LoggingPreferences/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(PLUGIN_NAME LoggingPreferences)
set(MODULE_NAME ${NAMESPACE}${PLUGIN_NAME})

set(PLUGIN_LOGGINGPREFERENCE_STARTUPORDER "" CACHE STRING "To configure startup order of LoggingPreferences plugin")
set(PLUGIN_LOGGINGPREFERENCES_AUTOSTART false CACHE STRING "To automatically start LoggingPreferences plugin.")

find_package(${NAMESPACE}Plugins REQUIRED)

Expand Down
2 changes: 1 addition & 1 deletion LoggingPreferences/LoggingPreferences.conf.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
precondition = ["Platform"]
callsign = "org.rdk.LoggingPreferences"
autostart = "false"
autostart = "@PLUGIN_LOGGINGPREFERENCES_AUTOSTART@"
startuporder = "@PLUGIN_LOGGINGPREFERENCE_STARTUPORDER@"
2 changes: 1 addition & 1 deletion LoggingPreferences/LoggingPreferences.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set (autostart false)
set (autostart ${PLUGIN_LOGGINGPREFERENCES_AUTOSTART})
set (preconditions Platform)
set (callsign "org.rdk.LoggingPreferences")

Expand Down
Loading

0 comments on commit 5c16325

Please sign in to comment.