You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "Old-Ding (via GitHub)" <gi...@apache.org> on 2026/07/01 03:36:08 UTC
[PR] host: document GATT error status encoding [mynewt-nimble]
Old-Ding opened a new pull request, #2252:
URL: https://github.com/apache/mynewt-nimble/pull/2252
## Summary
- Clarify that `ble_gatt_error.status` uses NimBLE host return-code ranges, not raw ATT error values.
- Document ATT error encoding with `BLE_HS_ATT_ERR(code)`, including `0x0181 = 0x100 + 0x81`.
- Note that application-specific ATT errors are defined by the relevant service or profile specification after removing the ATT base.
Closes #1827
## Testing
- `git diff --check origin/master...HEAD`
- Not run: `python .github/check_doxygen.py HEAD origin/master` (`doxygen` is not installed locally)
- Not run: local clang-format check (`clang-format` is not installed locally)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] host: document GATT error status encoding [mynewt-nimble]
Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc commented on code in PR #2252:
URL: https://github.com/apache/mynewt-nimble/pull/2252#discussion_r3530006930
##########
nimble/host/include/host/ble_gatt.h:
##########
@@ -204,7 +204,15 @@ struct ble_hs_cfg;
/*** @client. */
/** Represents a GATT error. */
struct ble_gatt_error {
- /** The GATT status code indicating the type of error. */
+ /**
+ * The NimBLE host status code indicating the type of error.
+ *
+ * This value uses the NimBLE host return-code ranges. ATT errors are
+ * reported as BLE_HS_ATT_ERR(code), so status 0x0181 is ATT error 0x81
+ * (0x100 + 0x81). Application-specific ATT errors must be decoded by
+ * subtracting the ATT base and consulting the service or profile
+ * specification that defines the ATT error.
Review Comment:
Hi,
This is not valid comment. It just exposes current implementation specific details (mask 0x100).
In Nimble error mask is used for specifying which layer trigger error and application shall not assume
any specific layer when decoding.
So I'd suggest to comment here that status is following NimBLE error codes convention described in
https://mynewt.apache.org/latest/network/ble_hs/ble_hs_return_codes.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] host: document GATT error status encoding [mynewt-nimble]
Posted by "sjanc (via GitHub)" <gi...@apache.org>.
sjanc merged PR #2252:
URL: https://github.com/apache/mynewt-nimble/pull/2252
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org