Skip to content

Make stream class MCU and OS agnostic#1109

Merged
h2zero merged 1 commit into
stream-classfrom
nrf-stream
Mar 14, 2026
Merged

Make stream class MCU and OS agnostic#1109
h2zero merged 1 commit into
stream-classfrom
nrf-stream

Conversation

@h2zero

@h2zero h2zero commented Mar 12, 2026

Copy link
Copy Markdown
Owner

No description provided.

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 PR refactors the NimBLEStream implementation to remove ESP/FreeRTOS-specific dependencies and rely on NimBLE’s NPL primitives so the stream can work across different MCUs / OS ports.

Changes:

  • Replaced FreeRTOS ringbuffer + TX task with an NPL mutex-protected byte ring buffer and event-queue-driven TX draining.
  • Updated stream lifecycle to be driven from init() (server/client) rather than requiring an external begin().
  • Added a syscfg/nimconfig option intended to control stream debug log emission.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/syscfg/syscfg.h Adds default config for stream debug log enablement.
src/nimconfig.h Documents the new stream debug log config; minor ESP config formatting.
src/NimBLEStream.h Makes the stream header platform-agnostic; updates API and internal structure.
src/NimBLEStream.cpp Implements NPL-based buffering and TX draining; updates server/client send logic and UART logging output.
examples/STREAM_EXAMPLES.md Removes FreeRTOS task tuning notes; still documents stream configuration.
examples/NimBLE_Stream_Server/NimBLE_Stream_Server.ino Updates example usage to ready() and removes explicit begin().
examples/NimBLE_Stream_Echo/NimBLE_Stream_Echo.ino Removes explicit begin() and updates readiness check.
examples/NimBLE_Stream_Client/NimBLE_Stream_Client.ino Removes explicit begin() after client init.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread examples/NimBLE_Stream_Server/NimBLE_Stream_Server.ino Outdated
Comment thread src/NimBLEStream.h Outdated
Comment thread src/NimBLEStream.h Outdated
Comment thread examples/NimBLE_Stream_Echo/NimBLE_Stream_Echo.ino Outdated
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp
Comment thread examples/STREAM_EXAMPLES.md Outdated
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp Outdated
@h2zero h2zero force-pushed the nrf-stream branch 3 times, most recently from 0f36ca1 to 75d3f9c Compare March 13, 2026 00:30
@h2zero h2zero requested a review from Copilot March 13, 2026 00:31

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.h Outdated
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp
Comment thread examples/STREAM_EXAMPLES.md Outdated
Comment thread src/nimconfig.h Outdated
Comment thread src/NimBLEStream.h Outdated
Comment thread src/NimBLEStream.h Outdated

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.h Outdated
Comment thread src/NimBLEStream.h Outdated

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.h
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp Outdated
@h2zero h2zero force-pushed the nrf-stream branch 2 times, most recently from 08455f8 to 41baead Compare March 13, 2026 15:50
@h2zero h2zero requested a review from Copilot March 13, 2026 15:54

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.h Outdated
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp Outdated
@h2zero h2zero force-pushed the nrf-stream branch 3 times, most recently from ebf60dd to a17f7e5 Compare March 13, 2026 16:31
@h2zero h2zero requested a review from Copilot March 13, 2026 16:35

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp Outdated

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp Outdated
@h2zero h2zero requested a review from Copilot March 14, 2026 17:26
Repository owner deleted a comment from coderabbitai Bot Mar 14, 2026

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp Outdated
@coderabbitai

coderabbitai Bot commented Mar 14, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4817c0d0-239c-433d-80a3-8591db8899a3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nrf-stream
📝 Coding Plan
  • Generate coding plan for human review comments

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

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp Outdated
@h2zero h2zero force-pushed the nrf-stream branch 2 times, most recently from f543dbb to 2967df0 Compare March 14, 2026 18:09
@h2zero h2zero requested a review from Copilot March 14, 2026 18:09

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread examples/NimBLE_Stream_Server/NimBLE_Stream_Server.ino
Comment thread examples/NimBLE_Stream_Echo/NimBLE_Stream_Echo.ino Outdated
Comment thread src/NimBLEStream.cpp
@h2zero h2zero force-pushed the nrf-stream branch 2 times, most recently from 162654b to fd05e5e Compare March 14, 2026 19:36
@h2zero h2zero requested a review from Copilot March 14, 2026 19:36

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp Outdated
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.h

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp Outdated

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


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

You can also share your feedback on Copilot code review. Take the survey.

Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.cpp
Comment thread src/NimBLEStream.h
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