mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-11-14 00:10:34 +00:00
nimble/att: Fix error code when accessing characteristics
With this patch BLE_HS_ENOSUP is used only when given ATT operations is not supported. Otherwise it is BLE_HS_EREJECT. It affects only test code. X-Original-Commit: b854f39fbe03fe1ec16b6c7c2403890f17e678d4
This commit is contained in:
@@ -258,7 +258,7 @@ ble_att_svr_check_perms(uint16_t conn_handle, int is_read,
|
||||
if (is_read) {
|
||||
if (!(entry->ha_flags & BLE_ATT_F_READ)) {
|
||||
*out_att_err = BLE_ATT_ERR_READ_NOT_PERMITTED;
|
||||
return BLE_HS_ENOTSUP;
|
||||
return BLE_HS_EREJECT;
|
||||
}
|
||||
|
||||
enc = entry->ha_flags & BLE_ATT_F_READ_ENC;
|
||||
@@ -267,7 +267,7 @@ ble_att_svr_check_perms(uint16_t conn_handle, int is_read,
|
||||
} else {
|
||||
if (!(entry->ha_flags & BLE_ATT_F_WRITE)) {
|
||||
*out_att_err = BLE_ATT_ERR_WRITE_NOT_PERMITTED;
|
||||
return BLE_HS_ENOTSUP;
|
||||
return BLE_HS_EREJECT;
|
||||
}
|
||||
|
||||
enc = entry->ha_flags & BLE_ATT_F_WRITE_ENC;
|
||||
@@ -1957,7 +1957,7 @@ ble_att_svr_rx_read_group_type(uint16_t conn_handle, struct os_mbuf **rxom)
|
||||
if (!ble_att_svr_is_valid_read_group_type(&uuid.u)) {
|
||||
att_err = BLE_ATT_ERR_UNSUPPORTED_GROUP;
|
||||
err_handle = start_handle;
|
||||
rc = BLE_HS_ENOTSUP;
|
||||
rc = BLE_HS_EREJECT;
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
||||
@@ -1043,7 +1043,7 @@ TEST_CASE(ble_att_svr_test_write)
|
||||
|
||||
rc = ble_hs_test_util_rx_att_write_req(conn_handle, attr_handle,
|
||||
attr_val, sizeof attr_val);
|
||||
TEST_ASSERT(rc == BLE_HS_ENOTSUP);
|
||||
TEST_ASSERT(rc == BLE_HS_EREJECT);
|
||||
ble_hs_test_util_verify_tx_err_rsp(BLE_ATT_OP_WRITE_REQ,
|
||||
attr_handle,
|
||||
BLE_ATT_ERR_WRITE_NOT_PERMITTED);
|
||||
|
||||
Reference in New Issue
Block a user