diff --git a/nimble/host/include/host/ble_att.h b/nimble/host/include/host/ble_att.h index 3899d0028..6fa9d942d 100644 --- a/nimble/host/include/host/ble_att.h +++ b/nimble/host/include/host/ble_att.h @@ -120,6 +120,7 @@ struct os_mbuf; */ /** Error Response. */ + #define BLE_ATT_OP_ERROR_RSP 0x01 /** MTU Request. */ diff --git a/nimble/host/src/ble_gatt_priv.h b/nimble/host/src/ble_gatt_priv.h index 84793e122..c686c01ac 100644 --- a/nimble/host/src/ble_gatt_priv.h +++ b/nimble/host/src/ble_gatt_priv.h @@ -89,6 +89,11 @@ extern STATS_SECT_DECL(ble_gatts_stats) ble_gatts_stats; #define BLE_GATT_CHR_DECL_SZ_16 5 #define BLE_GATT_CHR_DECL_SZ_128 19 #define BLE_GATT_CHR_CLI_SUP_FEAT_SZ 1 +/** + * For now only 3 bits in first octet are defined + * + */ +#define BLE_GATT_CHR_CLI_SUP_FEAT_MASK 7 typedef uint8_t ble_gatts_conn_flags; diff --git a/nimble/host/src/ble_gatts.c b/nimble/host/src/ble_gatts.c index 6aef981c0..0df5a353a 100644 --- a/nimble/host/src/ble_gatts.c +++ b/nimble/host/src/ble_gatts.c @@ -2050,12 +2050,11 @@ ble_gatts_peer_cl_sup_feat_update(uint16_t conn_handle, struct os_mbuf *om) uint16_t len; int rc = 0; int i; - int rfu_mask = 7; BLE_HS_LOG(DEBUG, ""); if (!om) { - return BLE_HS_EINVAL; + return BLE_ATT_ERR_INSUFFICIENT_RES; } /* RFU bits are ignored so we can skip any bytes larger than supported */ @@ -2076,7 +2075,7 @@ ble_gatts_peer_cl_sup_feat_update(uint16_t conn_handle, struct os_mbuf *om) ble_hs_lock(); conn = ble_hs_conn_find(conn_handle); if (conn == NULL) { - rc = BLE_HS_ENOTCONN; + rc = BLE_ATT_ERR_UNLIKELY; goto done; }