Skip to content

host: document GATT error status encoding#2252

Open
Old-Ding wants to merge 1 commit into
apache:masterfrom
Old-Ding:codex/gatt-error-status-doc
Open

host: document GATT error status encoding#2252
Old-Ding wants to merge 1 commit into
apache:masterfrom
Old-Ding:codex/gatt-error-status-doc

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 1, 2026

Copy link
Copy Markdown

Summary

  • Clarify that ble_gatt_error.status is a NimBLE host status code.
  • Link the NimBLE host return-code documentation from struct ble_gatt_error.

Closes #1827

Testing

  • git diff --check origin/master...HEAD
  • The tree-identical previous head passed coding style, licensing, Doxygen style, unit tests, app and port builds, GCC target builds, and test-target builds on Ubuntu, Windows, and macOS.
  • The current head only rewrites commit metadata to satisfy the 72-character commit-message rule and correct Old-Ding attribution. PR-target checks pass; the fork pull_request workflows are waiting for maintainer approval (action_required, no jobs).

@Old-Ding Old-Ding marked this pull request as ready for review July 1, 2026 05:38
Comment thread nimble/host/include/host/ble_gatt.h Outdated
* 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Old-Ding Old-Ding force-pushed the codex/gatt-error-status-doc branch from 90fd053 to 687997e Compare July 8, 2026 06:22
Clarify that ble_gatt_error.status follows the NimBLE host return-code
convention. Point readers to the return-code documentation instead of
describing implementation-specific ATT encoding details.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
@Old-Ding Old-Ding force-pushed the codex/gatt-error-status-doc branch from 687997e to 5db708c Compare July 10, 2026 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error status 0x0181 sent back in BLE write call-back. What does it mean?

2 participants