Skip to content

Update ctrlm_thunder_plugin_powermanager.cpp - #193

Open
jthomp007c wants to merge 8 commits into
support/1.1.11from
topic/RDKEMW-16330-1
Open

Update ctrlm_thunder_plugin_powermanager.cpp#193
jthomp007c wants to merge 8 commits into
support/1.1.11from
topic/RDKEMW-16330-1

Conversation

@jthomp007c

Copy link
Copy Markdown
Contributor

No description provided.

@jthomp007c
jthomp007c requested a review from a team as a code owner April 3, 2026 11:53
Copilot AI review requested due to automatic review settings April 3, 2026 11:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the PowerManager Thunder plugin integration to determine whether the last wakeup reason was voice-related, affecting how Control Manager interprets wake events.

Changes:

  • Changed get_wakeup_reason_voice() to use an exact-string comparison for the wakeup reason value.

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

Comment thread src/thunder/ctrlm_thunder_plugin_powermanager.cpp Outdated
Copilot AI review requested due to automatic review settings April 3, 2026 13:17

Copilot AI left a comment

Copy link
Copy Markdown

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 1 out of 1 changed files in this pull request and generated 1 comment.


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

Comment thread src/thunder/ctrlm_thunder_plugin_powermanager.cpp Outdated
Copilot AI review requested due to automatic review settings April 3, 2026 16:40

Copilot AI left a comment

Copy link
Copy Markdown

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 1 out of 1 changed files in this pull request and generated 1 comment.


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

Comment thread src/thunder/ctrlm_thunder_plugin_powermanager.cpp Outdated
Copilot AI review requested due to automatic review settings April 8, 2026 17:57

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/thunder/ctrlm_thunder_plugin.h:150

  • The call_controller docblock lists @param params twice; the second one is describing the response object and should be @param response to match the function signature (..., void *params, void *response).
     * This function is used to call a Thunder Controller method.
     * @param method The method in which the user wants to call.
     * @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash)
     * @param params The WPEFramework JsonObject containing the response from the call.  (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash)
     * @return True if the call succeeded, otherwise False.

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

Comment thread src/thunder/ctrlm_thunder_plugin.h Outdated
Comment thread src/thunder/ctrlm_thunder_plugin.h Outdated
Comment thread src/thunder/ctrlm_thunder_plugin.cpp Outdated
Comment on lines 120 to +126
} else {
XLOGD_ERROR("getLastWakeupReason call failed");
}
sem_post(&this->semaphore);

XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE");

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

voice_wakeup is now logged unconditionally, including when getLastWakeupReason fails. This can be misleading because failures will be reported as FALSE in debug logs even though the value is actually unknown. Consider logging only on success, or include an explicit "call failed"/"unknown" indication in the debug message.

Suggested change
} else {
XLOGD_ERROR("getLastWakeupReason call failed");
}
sem_post(&this->semaphore);
XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE");
XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE");
} else {
XLOGD_ERROR("getLastWakeupReason call failed");
}
sem_post(&this->semaphore);

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 8, 2026 18:18

Copilot AI left a comment

Copy link
Copy Markdown

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 3 out of 3 changed files in this pull request and generated 2 comments.


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

* This function is used to get a Thunder Plugin property.
* @param method The method in which the user wants to call.
* @param params The WPEFramework JsonObject containing the parameters for the call. (We can't include WPEFramework headers in controlMgr .h files as their logging macros clash)
* @param property The property the user wants to get

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

Docstring punctuation/grammar: add a trailing period to the @param property description to match the surrounding documentation style.

Suggested change
* @param property The property the user wants to get
* @param property The property the user wants to get.

Copilot uses AI. Check for mistakes.
Comment on lines +287 to +297
bool ctrlm_thunder_plugin_t::call_plugin_string(std::string method, void *params, std::string *response) {
bool ret = false;
auto clientObject = (JSONRPC::LinkType<Core::JSON::IElement>*)this->plugin_client;
JsonObject *jsonParams = (JsonObject *)params;
if(clientObject) {
if(!method.empty() && jsonParams && response) {
Core::JSON::String jsonString;
uint32_t thunderRet = clientObject->Invoke<JsonObject, Core::JSON::String>(CALL_TIMEOUT, _T(method), *jsonParams, jsonString);
if(thunderRet != Core::ERROR_NONE) {
XLOGD_ERROR("Thunder call failed <%s> <%u>", method.c_str(), thunderRet);
} else {

Copilot AI Apr 8, 2026

Copy link

Choose a reason for hiding this comment

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

call_plugin_string largely duplicates call_plugin_boolean (client cast, parameter validation, Invoke, error handling). Consider extracting a small internal templated helper for primitive-return Invoke calls to reduce duplication and keep logging/handling consistent as more typed helpers are added.

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.

2 participants