Skip to content

Thunder team review#212

Open
ManimaranRenganathan wants to merge 5 commits intodevelopfrom
Thunder-Team-Review
Open

Thunder team review#212
ManimaranRenganathan wants to merge 5 commits intodevelopfrom
Thunder-Team-Review

Conversation

@ManimaranRenganathan
Copy link

No description provided.

@ManimaranRenganathan ManimaranRenganathan requested a review from a team as a code owner February 5, 2026 13:00
Copilot AI review requested due to automatic review settings February 5, 2026 13:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces Thunder COM-RPC support for the Front Panel Display (FPD) functionality as an alternative to the existing IARM-based implementation. The PR enables conditional compilation to support both communication frameworks.

Changes:

  • Adds new dsFPD-com.cpp implementation using Thunder COM-RPC framework
  • Implements conditional compilation in build system (Makefile, Makefile.am, configure.ac) to select between IARM and Thunder modes
  • Adds Thunder library dependencies when Thunder plugin support is enabled

Reviewed changes

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

Show a summary per file
File Description
rpc/cli/dsFPD-com.cpp New Thunder COM-RPC implementation for FPD client, providing C API wrappers around Thunder interface
rpc/cli/Makefile.am Conditional source file selection and Thunder library linking based on configuration flag
rpc/cli/Makefile Conditional object file compilation and library linking for Thunder vs IARM modes
configure.ac Adds --enable-thunder-plugin configuration option with USE_WPE_THUNDER_PLUGIN define
cov_build.sh Exports USE_WPE_THUNDER_PLUGIN environment variable for coverage builds

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

Comment on lines +36 to +37
#OBJS := $(patsubst %.cpp,%.o,$(wildcard *.cpp))
#OBJS += $(patsubst %.c,%.o,$(wildcard *.c))
Copy link

Copilot AI Feb 5, 2026

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 kept in the codebase. The version control system preserves the history, so keeping commented code creates clutter and confusion about what the intended implementation should be.

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

Copilot uses AI. Check for mistakes.
Comment on lines +66 to +79
bool _shutdown;

DeviceSettingsFPD()
: BaseClass()
, _fpdInterface(nullptr)
, _connected(false)
, _shutdown(false)
{
(void)Connect();
}

~DeviceSettingsFPD()
{
_shutdown = true;
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The _shutdown member variable is initialized and set to true in the destructor, but it's never actually used anywhere in the code. Consider removing this unused member variable to reduce code clutter.

Suggested change
bool _shutdown;
DeviceSettingsFPD()
: BaseClass()
, _fpdInterface(nullptr)
, _connected(false)
, _shutdown(false)
{
(void)Connect();
}
~DeviceSettingsFPD()
{
_shutdown = true;
DeviceSettingsFPD()
: BaseClass()
, _fpdInterface(nullptr)
, _connected(false)
{
(void)Connect();
}
~DeviceSettingsFPD()
{

Copilot uses AI. Check for mistakes.
return (nullptr != _fpdInterface);
}

inline bool isConnected() const
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The method name "isConnected" uses camelCase, which is inconsistent with the PascalCase naming convention used by other methods in this class like "IsOperational" and "IsActivatedLocked". For consistency with the class's public interface, this should be renamed to "IsConnected".

Copilot uses AI. Check for mistakes.
Comment on lines +107 to +111
inline bool IsActivatedLocked() const
{
return (nullptr != _fpdInterface);
}

Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The method "IsActivatedLocked" is defined but never called anywhere in the code. Consider removing this unused method to reduce code clutter, or if it's intended for future use, add a comment explaining its purpose.

Suggested change
inline bool IsActivatedLocked() const
{
return (nullptr != _fpdInterface);
}

Copilot uses AI. Check for mistakes.

static DeviceSettingsFPD* Instance()
{
return _instance;
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The static Instance method is not thread-safe. It returns the _instance pointer without any locking, which could lead to a race condition if called concurrently with Init or Term methods. The caller could receive a partially initialized pointer or a pointer that's being deleted. Consider acquiring _apiLock before returning the instance, or better yet, ensure callers use Init/Instance pattern within locked sections.

Suggested change
return _instance;
_apiLock.Lock();
DeviceSettingsFPD* instance = _instance;
_apiLock.Unlock();
return instance;

Copilot uses AI. Check for mistakes.
Comment on lines +483 to +485
// Note: Interface expects minutes and seconds, but API provides hour and minutes
// Converting: treating uMinutes as seconds for interface compatibility
uint32_t result = instance->SetFPDTime(timeFormat, uHour, uMinutes);
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The parameters are being incorrectly mapped. The Thunder interface expects "minutes" and "seconds" as parameters (line 217-218), but the C API provides "uHour" and "uMinutes". Currently, uHour is passed as the minutes parameter and uMinutes is passed as the seconds parameter, which will cause incorrect time values to be set. The correct mapping should convert hours and minutes to the appropriate format expected by the Thunder interface, or there's a mismatch in the interface definition that needs to be addressed.

Suggested change
// Note: Interface expects minutes and seconds, but API provides hour and minutes
// Converting: treating uMinutes as seconds for interface compatibility
uint32_t result = instance->SetFPDTime(timeFormat, uHour, uMinutes);
// Note: Interface expects minutes and seconds, but API provides hour and minutes.
// Convert hours and minutes to total minutes, and use 0 seconds (no second-level precision in API).
const uint32_t totalMinutes = (uHour * 60u) + (uMinutes % 60u);
const uint32_t seconds = 0u;
uint32_t result = instance->SetFPDTime(timeFormat, totalMinutes, seconds);

Copilot uses AI. Check for mistakes.

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

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

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

The validation check for brightness should use a comparison with dsFPDBrightness_t enum max value or a defined constant instead of hardcoding "100". This makes the code more maintainable and ensures consistency if the brightness range changes. Consider defining a constant like MAX_BRIGHTNESS or using the enum's maximum value.

Copilot uses AI. Check for mistakes.
functionalities from Standalone application
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.

1 participant