Skip to content

[Bugfix] Only call scan deinit callback if nimble was stopped. - #1178

Merged
h2zero merged 1 commit into
masterfrom
scan-deinit-after-port
Aug 1, 2026
Merged

[Bugfix] Only call scan deinit callback if nimble was stopped.#1178
h2zero merged 1 commit into
masterfrom
scan-deinit-after-port

Conversation

@h2zero

@h2zero h2zero commented Aug 1, 2026

Copy link
Copy Markdown
Owner
  • Add error handling if nimble failed to stop.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Bluetooth host shutdown handling during device deinitialization.
    • Deinitialization now stops safely when host shutdown fails and reports the failure clearly.

* Add error handling if nimble failed to stop.
@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 95922da2-a840-4e07-acf5-0b20de96aa12

📥 Commits

Reviewing files that changed from the base of the PR and between 9bc5176 and 00dcd8d.

📒 Files selected for processing (1)
  • src/NimBLEDevice.cpp

📝 Walkthrough

Walkthrough

NimBLEDevice::deinit now stops the NimBLE host before scan cleanup. If nimble_port_stop() fails, it logs the error and returns false, arr.

Changes

Host deinitialization

Layer / File(s) Summary
Stop host before cleanup
src/NimBLEDevice.cpp
nimble_port_stop() runs before onHostDeinit(). A stop failure is logged and ends deinit with false.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: sanastasiou

Poem

The host must halt before scans depart,
A failed stop returns with care.
The logs record the troubled tide,
Cleanup waits on the host’s green light.
Yarrr, shutdown keeps its chart!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed Arrr, the title clearly describes the main change: call the scan deinit callback only after NimBLE stops successfully.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch scan-deinit-after-port

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@h2zero
h2zero merged commit 7b4c341 into master Aug 1, 2026
44 checks passed
@h2zero
h2zero deleted the scan-deinit-after-port branch August 1, 2026 22:10
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.

1 participant