Repository navigation
[Breaking] Refactor GATT status codes for custom values - #1204
Conversation
* Move named GATT status codes into the NimBLEGattStatus namespace. * Change GATT callback and event return types to uint8_t, allowing applications to return custom status values such as 0x80–0x9F. * Update the library, server implementation, and example callback signatures accordingly.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Status and event contract src/NimBLELocalValueAttribute.h |
Arr, NimBLEGattStatus is now a namespace of uint8_t values, and local attribute event methods return uint8_t. |
Characteristic and descriptor callbacks src/NimBLECharacteristic.h, src/NimBLECharacteristic.cpp, src/NimBLEDescriptor.h, src/NimBLEDescriptor.cpp |
Arr, characteristic and descriptor event methods and callbacks now return uint8_t. Existing write success checks and conditional value updates remain. |
Server, stream, and example call sites src/NimBLEServer.cpp, src/NimBLEStream.h, src/NimBLEStream.cpp, examples/NimBLE_Server/NimBLE_Server.ino |
Arr, server status handling, stream callbacks, and example callbacks now use uint8_t results. Existing status checks and callback behavior remain. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Possibly related PRs
- h2zero/NimBLE-Arduino#1203: Arr, this PR introduces
NimBLEGattStatusand updates characteristic and descriptor callbacks; this change follows by usinguint8_tstatus returns.
Merge Risk: 
Minimal · up to 8f884
-
The status-code change is ready to merge after normal checks; no actionable issue was found.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 7 functions across 9 files.
Full details: Title check
-
Explanation
Arr, the title be fair to middlin'. It names the main change, a refactor of GATT status codes so custom values can be returned, and it flags the breaking nature. The changeset moves named codes into the NimBLEGattStatus namespace and switches the readEvent, writeEvent, and callback return types to uint8_t across the library, server, stream, and example files, so the title matches the core of the PR.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Arr, status values sail as bytes,
Callback signatures chart new routes.
Success checks keep their steady pace,
Descriptors answer in the same place.
Custom codes join the ship’s embrace.
Comment @coderabbitai help to get the list of available commands.
Summary by CodeRabbit
uint8_tstatus values instead ofNimBLEGattStatus. Existing success and error handling remains unchanged.