Skip to content

Commit 90fd053

Browse files
committed
host: document GATT error status encoding
Clarify that ble_gatt_error.status uses NimBLE host return-code ranges instead of raw ATT error values. This helps callers decode application-specific ATT errors such as 0x0181 by first removing the ATT base.
1 parent 8ff6928 commit 90fd053

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

nimble/host/include/host/ble_gatt.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,15 @@ struct ble_hs_cfg;
204204
/*** @client. */
205205
/** Represents a GATT error. */
206206
struct ble_gatt_error {
207-
/** The GATT status code indicating the type of error. */
207+
/**
208+
* The NimBLE host status code indicating the type of error.
209+
*
210+
* This value uses the NimBLE host return-code ranges. ATT errors are
211+
* reported as BLE_HS_ATT_ERR(code), so status 0x0181 is ATT error 0x81
212+
* (0x100 + 0x81). Application-specific ATT errors must be decoded by
213+
* subtracting the ATT base and consulting the service or profile
214+
* specification that defines the ATT error.
215+
*/
208216
uint16_t status;
209217

210218
/** The attribute handle associated with the error. */

0 commit comments

Comments
 (0)