Conversation
…C_DISABLE_VIA_PRIVACY (#120)
* RDKEMW-8929: Refactor base ipc class Reason for change: Test Procedure: Risks: Signed-off-by: Kelvin Lu <Kelvin_Lu@comcast.com> * Updating based on Copilot review comments --------- Signed-off-by: Kelvin Lu <Kelvin_Lu@comcast.com>
There was a problem hiding this comment.
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.
|
|
||
| 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); |
There was a problem hiding this comment.
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.
| if (it.second == CTRLM_IARM_CALL_RESULT_SUCCESS) { | ||
| return true; | ||
| } | ||
| } | ||
| return true; | ||
| return false; |
There was a problem hiding this comment.
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.
| 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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 70 out of 71 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 73 out of 74 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| 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()); |
There was a problem hiding this comment.
The JSON parse error log includes the full configuration file contents. Configuration can contain sensitive data (tokens, identifiers), and logging the whole file increases exposure risk. Consider logging only the parse location + a small surrounding snippet, or gating full-content logging behind a debug/verbose flag that is disabled in production builds.
| char *ctrlm_rcp_ipc_net_status_t::to_string() const | ||
| { | ||
| return json_dumps(to_json(), JSON_ENCODE_ANY); | ||
| } |
There was a problem hiding this comment.
ctrlm_rcp_ipc_*::to_string() now returns a raw char* from json_dumps(), which requires the caller to free() it. This is easy to misuse and can introduce leaks or double-frees. Prefer returning std::string (as before) or a smart-pointer/RAII wrapper with clear ownership semantics.
| XLOGD_AUTOMATION_INFO("%ul : <%s>", size, this->obj_voice->voice_stb_data_pii_mask_get() ? "***" : message); //CID -160950 - Printargs | ||
| ret = broadcast_iarm_event<ctrlm_voice_iarm_event_json_t>(CTRLM_MAIN_IARM_BUS_NAME, CTRLM_VOICE_IARM_EVENT_JSON_SERVER_MESSAGE, message); |
There was a problem hiding this comment.
The format string uses %ul for an unsigned long (size). %ul is not a valid printf specifier; use %lu to avoid undefined behavior / incorrect output.
| bool has_valid_cert = false; | ||
| ctrlmf_ws_init(audio_frame_size, CTRLMF_WS_PORT_INT, true, &g_audio_cap.callbacks, &has_valid_cert); | ||
|
|
||
| // Set the FFV url to our websocket | ||
| std::string url_new = has_valid_cert ? CTRLMF_WSS_URL : CTRLMF_WS_URL; | ||
|
|
||
| if(g_audio_cap.use_mic_tap) { |
There was a problem hiding this comment.
ctrlmf_ws_init(...) return value is ignored. If the websocket listener fails to start, the code still proceeds to reconfigure voice URLs, which can leave the system pointing at a non-existent endpoint. Check the return value and fail/rollback early (and avoid changing the URL) when initialization fails.
| ctrlm_hal_ble_VoiceStreamEnd_t streamEnd = CTRLM_HAL_BLE_VOICE_STREAM_END_ON_KEY_UP; | ||
| auto rcu = controllers_.at(id); | ||
|
|
||
| if (rcu->getPressAndHoldSupport()) { |
There was a problem hiding this comment.
streamEnd selection appears inverted. Earlier logic used ON_AUDIO_DURATION when pressAndHoldSupport is false; here ON_AUDIO_DURATION is selected when getPressAndHoldSupport() is true. This will cause the wrong stream termination behavior (key-up vs duration) for BLE voice sessions.
| if (rcu->getPressAndHoldSupport()) { | |
| if (!rcu->getPressAndHoldSupport()) { |
add support for having multiple IR database vendor implementations simultaneously
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 77 out of 78 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| char *ctrlm_rcp_ipc_upgrade_status_t::to_string() const | ||
| { | ||
| return json_dumps(to_json(), JSON_ENCODE_ANY); | ||
| } |
There was a problem hiding this comment.
ctrlm_rcp_ipc_upgrade_status_t::to_string() returns a json_dumps() buffer but does not decref the json object created by to_json(), which will leak. Please decref the json_t after dumping (and clearly define who frees the returned char*), or return a std::string instead.
| char *ctrlm_rcp_ipc_validation_status_t::to_string() const | ||
| { | ||
| return json_dumps(to_json(), JSON_ENCODE_ANY); | ||
| } |
There was a problem hiding this comment.
ctrlm_rcp_ipc_validation_status_t::to_string() returns a json_dumps() buffer but does not decref the json object created by to_json(), which leaks memory each call. Please decref the json_t after dumping (and document/free the returned char*), or return a std::string.
| XLOGD_AUTOMATION_INFO("%ul : <%s>", size, this->obj_voice->voice_stb_data_pii_mask_get() ? "***" : message); //CID -160950 - Printargs | ||
| ret = broadcast_iarm_event<ctrlm_voice_iarm_event_json_t>(CTRLM_MAIN_IARM_BUS_NAME, CTRLM_VOICE_IARM_EVENT_JSON_SERVER_MESSAGE, message); |
There was a problem hiding this comment.
The printf format specifier for an unsigned long is "%lu", but this log line uses "%ul". This is an invalid format string and can lead to undefined behavior / incorrect output. Please change it to the correct specifier for the type of size.
| ctrlm_hal_ble_VoiceStreamEnd_t streamEnd = CTRLM_HAL_BLE_VOICE_STREAM_END_ON_KEY_UP; | ||
| auto rcu = controllers_.at(id); | ||
|
|
||
| if (rcu->getPressAndHoldSupport()) { |
There was a problem hiding this comment.
In start_controller_audio_streaming(), the stream end condition for press-and-hold appears inverted. Earlier logic treated non-press-and-hold (press-and-release) sessions as needing CTRLM_HAL_BLE_VOICE_STREAM_END_ON_AUDIO_DURATION, while press-and-hold should typically end on key-up. With the current check, press-and-hold sessions will end on duration and press-and-release will end on key-up, which can prematurely end PAR sessions or leave streams running longer than intended. Please swap the condition to match the intended semantics of getPressAndHoldSupport().
| if (rcu->getPressAndHoldSupport()) { | |
| if (!rcu->getPressAndHoldSupport()) { |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 81 out of 82 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 83 out of 84 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 83 out of 84 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.