Repository navigation
[Breaking] Refactor GATT status codes for custom values - #455
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 type and attribute callbacks src/NimBLELocalValueAttribute.h, src/NimBLECharacteristic.h, src/NimBLECharacteristic.cpp, src/NimBLEDescriptor.h, src/NimBLEDescriptor.cpp |
NimBLEGattStatus now contains an unscoped uint8_t enum. Characteristic and descriptor event methods and callbacks return uint8_t. Write paths retain their existing success checks before updating values. |
Server, stream, and example propagation src/NimBLEServer.cpp, src/NimBLEStream.h, src/NimBLEStream.cpp, examples/NimBLE_Server/main/main.cpp |
The server read path, stream callback, and example callbacks use uint8_t status results. Existing status checks and value-handling behavior remain. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Feature
Possibly related PRs
- h2zero/esp-nimble-cpp#429: Arrr, this PR introduced the
NimBLEGattStatuscallback and event return chain that this change updates.
Merge Risk: 
Minimal · up to 810f1
-
No merge-blocking issue is established by the supplied review evidence.
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.
-
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.
Arrr, status bytes sail through the chain,
Callback returns now share the same domain.
Success checks keep their familiar place,
Values update at the same old pace.
The server and stream carry the code,
While example callbacks join the road.
Comment @coderabbitai help to get the list of available commands.
Summary by CodeRabbit
uint8_t. Existing status values remain available, and successful reads and writes continue to behave as before.