Skip to content

Feature/rdkemw 9659 device settings client library - #211

Open
ManimaranRenganathan wants to merge 16 commits into
developfrom
feature/RDKEMW-9659-DeviceSettings-ClientLibrary
Open

Feature/rdkemw 9659 device settings client library#211
ManimaranRenganathan wants to merge 16 commits into
developfrom
feature/RDKEMW-9659-DeviceSettings-ClientLibrary

Conversation

@ManimaranRenganathan

Copy link
Copy Markdown

No description provided.

@ManimaranRenganathan
ManimaranRenganathan requested a review from a team as a code owner February 4, 2026 08:12
Copilot AI review requested due to automatic review settings February 4, 2026 08:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Thunder COM-RPC based Front Panel Display (FPD) client implementation and introduces build-time selection between the existing IARM implementation and the new Thunder path.

Changes:

  • Added dsFPD-com.cpp implementing the dsFPD C API via Thunder Exchange::IDeviceSettingsFPD.
  • Added conditional build selection for FPD source (dsFPD.c vs dsFPD-com.cpp) and Thunder linking in rpc/cli/Makefile.am and rpc/cli/Makefile.
  • Added --enable-thunder-plugin configure option and automake conditional in configure.ac.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

File Description
rpc/cli/dsFPD-com.cpp New Thunder COM-RPC backed implementation of dsFPD APIs.
rpc/cli/Makefile.am Automake conditional to choose Thunder vs IARM FPD source and link Thunder libs.
rpc/cli/Makefile Manual build conditional for Thunder vs IARM and conditional linking.
configure.ac Adds --enable-thunder-plugin flag + conditional and macro definition.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rpc/cli/dsFPD-com.cpp Outdated
Comment thread rpc/cli/dsFPD-com.cpp Outdated
Comment thread rpc/cli/dsFPD-com.cpp Outdated
Comment thread rpc/cli/dsFPD-com.cpp
Comment on lines +437 to +441
// Wait for plugin to become operational
if (!instance->WaitForOperational(5000)) {
fprintf(stderr, "[dsFPD-com] DeviceSettings plugin not operational after 5 seconds\n");
return dsERR_GENERAL;
}

Copilot AI Feb 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dsFPInit() blocks up to 5 seconds waiting for WaitForOperational(). Callers already implement retry loops (e.g., ds/frontPanelConfig.cpp retries dsFPInit up to 20 times), so this can amplify startup latency to ~100 seconds. Consider making dsFPInit non-blocking/shorter (or detect repeated init attempts and avoid the full wait) so higher-level retry logic controls timing.

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/Makefile
Comment on lines +25 to +34
# Conditional compilation: Thunder vs IARM
ifdef USE_WPE_THUNDER_PLUGIN
# Thunder mode - use dsFPD-com.cpp, exclude dsFPD.c
OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
OBJS += $(patsubst %.c,%.o,$(filter-out dsFPD.c,$(wildcard *.c)))
else
# IARM mode - use dsFPD.c, exclude dsFPD-com.cpp
OBJS := $(patsubst %.cpp,%.o,$(filter-out dsFPD-com.cpp,$(wildcard *.cpp)))
OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
endif

Copilot AI Feb 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When USE_WPE_THUNDER_PLUGIN is set, the build switches to dsFPD-com.cpp but does not add -DUSE_WPE_THUNDER_PLUGIN to the compiler flags. Because dsFPD-com.cpp wraps all symbols in #ifdef USE_WPE_THUNDER_PLUGIN, it will compile to an empty object and the FPD C API symbols will be missing (and dsFPD.c is excluded). Add the define to CFLAGS/CPPFLAGS in this branch (or remove the #ifdef from dsFPD-com.cpp and rely on build selection).

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/Makefile

# Conditional linking flags
ifdef USE_WPE_THUNDER_PLUGIN
LDLIBS := -lWPEFrameworkCore -lWPEFrameworkCOM

Copilot AI Feb 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Thunder mode, LDLIBS is set to only -lWPEFrameworkCore/-lWPEFrameworkCOM, but most of the CLI objects (e.g., dsAudio.c/dsDisplay.c/dsHost.cpp) still call IARM_Bus_* APIs. Dropping -lIARMBus can lead to undefined-symbol failures at link/load time. Include -lIARMBus in Thunder mode as well (or gate the other IARM-based sources behind the same feature flag).

