Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/thunder/ctrlm_thunder_plugin_powermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ bool ctrlm_thunder_plugin_powermanager_t::get_wakeup_reason_voice() {

sem_wait(&this->semaphore);
if(this->call_plugin("getLastWakeupReason", (void *)&params, (void *)&response)) {
wakeup_reason_voice = (0 == strncmp(response["result"].String().c_str(), "VOICE", 5));
wakeup_reason_voice = (response["result"].String() == "WAKEUP_REASON_VOICE");
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

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

The wakeup reason check changed from a prefix match on "VOICE" to strict equality with "WAKEUP_REASON_VOICE". In this file’s own curl example, getLastWakeupReason returns plain strings like "COLDBOOT", and there are no other references in the repo to a "WAKEUP_REASON_VOICE" value; as written this will likely never evaluate true and break voice-wakeup detection. Consider comparing against the actual PowerManager response value(s) (e.g., "VOICE" / other documented strings) or preserving the previous prefix/enum-style match if multiple VOICE-related reasons are expected.

Suggested change
wakeup_reason_voice = (response["result"].String() == "WAKEUP_REASON_VOICE");
string wakeup_reason = response["result"].String();
wakeup_reason_voice = (wakeup_reason == "VOICE") ||
(wakeup_reason.rfind("VOICE", 0) == 0) ||
(wakeup_reason.rfind("WAKEUP_REASON_VOICE", 0) == 0);

Copilot uses AI. Check for mistakes.
XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE");
} else {
XLOGD_ERROR("getLastWakeupReason call failed");
Expand Down
Loading