Fix NimBLE_Stream_Server NUS compatibility: use standard two-characteristic layout#1140
Draft
Fix NimBLE_Stream_Server NUS compatibility: use standard two-characteristic layout#1140
Conversation
…pport Agent-Logs-Url: https://github.com/h2zero/NimBLE-Arduino/sessions/07db667d-a538-4e10-93a5-e30616f1f6a9 Co-authored-by: h2zero <32826625+h2zero@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix NimBLE_Stream_Server compatibility with NUS terminal software
Add NUS two-characteristic support to NimBLEStream for terminal app compatibility
Mar 31, 2026
h2zero
requested changes
Apr 29, 2026
Owner
h2zero
left a comment
There was a problem hiding this comment.
This should be doable with only a change to the examples, no need for extra code in the class.
Agent-Logs-Url: https://github.com/h2zero/NimBLE-Arduino/sessions/ed6ce1db-51ec-4f31-85b2-0f5bee6bd9c4 Co-authored-by: h2zero <32826625+h2zero@users.noreply.github.com>
Contributor
Author
Done in commit |
Copilot
AI
changed the title
Add NUS two-characteristic support to NimBLEStream for terminal app compatibility
Fix NimBLE_Stream_Server NUS compatibility: use standard two-characteristic layout
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
NimBLE_Stream_Serverexample used NUS UUIDs but a single characteristic for both notify (TX) and write (RX), which is non-standard and breaks compatibility with NUS terminal apps (nRF UART, Serial Bluetooth Terminal, etc.). Standard NUS requires separate TX (6E400003, notify) and RX (6E400002, write) characteristics.No library code was changed. The existing
NimBLEStreamServer::begin(pChr)already activates only the directions supported by the characteristic's properties — a NOTIFY-only characteristic enables the TX buffer; a WRITE-only characteristic enables the RX buffer — making the two-characteristic NUS pattern achievable entirely in the examples.Example updates
NimBLE_Stream_ServerNimBLEStreamServerinstances backed by the appropriate characteristic:bleStreamTx.begin(pTxChar)— NOTIFY-only char → TX-only stream (sends notifications)bleStreamRx.begin(pRxChar)— WRITE-only char → RX-only stream (receives client writes)bleStreamTx.ready()tracks the subscribed client;bleStreamRx.available()/read()handles incoming dataNimBLE_Stream_ClientNimBLEStreamClientfor TX: writes to the server's RX characteristic (6E400002, WRITE_NR)pTxChar->subscribe()for RX, with anonServerNotifycallbackNimBLE_Stream_Echo(custom UUIDs, single characteristic) is unchanged.