Suggested change
LDLIBS := -lWPEFrameworkCore -lWPEFrameworkCOM
LDLIBS := -lWPEFrameworkCore -lWPEFrameworkCOM -lIARMBus

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/Makefile.am Outdated
Comment thread configure.ac
Comment on lines +62 to +63
[AC_DEFINE([USE_WPE_THUNDER_PLUGIN], [1], [Define to 1 to enable Thunder COM-RPC plugin support])
AC_MSG_NOTICE([Thunder COM-RPC plugin support enabled])],

Copilot AI Feb 4, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--enable-thunder-plugin only AC_DEFINEs USE_WPE_THUNDER_PLUGIN into cfg/config.h, but no source in this repo includes config.h and the build files don’t add -DUSE_WPE_THUNDER_PLUGIN, so the option will not actually enable the Thunder codepaths. Also, enabling this feature doesn’t check for required Thunder headers/libs (WPEFrameworkCore/COM), so configure can succeed and fail later at build/link. Consider adding proper detection (PKG_CHECK_MODULES/AC_CHECK_LIB+AC_CHECK_HEADERS) and exporting the needed CPPFLAGS/LIBS when enabled.

Suggested change
[AC_DEFINE([USE_WPE_THUNDER_PLUGIN], [1], [Define to 1 to enable Thunder COM-RPC plugin support])
AC_MSG_NOTICE([Thunder COM-RPC plugin support enabled])],
[PKG_CHECK_MODULES([THUNDER],
[WPEFrameworkCore WPEFrameworkCOM],
[AC_DEFINE([USE_WPE_THUNDER_PLUGIN], [1], [Define to 1 to enable Thunder COM-RPC plugin support])
AC_MSG_NOTICE([Thunder COM-RPC plugin support enabled])],
[AC_MSG_ERROR([Thunder COM-RPC plugin support requested, but WPEFrameworkCore and/or WPEFrameworkCOM were not found])])],

Copilot uses AI. Check for mistakes.
Manimaran Renganathan added 2 commits February 4, 2026 16:39
1. Created the dsConnectionManager.cpp, dsConnectionManager.h and dsHdmiIn-com.cpp files
2. Modified the dsFPD-com.cpp file

with SmartInterfaceType to get the common interface from FPD and using QueryInterface to get the interface handle for other component like HdmiIn, CompositeIn, etc.,
Copilot AI review requested due to automatic review settings February 5, 2026 05:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 16 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rpc/cli/dsFPD-com.cpp

