Skip to content

Remove debug code from Bluetooth power mode change handler#45

Draft
Copilot wants to merge 21 commits into
developfrom
copilot/sub-pr-35-please-work
Draft

Remove debug code from Bluetooth power mode change handler#45
Copilot wants to merge 21 commits into
developfrom
copilot/sub-pr-35-please-work

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 16, 2026

Removes temporary debug instrumentation from Bluetooth::onPowerModeChanged that was added during development. The debug code included unsafe array indexing with powerStateNames[currentState] that could cause undefined behavior if invalid PowerState values were passed.

Changes:

  • Removed powerStateNames array and all associated printf debug statements
  • Removed temporary variables (deviceStr, bSuccess) used only for debug logging
  • Removed unused else clause for unhandled power state transitions

Before:

static const char* powerStateNames[] = { ... };
printf("*** _DEBUG: Bluetooth::onPowerModeChanged: %s --> %s\n", 
       powerStateNames[currentState], powerStateNames[newState]);
// ... 9 more debug printf statements

After:

void Bluetooth::onPowerModeChanged(...) {
    if ((POWER_STATE_ON == currentState || POWER_STATE_UNKNOWN == currentState) && ...) {
        JsonArray connectedDevices = getConnectedDevices();
        // Production logic without debug noise
    }
}

Also added .gitignore to exclude build artifacts.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 16, 2026 16:06
Co-authored-by: pahearn73 <8170037+pahearn73@users.noreply.github.com>
Co-authored-by: pahearn73 <8170037+pahearn73@users.noreply.github.com>
Co-authored-by: pahearn73 <8170037+pahearn73@users.noreply.github.com>
Co-authored-by: pahearn73 <8170037+pahearn73@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback on Bluetooth plug-in enhancements Remove debug code from Bluetooth power mode change handler Feb 16, 2026
Copilot AI requested a review from pahearn73 February 16, 2026 16:08
@pahearn73 pahearn73 force-pushed the feature/RDKEMW-13334 branch 2 times, most recently from b395ace to 56a3106 Compare March 3, 2026 16:01
@pahearn73 pahearn73 force-pushed the feature/RDKEMW-13334 branch 3 times, most recently from 4b6909b to baad22d Compare March 11, 2026 00:04
@pahearn73 pahearn73 force-pushed the feature/RDKEMW-13334 branch from 4039c7c to 4fcf9e6 Compare March 13, 2026 15:29
Base automatically changed from feature/RDKEMW-13334 to develop March 13, 2026 17:24
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