Skip to content

Rebase#155

Open
muraliselvaraj2020 wants to merge 91 commits into
feature/ES1-2965from
develop
Open

Rebase#155
muraliselvaraj2020 wants to merge 91 commits into
feature/ES1-2965from
develop

Conversation

@muraliselvaraj2020

Copy link
Copy Markdown

No description provided.

@muraliselvaraj2020
muraliselvaraj2020 requested a review from a team as a code owner December 2, 2025 16:38
Copilot AI review requested due to automatic review settings January 13, 2026 16:01

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

This pull request represents a major "rebase" effort that refactors the codebase to remove numerous compile-time flags and replace them with runtime configuration. The changes focus on voice control features, power management, and device management infrastructure.

Changes:

  • Removes compile-time flags (CTRLM_LOCAL_MIC, CTRLM_LOCAL_MIC_TAP, BEEP_ON_KWD_ENABLED, NETWORKED_STANDBY_MODE_ENABLED, etc.) and replaces them with runtime checks
  • Refactors IPC/IARM infrastructure to use a common base class with API revision management
  • Updates logging to use "AUTOMATION" variants of logging macros throughout the codebase
  • Adds controller ID range management for RF4CE and BLE networks
  • Introduces callback mechanism for audio streaming initiation
  • Updates factory test infrastructure to support dynamic audio analysis plugins

Reviewed changes

Copilot reviewed 65 out of 66 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/voice/ipc/ctrlm_voice_ipc_iarm_thunder.cpp Refactors voice IPC to use runtime feature detection, adds API revision setting
src/voice/ctrlm_voice_obj.cpp Replaces compile flags with runtime configuration for local mic and beep features
src/voice/ctrlm_voice_obj.h Adds new member variables for runtime feature flags and audio start callback support
src/rf4ce/ctrlm_rf4ce_network.cpp Major refactoring to extract audio streaming logic, add controller ID range management
src/ble/ctrlm_ble_network.cpp Similar refactoring for BLE audio streaming, adds controller ID migration logic
src/ipc/ctrlm_rcp_ipc_iarm_thunder.cpp Updates to use new broadcast_iarm_event signatures and API revision management
src/ipc/ctrlm_ipc_iarm.h/cpp Adds API revision management and refactors event broadcasting
src/factory/.c/.cpp Updates factory test infrastructure for dynamic plugin loading
CMakeLists.txt Removes numerous build options and simplifies configuration

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

Comment thread src/ctrlm_main.cpp

if(it->response != CTRLM_THREAD_MONITOR_RESPONSE_ALIVE) {
XLOGD_TELEMETRY("Thread %s is unresponsive", it->name);
XLOGD_AUTOMATION_TELEMETRY("Thread %s is unresponsive", it->name);

Copilot AI Jan 13, 2026

Copy link

Choose a reason for hiding this comment

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

The logging macro XLOGD_AUTOMATION_TELEMETRY is being used but may not be defined. This could cause compilation errors. Verify that this logging macro is properly defined in the logging infrastructure.

Copilot uses AI. Check for mistakes.
Comment on lines +205 to +209
if (it.second == CTRLM_IARM_CALL_RESULT_SUCCESS) {
return true;
}
}
return true;
return false;

Copilot AI Jan 13, 2026

Copy link

Choose a reason for hiding this comment

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

The logic change for result checking appears to be inverted. The original code returned true if all results were SUCCESS and false if any failed. The new code returns true if ANY result is SUCCESS and false if all failed. This could cause incorrect behavior when processing multiple network results.

Copilot uses AI. Check for mistakes.
Comment on lines +770 to +771
false, NULL, NULL, NULL, (fd >= 0) ? true : false, true, NULL, NULL,
str_transcription.empty() ? NULL : str_transcription.c_str(), str_audio_file.empty() ? NULL : str_audio_file.c_str(), &request_uuid, request_config.low_latency, request_config.low_cpu_util, fd);

Copilot AI Jan 13, 2026

Copy link

Choose a reason for hiding this comment

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

The function ctrlm_voice_ipc_iarm_thunder_t::voice_session_request has a complex function call signature with many parameters. Lines 770-771 add two NULL parameters before the transcription and audio file parameters. This changes the function signature but it's not clear if all call sites have been updated correctly. Verify that the function parameter order matches the declaration in the header file.

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 21, 2026 14:51

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