dsError_t dsSetFPDBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t eBrightness, bool toPersist)
{
if (eIndicator >= dsFPD_INDICATOR_MAX || eBrightness > 100) {

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The brightness parameter is validated as eBrightness > 100, but dsFPDBrightness_t is likely an enum type, not a percentage value. This validation may be incorrect. Check the definition of dsFPDBrightness_t - if it's an enum with values like dsFPD_BRIGHTNESS_MIN, dsFPD_BRIGHTNESS_MAX, etc., the validation should check against the enum max value, not 100.

Suggested change
if (eIndicator >= dsFPD_INDICATOR_MAX || eBrightness > 100) {
if (eIndicator >= dsFPD_INDICATOR_MAX || eBrightness >= dsFPD_BRIGHTNESS_MAX) {

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment thread rpc/cli/dsConnectionManager.cpp
Comment thread cov_build.sh
export STANDALONE_BUILD_ENABLED=y
export DS_MGRS=$WORKDIR

export USE_WPE_THUNDER_PLUGIN=y

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cov_build.sh script exports USE_WPE_THUNDER_PLUGIN=y but doesn't pass it as a compiler flag. The Makefile checks for USE_WPE_THUNDER_PLUGIN using ifdef, which checks if the variable is defined in the make environment or as a make variable, not as a shell environment variable. Either export it as a make variable using "export USE_WPE_THUNDER_PLUGIN" in the Makefile, or pass it to make using "make USE_WPE_THUNDER_PLUGIN=y", or add -DUSE_WPE_THUNDER_PLUGIN to CFLAGS.

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsFPD-com.cpp
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2016 RDK Management

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copyright year is listed as 2016, but this is a new file being added in 2025. The copyright year should be 2025 to reflect when the file was created, as seen in dsHdmiIn-com.cpp (line 5) and dsConnectionManager files.

Suggested change
* Copyright 2016 RDK Management
* Copyright 2025 RDK Management

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsFPD-com.cpp
Comment on lines +131 to +132
// Note: Interface expects minutes and seconds, but API provides hour and minutes
// Converting: treating uMinutes as seconds for interface compatibility

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "treating uMinutes as seconds for interface compatibility" which suggests a potential parameter mapping issue. The function signature uses uHour and uMinutes, but the comment indicates uMinutes is being treated as seconds when passed to SetFPDTime. This could lead to incorrect time display. Verify that the Thunder interface expects (hours, minutes) as stated in the function parameters, not (minutes, seconds) as the comment suggests.

Suggested change
// Note: Interface expects minutes and seconds, but API provides hour and minutes
// Converting: treating uMinutes as seconds for interface compatibility
// Note: Thunder interface expects hour and minutes, matching the dsSetFPTime API
// Parameters are passed through directly without conversion

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsFPD-com.cpp
Exchange::IDeviceSettingsFPD::FPDIndicator indicator =
static_cast<Exchange::IDeviceSettingsFPD::FPDIndicator>(eIndicator);

// Thunder interface doesn't support persist flag - ignore it

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The persist/toPersist flag is being ignored in the Thunder implementation. The comment on line 356 states "Thunder interface doesn't support persist flag - ignore it", but this means the behavior differs from the original IARM implementation where persist affects whether settings are saved permanently. Consider documenting this limitation more prominently or implementing persistence through an alternative mechanism if it's critical functionality.

Suggested change
// Thunder interface doesn't support persist flag - ignore it
// NOTE: Thunder IDeviceSettingsFPD interface does not support a persist flag.
// The toPersist parameter is kept for API compatibility with the IARM
// implementation but is not honored here: settings are always applied in
// the same way regardless of the flag, and persistence behavior (if any)
// is determined solely by the Thunder implementation.
if (!toPersist) {
fprintf(stderr,
"[dsFPD-com] Warning: persist flag is not supported in Thunder "
"implementation; applying FPD color without persistence control\n");
}

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsHdmiIn-com.cpp
Copilot AI review requested due to automatic review settings February 5, 2026 07:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rpc/cli/dsFPD-com.cpp
Comment on lines +383 to +405
dsError_t dsSetFPState(dsFPDIndicator_t eIndicator, dsFPDState_t state)
{
ConnectionManager* connMgr = ConnectionManager::Instance();
if (!connMgr || !connMgr->IsOperational()) {
return dsERR_GENERAL;
}

Exchange::IDeviceSettingsFPD* fpdInterface = connMgr->GetFPDInterface();
if (!fpdInterface) {
return dsERR_GENERAL;
}

Exchange::IDeviceSettingsFPD::FPDIndicator indicator =
static_cast<Exchange::IDeviceSettingsFPD::FPDIndicator>(eIndicator);
Exchange::IDeviceSettingsFPD::FPDState fpdState =
static_cast<Exchange::IDeviceSettingsFPD::FPDState>(state);

ConnectionManager::Lock();
uint32_t result = fpdInterface->SetFPDState(indicator, fpdState);
ConnectionManager::Unlock();

return ConvertThunderError(result);
}

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent input validation: dsSetFPDBrightness validates eIndicator and eBrightness parameters, but similar setter functions like dsSetFPState, dsSetFPDColor, and dsSetFPTextBrightness do not validate their input parameters before casting and using them. Consider adding consistent validation across all setter functions to prevent invalid enum values from being passed to the Thunder interface.

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsConnectionManager.cpp
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment thread rpc/cli/Makefile
Comment on lines +36 to +37
#OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
#OBJS += $(patsubst %.c,%.o,$(wildcard *.c))

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commented-out lines should be removed rather than left as comments. Dead code in makefiles can cause confusion about the actual build logic.

Suggested change
#OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
#OBJS += $(patsubst %.c,%.o,$(wildcard *.c))

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment thread rpc/cli/Makefile
Comment thread rpc/cli/Makefile
Comment on lines +46 to +51
# Conditional linking flags
ifdef USE_WPE_THUNDER_PLUGIN
LDLIBS := -lWPEFrameworkCore -lWPEFrameworkCOM
else
LDLIBS := -lIARMBus
endif

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When USE_WPE_THUNDER_PLUGIN is set as an environment variable or make variable, the Makefile correctly adjusts OBJS and LDLIBS. However, the C/C++ preprocessor directives in the source code also check for USE_WPE_THUNDER_PLUGIN. The Makefile should add -DUSE_WPE_THUNDER_PLUGIN to CFLAGS when this variable is set, otherwise the source files won't be compiled with the correct preprocessor definition.

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsFPD-com.cpp
Copilot AI review requested due to automatic review settings February 5, 2026 09:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment on lines +154 to +159

// TODO: Handle portConnectionStatus iterator if needed
if (portConnectionStatus) {
portConnectionStatus->Release();
}
}

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential memory leak: if the interface method GetHDMIInStatus sets portConnectionStatus to a non-null value but returns an error, the iterator will not be released. The Release() call should be moved outside the result check to ensure cleanup in all cases, or there should be an else branch to handle the error case.

Suggested change
// TODO: Handle portConnectionStatus iterator if needed
if (portConnectionStatus) {
portConnectionStatus->Release();
}
}
}
// TODO: Handle portConnectionStatus iterator if needed
if (portConnectionStatus) {
portConnectionStatus->Release();
}

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment on lines +71 to +75
ConnectionManager* connMgr = ConnectionManager::Instance();
if (!connMgr) {
ConnectionManager::Init();
connMgr = ConnectionManager::Instance();
}

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential race condition in ConnectionManager initialization. Lines 71-75 check if the instance exists, then call Init() if it doesn't, then get the instance again. However, there's no locking between the first Instance() check and the Init() call. If two threads call dsHdmiInInit() simultaneously, both could see a null instance and both could call Init(), potentially creating the instance twice. While ConnectionManager::Init() has internal locking, the pattern here should either be: (1) always call Init() which is idempotent, or (2) use a lock around this entire sequence.

Suggested change
ConnectionManager* connMgr = ConnectionManager::Instance();
if (!connMgr) {
ConnectionManager::Init();
connMgr = ConnectionManager::Instance();
}
ConnectionManager::Init();
ConnectionManager* connMgr = ConnectionManager::Instance();

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment on lines +625 to +660
dsError_t dsHdmiInRegisterSignalChangeCB(dsHdmiInSignalChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterSignalChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterStatusChangeCB(dsHdmiInStatusChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterStatusChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterVideoModeUpdateCB(dsHdmiInVideoModeUpdateCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterVideoModeUpdateCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterAllmChangeCB(dsHdmiInAllmChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAllmChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterAVLatencyChangeCB(dsAVLatencyChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAVLatencyChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterAviContentTypeChangeCB(dsHdmiInAviContentTypeChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAviContentTypeChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused parameter warning suppression missing. The CBFunc parameters in all these callback registration stub functions (lines 625-660) are not used. To avoid compiler warnings, each unused parameter should be marked with (void)CBFunc or use an attribute like [[maybe_unused]] or attribute((unused)).

Copilot uses AI. Check for mistakes.
Comment thread cov_build.sh

echo "##### Triggering make"
make CFLAGS+='-fPIC -DDSMGR_LOGGER_ENABLED=ON -DRDK_DSHAL_NAME=\"libdshal.so\" -I${DS_IF_PATH}/include -I${DS_HAL_PATH} -I${DS_MGRS}/stubs -I${IARMBUS_PATH}/core -I${IARMBUS_PATH}/core/include -I${IARM_MGRS}/sysmgr/include -I${DS_MGRS}/ds/include -I${DS_MGRS}/rpc/include -I${POWER_IF_PATH}/include/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I${IARM_MGRS}/mfr/include/ -I${IARM_MGRS}/mfr/common -I${DEEPSLEEP_IF_PATH}/include -I${IARM_MGRS}/hal/include -I${IARM_MGRS}/power -I${IARM_MGRS}/power/include' LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -L/usr/local/include -lglib-2.0 -lIARMBus -lWPEFrameworkPowerController -ldshal" No newline at end of file
make CFLAGS+='-fPIC -DDSMGR_LOGGER_ENABLED=ON -DRDK_DSHAL_NAME=\"libdshal.so\" -I${DS_IF_PATH}/include -I${DS_HAL_PATH} -I${DS_MGRS}/stubs -I${IARMBUS_PATH}/core -I${IARMBUS_PATH}/core/include -I${IARM_MGRS}/sysmgr/include -I${DS_MGRS}/ds/include -I${DS_MGRS}/rpc/include -I${POWER_IF_PATH}/include/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I${IARM_MGRS}/mfr/include/ -I${IARM_MGRS}/mfr/common -I${DEEPSLEEP_IF_PATH}/include -I${IARM_MGRS}/hal/include -I${IARM_MGRS}/power -I${IARM_MGRS}/power/include' LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -L/usr/local/include -lglib-2.0 -lIARMBus -lWPEFrameworkPowerController -ldshal"

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The USE_WPE_THUNDER_PLUGIN environment variable is set on line 69, but the macro definition is not passed to the compiler in CFLAGS on line 75. The CFLAGS should include -DUSE_WPE_THUNDER_PLUGIN to ensure the conditional compilation directives (#ifdef USE_WPE_THUNDER_PLUGIN) in the source files work correctly. Without this, the Thunder code paths won't be compiled even though USE_WPE_THUNDER_PLUGIN is exported.

Suggested change
make CFLAGS+='-fPIC -DDSMGR_LOGGER_ENABLED=ON -DRDK_DSHAL_NAME=\"libdshal.so\" -I${DS_IF_PATH}/include -I${DS_HAL_PATH} -I${DS_MGRS}/stubs -I${IARMBUS_PATH}/core -I${IARMBUS_PATH}/core/include -I${IARM_MGRS}/sysmgr/include -I${DS_MGRS}/ds/include -I${DS_MGRS}/rpc/include -I${POWER_IF_PATH}/include/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I${IARM_MGRS}/mfr/include/ -I${IARM_MGRS}/mfr/common -I${DEEPSLEEP_IF_PATH}/include -I${IARM_MGRS}/hal/include -I${IARM_MGRS}/power -I${IARM_MGRS}/power/include' LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -L/usr/local/include -lglib-2.0 -lIARMBus -lWPEFrameworkPowerController -ldshal"
make CFLAGS+='-fPIC -DDSMGR_LOGGER_ENABLED=ON -DUSE_WPE_THUNDER_PLUGIN -DRDK_DSHAL_NAME=\"libdshal.so\" -I${DS_IF_PATH}/include -I${DS_HAL_PATH} -I${DS_MGRS}/stubs -I${IARMBUS_PATH}/core -I${IARMBUS_PATH}/core/include -I${IARM_MGRS}/sysmgr/include -I${DS_MGRS}/ds/include -I${DS_MGRS}/rpc/include -I${POWER_IF_PATH}/include/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I${IARM_MGRS}/mfr/include/ -I${IARM_MGRS}/mfr/common -I${DEEPSLEEP_IF_PATH}/include -I${IARM_MGRS}/hal/include -I${IARM_MGRS}/power -I${IARM_MGRS}/power/include' LDFLAGS="-L/usr/lib/x86_64-linux-gnu/ -L/usr/local/include -lglib-2.0 -lIARMBus -lWPEFrameworkPowerController -ldshal"

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsHdmiIn-com.cpp

int32_t count = 0;
ConnectionManager::Lock();
uint32_t result = hdmiInInterface->GetHDMIInNumbefOfInputs(count);

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method name "GetHDMIInNumbefOfInputs" contains a typo. "Numbef" should be "NumberOf". This appears to be calling an interface method, so if this typo exists in the interface definition, it should be fixed there as well.

Suggested change
uint32_t result = hdmiInInterface->GetHDMIInNumbefOfInputs(count);
uint32_t result = hdmiInInterface->GetHDMIInNumberOfInputs(count);

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsFPD-com.cpp
Comment on lines +131 to +133
// Note: Interface expects minutes and seconds, but API provides hour and minutes
// Converting: treating uMinutes as seconds for interface compatibility
uint32_t result = fpdInterface->SetFPDTime(timeFormat, uHour, uMinutes);

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment indicates a potential parameter mismatch. The API receives hour and minutes (uHour, uMinutes), but the comment states the interface expects minutes and seconds. If the interface truly expects minutes and seconds, then passing uMinutes as the third parameter would be incorrect - it should be 0 or a calculated seconds value. This needs verification against the IDeviceSettingsFPD interface definition to ensure the parameters are correctly mapped.

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsFPD-com.cpp
Comment on lines +75 to +79
ConnectionManager* connMgr = ConnectionManager::Instance();
if (!connMgr) {
ConnectionManager::Init();
connMgr = ConnectionManager::Instance();
}

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential race condition in ConnectionManager initialization. Lines 75-79 check if the instance exists, then call Init() if it doesn't, then get the instance again. However, there's no locking between the first Instance() check and the Init() call. If two threads call dsFPInit() simultaneously, both could see a null instance and both could call Init(), potentially creating the instance twice. While ConnectionManager::Init() has internal locking, the pattern here should either be: (1) always call Init() which is idempotent, or (2) use a lock around this entire sequence.

Suggested change
ConnectionManager* connMgr = ConnectionManager::Instance();
if (!connMgr) {
ConnectionManager::Init();
connMgr = ConnectionManager::Instance();
}
// Initialize ConnectionManager (safe to call multiple times; handles its own locking)
ConnectionManager::Init();
ConnectionManager* connMgr = ConnectionManager::Instance();

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsFPD-com.cpp
Comment on lines +180 to +198
dsError_t dsGetFPBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t *pBrightness)
{
if (pBrightness == NULL) {
fprintf(stderr, "[dsFPD-com] Invalid parameter: pBrightness is NULL\n");
return dsERR_INVALID_PARAM;
}

ConnectionManager* connMgr = ConnectionManager::Instance();
if (!connMgr || !connMgr->IsOperational()) {
return dsERR_GENERAL;
}

Exchange::IDeviceSettingsFPD* fpdInterface = connMgr->GetFPDInterface();
if (!fpdInterface) {
return dsERR_GENERAL;
}

Exchange::IDeviceSettingsFPD::FPDIndicator indicator =
static_cast<Exchange::IDeviceSettingsFPD::FPDIndicator>(eIndicator);

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing input validation for eIndicator parameter. The dsSetFPDBrightness function validates that eIndicator is less than dsFPD_INDICATOR_MAX (line 225), but dsGetFPBrightness does not perform this validation. For consistency and safety, the eIndicator parameter should be validated in all functions that use it, including getter functions, to prevent invalid enum values from being cast and passed to the interface.

Copilot uses AI. Check for mistakes.
Comment thread rpc/cli/dsHdmiIn-com.cpp
Comment on lines +621 to +657
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterConnectCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterSignalChangeCB(dsHdmiInSignalChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterSignalChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterStatusChangeCB(dsHdmiInStatusChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterStatusChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterVideoModeUpdateCB(dsHdmiInVideoModeUpdateCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterVideoModeUpdateCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterAllmChangeCB(dsHdmiInAllmChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAllmChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterAVLatencyChangeCB(dsAVLatencyChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAVLatencyChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}

dsError_t dsHdmiInRegisterAviContentTypeChangeCB(dsHdmiInAviContentTypeChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAviContentTypeChangeCB not supported in Thunder mode\n");

Copilot AI Feb 5, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused parameter warning suppression missing. The CBFunc parameter is not used in this function (it's a stub that returns OPERATION_NOT_SUPPORTED). To avoid compiler warnings, the parameter should either be marked with (void)CBFunc or use an attribute like [[maybe_unused]] or attribute((unused)).

Suggested change
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterConnectCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterSignalChangeCB(dsHdmiInSignalChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterSignalChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterStatusChangeCB(dsHdmiInStatusChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterStatusChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterVideoModeUpdateCB(dsHdmiInVideoModeUpdateCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterVideoModeUpdateCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterAllmChangeCB(dsHdmiInAllmChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAllmChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterAVLatencyChangeCB(dsAVLatencyChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAVLatencyChangeCB not supported in Thunder mode\n");
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterAviContentTypeChangeCB(dsHdmiInAviContentTypeChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAviContentTypeChangeCB not supported in Thunder mode\n");
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterConnectCB not supported in Thunder mode\n");
(void)CBFunc;
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterSignalChangeCB(dsHdmiInSignalChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterSignalChangeCB not supported in Thunder mode\n");
(void)CBFunc;
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterStatusChangeCB(dsHdmiInStatusChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterStatusChangeCB not supported in Thunder mode\n");
(void)CBFunc;
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterVideoModeUpdateCB(dsHdmiInVideoModeUpdateCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterVideoModeUpdateCB not supported in Thunder mode\n");
(void)CBFunc;
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterAllmChangeCB(dsHdmiInAllmChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAllmChangeCB not supported in Thunder mode\n");
(void)CBFunc;
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterAVLatencyChangeCB(dsAVLatencyChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAVLatencyChangeCB not supported in Thunder mode\n");
(void)CBFunc;
return dsERR_OPERATION_NOT_SUPPORTED;
}
dsError_t dsHdmiInRegisterAviContentTypeChangeCB(dsHdmiInAviContentTypeChangeCB_t CBFunc)
{
fprintf(stderr, "[dsHdmiIn-com] dsHdmiInRegisterAviContentTypeChangeCB not supported in Thunder mode\n");
(void)CBFunc;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants