drivers/nble: Fix compare logic in on_nble_gattc_read_rsp

The Read Response only contains a Characteristic Value that is less
than or equal to (ATT_MTU – 1) octets in length so, condition
(length < bt_att_get_mtu(conn)) is always true, and the full
Characteristic Value will not be read.

Change-Id: Ib18fbedf277c880dc5cf0ce21fd7d550d12a64ef
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
This commit is contained in:
Mariusz Skamra 2016-04-14 12:33:41 +02:00
commit 5047d54403

View file

@ -811,7 +811,7 @@ void on_nble_gattc_read_rsp(const struct nble_gattc_read_rsp *rsp,
* if the rest of the Characteristic Value is required.
* The data contain only (ATT_MTU 1) octets.
*/
if (len < BLE_GATT_MTU_SIZE) {
if (len < (BLE_GATT_MTU_SIZE - 1)) {
params->func(conn, 0, params, NULL, 0);
goto done;
}