bool ctrlm_telemetry_event_t<std::string>::event() const {
XLOGD_TELEMETRY("telemetry event <%s, %s>", this->marker.c_str(), this->value.c_str());
return(t2_event_s((char *)this->marker.c_str(), (char *)this->value.c_str()) == T2ERROR_SUCCESS);
if (value.length() > CTRLM_TELEMETRY_MAX_EVENT_SIZE_BYTES) {
Comment on lines +317 to +321
m_end_reason_rcu = 0;
m_end_reason_session = 0;
m_end_reason_server = 0;
m_result = false;
m_ret_code_protocol = 0;
Copilot AI review requested due to automatic review settings July 13, 2026 19:08

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

Comment on lines +78 to 82
this->local_config = local_config;
ret = true;
} else {
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s>", json_error.line, json_error.column, json_error.text);
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str());
}
Comment on lines +105 to +108
json_t *append_root = json_loads(contents.c_str(), JSON_REJECT_DUPLICATES, &json_error);
if(append_root == NULL) {
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str());
} else {
Comment thread src/ctrlm_log.h
#ifdef ANSI_CODES_DISABLED
#define XLOG_OPTS_DEFAULT (XLOG_OPTS_DATE | XLOG_OPTS_TIME | XLOG_OPTS_LF | XLOG_OPTS_MOD_NAME | XLOG_OPTS_LEVEL)
#else
#define XLOG_OPTS_DEFAULT (XLOG_OPTS_DATE | XLOG_OPTS_TIME | XLOG_OPTS_LF | XLOG_OPTS_MOD_NAME | XLOG_OPTS_LEVEL | XLOG_OPTS_COLOR)
Comment on lines +1744 to +1747
for (uint8_t i = 0; i < outcome->maxBluezRetries; i++) {
if (i >= outcome->bluezRetries || i >= outcome->bluezError.size()) {
ss << "\"null\"";
} else {
Comment on lines +1736 to +1741
ss << MARKER_RCU_PAIRING_ATTEMPT_VERSION << ",";
ss << "\"" << name_get() << "\",";
ss << outcome->method << ",";
ss << outcome->result << ",";
ss << outcome->discovered << ",";
ss << "\"" << outcome->name << "\",";
Copilot AI review requested due to automatic review settings July 13, 2026 19:21

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

Comment on lines +19 to 22
#include <cstddef>
#include "ctrlm_powermanager.h"
#include "ctrlm_ipc_iarm_powermanager.h"
#include "ctrlm_thunder_powermanager.h"

}
ret = true;
XLOGD_DEBUG("EDID data <%d> bytes: \n<%s>", edid_size, ss.str().c_str());
XLOGD_INFO("EDID data <%d> bytes: \n<%s>", edid_size, ss.str().c_str());
Comment thread src/ctrlm_log.h
#ifdef ANSI_CODES_DISABLED
#define XLOG_OPTS_DEFAULT (XLOG_OPTS_DATE | XLOG_OPTS_TIME | XLOG_OPTS_LF | XLOG_OPTS_MOD_NAME | XLOG_OPTS_LEVEL)
#else
#define XLOG_OPTS_DEFAULT (XLOG_OPTS_DATE | XLOG_OPTS_TIME | XLOG_OPTS_LF | XLOG_OPTS_MOD_NAME | XLOG_OPTS_LEVEL | XLOG_OPTS_COLOR)
Copilot AI review requested due to automatic review settings July 15, 2026 00:49

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

Comment on lines 200 to 203
bool get_result(void) {
if (network_id_ != CTRLM_MAIN_NETWORK_ID_ALL) {
return (result_map_[network_id_] == CTRLM_IARM_CALL_RESULT_SUCCESS);
} else {
}
ret = true;
XLOGD_DEBUG("EDID data <%d> bytes: \n<%s>", edid_size, ss.str().c_str());
XLOGD_INFO("EDID data <%d> bytes: \n<%s>", edid_size, ss.str().c_str());
Comment thread src/ctrlm_controller.cpp
Comment on lines 29 to +31
using namespace std;

#define OTA_MAX_RETRIES (2)
#define OTA_MAX_RETRIES (0)
Copilot AI review requested due to automatic review settings July 16, 2026 17:07

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

Comment on lines 80 to 82
} else {
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s>", json_error.line, json_error.column, json_error.text);
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str());
}
Comment on lines +106 to +108
if(append_root == NULL) {
XLOGD_ERROR("JSON ERROR: Line <%u> Column <%u> Text <%s> Contents <%s>", json_error.line, json_error.column, json_error.text, contents.c_str());
} else {
}
ret = true;
XLOGD_DEBUG("EDID data <%d> bytes: \n<%s>", edid_size, ss.str().c_str());
XLOGD_INFO("EDID data <%d> bytes: \n<%s>", edid_size, ss.str().c_str());
Comment thread src/ctrlm_log.h
Comment on lines 23 to 26
#include <stdio.h>

#ifdef ANSI_CODES_DISABLED
#define XLOG_OPTS_DEFAULT (XLOG_OPTS_DATE | XLOG_OPTS_TIME | XLOG_OPTS_LF | XLOG_OPTS_MOD_NAME | XLOG_OPTS_LEVEL)
#else
#define XLOG_OPTS_DEFAULT (XLOG_OPTS_DATE | XLOG_OPTS_TIME | XLOG_OPTS_LF | XLOG_OPTS_MOD_NAME | XLOG_OPTS_LEVEL | XLOG_OPTS_COLOR)
#endif

Comment on lines 175 to +179
bool ctrlm_input_event_writer::get_meta_data(struct stat &file_meta_data) {
int ret = fstat(fd_, &file_meta_data);
std::ostringstream oss;
oss << "/sys/devices/virtual/input/" << sysfs_name_;
std::string dir_path = oss.str();
XLOGD_DEBUG("virtual input path = %s", dir_path.c_str());
Copilot AI review requested due to automatic review settings July 20, 2026 16:32

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

Comments suppressed due to low confidence (7)

src/ipc/ctrlm_rcp_ipc_event.cpp:158

  • to_string() currently calls json_dumps(to_json(), ...) without checking for a NULL to_json() result, and it never decref’s the JSON object returned by to_json(). This can crash if to_json() returns NULL and also leaks the JSON object on success. Consider dumping the JSON into a string, json_decref()-ing the object, and returning the dumped buffer (caller still must free() it).
    src/ipc/ctrlm_rcp_ipc_event.cpp:193
  • Same issue as net status: to_string() can crash if to_json() returns NULL and it leaks the JSON object returned by to_json() because it’s never json_decref()’d.
    src/ipc/ctrlm_rcp_ipc_event.cpp:240
  • Same issue as net status: to_string() can crash if to_json() returns NULL and it leaks the JSON object returned by to_json() because it’s never json_decref()’d.
    src/server/ctrlms_main.c:50
  • The SIGTERM handler calls ctrlms_ws_term() directly. Signal handlers must only call async-signal-safe functions; calling into websocket teardown (and likely malloc/logging) is undefined and can deadlock/crash. Prefer setting a volatile sig_atomic_t flag in the handler and perform shutdown from the main thread/event loop.
    src/ipc/ctrlm_rcp_ipc_event.h:115
  • to_string() returns a raw char* (allocated by Jansson). The caller must free() it, and it may be NULL on error. Adding an explicit contract comment here would help prevent leaks/misuse at call sites.
    src/ipc/ctrlm_rcp_ipc_event.h:147
  • to_string() returns a raw char* (allocated by Jansson). The caller must free() it, and it may be NULL on error. Adding an explicit contract comment here would help prevent leaks/misuse at call sites.
    src/ipc/ctrlm_rcp_ipc_event.h:172
  • to_string() returns a raw char* (allocated by Jansson). The caller must free() it, and it may be NULL on error. Adding an explicit contract comment here would help prevent leaks/misuse at call sites.

Comment thread src/ctrlm_network.cpp
Comment on lines 1067 to 1072
XLOGD_INFO("Broadcasting IARM message %s RCU %<%s> Upgrade Status....", rcu.ieee_address_get().to_string().c_str(), name_get());
XLOGD_DEBUG("%s", msg.to_string());

if (!rcp_ipc->on_firmware_update_progress(msg)) {
XLOGD_ERROR("Error broadcasting IARM message");
}
Copilot AI review requested due to automatic review settings July 22, 2026 21:27

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings July 23, 2026 19:16

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Copilot AI review requested due to automatic review settings July 23, 2026 19:39

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.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

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.

8 participants