Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3919123pxv; Mon, 28 Jun 2021 16:39:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbzzgZg6ROnBdDflUKG8rmdfHmXUb2fr9cHXITZEsJ0viXtYKmfNvTjrKjLfbIlDFIA8oz X-Received: by 2002:a02:9109:: with SMTP id a9mr1735405jag.93.1624923587446; Mon, 28 Jun 2021 16:39:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624923587; cv=none; d=google.com; s=arc-20160816; b=stGDenmjGLLvVl4RhkP14vr35CtxF3dSQox9EBSKMnhWZIQZiSwNFHdBUJmywaim/5 89RvSYZ4TJworxqmCn2Qb3JsXFnGbbA2GLZk/5lsAH9FofgFImnnIMPDKsppSm10B+Xc ttIEHDrrBJoCrH35TvjW5NO2tDPUIP8pMhuRHXF/SnZQyZEjE/bVC863ywL3VRuPAtk0 cA8OY1dRM4R3uPuVP5P9Lvs3kJVIU1j+iZOa5npaCj1S2+8uBAb6Xq3Ij3B9TnhAVS/K mrpbMWGLF/IWqrG/kzJG9Z+ssxH7TIbcCKPKvFMlSPZeK/YYkRn2GN0N0JUy4BpVWzyS QJgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=740a8kCzPIT3mewVULe7dcCE48/gc7fgeTG4RKOGsbo=; b=TWSgQuYeKzbOPGUmckxm80SdKf1PPraRjjRIzJn6BIcwS+GMWU/RAiwlaGlpCkTazB 0IRjVlOMTUb+ymaU47FbudLyjqR2QJtOeQ2J7Q3PvrzXKjRVRtsiE7nbrDfg2qM1L3MT Mur/qUF6g8a6j2q6j+c8lfbxQd8g0yjbIfQYCs4OIEBRU6exz+SEJHHKxyshMRnUm4I8 qjnTD3BiZ3tLDl8bcMZ3ckvNgzmv8AJ//F7/ZAkIOXVQ91WdT/H5Y58FEr9EGbUTyhHS syFOz0/TsN1ctolb6Ag9g2eCSTtHjLyfrp4hLJiZaUig1+YZGXMnp9me0FWVDjtGw+5M cmow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kEzd5YvP; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si20528143ion.69.2021.06.28.16.39.18; Mon, 28 Jun 2021 16:39:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kEzd5YvP; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233705AbhF1Rhe (ORCPT + 99 others); Mon, 28 Jun 2021 13:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232266AbhF1Rhe (ORCPT ); Mon, 28 Jun 2021 13:37:34 -0400 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7128C061574 for ; Mon, 28 Jun 2021 10:35:06 -0700 (PDT) Received: by mail-yb1-xb2b.google.com with SMTP id s129so19804336ybf.3 for ; Mon, 28 Jun 2021 10:35:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=740a8kCzPIT3mewVULe7dcCE48/gc7fgeTG4RKOGsbo=; b=kEzd5YvPpVKwdQM4hLFZ+nf5ywrIoVD8IH3D//xEfrBzcI3K34AZ2PGP6n4ziwDmZk djLx1zYfBZQ/HRPha8TvYaaidJYOFdtTH6P2fkYPsJ64UxB2jeQhapFqf0zliX0z1DHt EvmmbEERZNhJw0NAHIbHUHSUJbS52T+UQI6ELHuiCs3sSvIA2f50Mt3Fj6Lt6yEsIStv 9gfSAx1bm6XuOsPXNWw+Hhj3t6YAYhJvtJ4oi9ez+Yihepdht5S7ybszf/G1kWrOzzqV ProdLUn3AME55ZZmwKVbVp4rFPDNdiOhD9B04fIrG2V7PtheIRLKZNGK320g5gH64RQW 1FsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=740a8kCzPIT3mewVULe7dcCE48/gc7fgeTG4RKOGsbo=; b=g8+ez1wRyFI5h5Vg0SmKGOm2augl5HCMaFZ+xx94Vvh248SHTzF3InHMrvdNH4FDHt ynOl23qXORWdNxLq9EtjqrQfAGrjLPZoUWtH8J6hIsRywpUQfCadVPXi12Ort0sNEVG3 9Y/mWI5GKSJJTxxdPRo4IChN8d+tiTKW0LeAeM6qEqmYBPuheAtrmPPZe3sUFUyVfvNl qPUh+us4Lpj4urws2VKuYrMbbAZzIuDCZ+BylxKy5IeUINR7aBFh0PvQRTFcxWR3f5jF yI8UVfNxrdJ8IGzxg12RXKV7zwH5FhP+1Wa3Ofy2ahvN972QecRcCPBxOLKErsnd7L/k F15Q== X-Gm-Message-State: AOAM533RJ4m1sZcqcv2hJ5ZBbwKUAz4/5CvtlfAHzzuD5wQoY/3N590m KGc6fYNcDxJJnoT3NSDKxSLYb2VLnzwPFN+7krs= X-Received: by 2002:a25:be02:: with SMTP id h2mr33518859ybk.91.1624901706042; Mon, 28 Jun 2021 10:35:06 -0700 (PDT) MIME-Version: 1.0 References: <20201228142224.Bluez.v1.1.I89c3c683e3dec6439f3b0d2c00da86a2107019af@changeid> In-Reply-To: From: Luiz Augusto von Dentz Date: Mon, 28 Jun 2021 10:34:55 -0700 Message-ID: Subject: Re: [Bluez PATCH v1] shared/gatt-client: Fix GATT client attribute read with offset To: Yun-hao Chung Cc: Bluez mailing list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Howard, On Mon, Jun 28, 2021 at 4:57 AM Yun-hao Chung wrote: > > Hi, > > Can we get a reply on this patch? > > Thanks, > Howard > > On Mon, Dec 28, 2020 at 2:22 PM Howard Chung wrote: >> >> bluez always replies the whole value despite a user specify the offset. >> This patch fixes the issue. >> >> Reviewed-by: sonnysasaka@chromium.org >> --- >> >> src/gatt-client.c | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >> >> diff --git a/src/gatt-client.c b/src/gatt-client.c >> index 0cf5324ffa46..bec6e1ec049e 100644 >> --- a/src/gatt-client.c >> +++ b/src/gatt-client.c >> @@ -368,7 +368,8 @@ static void desc_read_cb(bool success, uint8_t att_ecode, >> } >> >> /* Read the stored data from db */ >> - if (!gatt_db_attribute_read(desc->attr, 0, 0, NULL, read_op_cb, op)) { >> + if (!gatt_db_attribute_read(desc->attr, op->offset, 0, NULL, read_op_cb, >> + op)) { >> error("Failed to read database"); >> att_ecode = BT_ATT_ERROR_UNLIKELY; >> goto fail; >> @@ -906,7 +907,8 @@ static void chrc_read_cb(bool success, uint8_t att_ecode, const uint8_t *value, >> } >> >> /* Read the stored data from db */ >> - if (!gatt_db_attribute_read(chrc->attr, 0, 0, NULL, read_op_cb, op)) { >> + if (!gatt_db_attribute_read(chrc->attr, op->offset, 0, NULL, read_op_cb, >> + op)) { >> error("Failed to read database"); >> att_ecode = BT_ATT_ERROR_UNLIKELY; >> goto fail; >> -- >> 2.29.2.729.g45daf8777d-goog Applied, thanks. -- Luiz Augusto von Dentz