Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp90983pxb; Tue, 5 Apr 2022 01:04:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqoU8jxkHSEUcm9vrrxgUVJcxeEojq50m5+oKgOmm6uku48BqlcGPTA3FTkjT9xTZ6UfW5 X-Received: by 2002:a05:6a00:ad0:b0:4f7:a357:6899 with SMTP id c16-20020a056a000ad000b004f7a3576899mr2372519pfl.80.1649145884722; Tue, 05 Apr 2022 01:04:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649145884; cv=none; d=google.com; s=arc-20160816; b=gDj2upSn6eiEUPR9c43+e3LEeDZ4I11bcpexs/DsWggH3LGjZhrU/EBY/BbEfT+7DG P8+gFoGviXXD+AvUqSUyJ8s39aR3QFbdmGFljieLJzqUAH9LCYEar1wfZl/PTPhzZGmj 4Dq8zVIG4hHgrXHrMaB2poRBe5oOk49vqZxHsQRP/8DygQm9BddG27gV/JWAPBdWGrEv bnvDdxbUuBOaZ49DwkGVgvuTJjWZW1qKBm9Bq3yF9hXy2YiFUo4O0mbBFZHGi4MBltP+ 07M4KEpS0dfzWQgEohgfjSG/S4Y4kRMsoOyyYWp0SWMKVd/uIIeC1OV0/vuZP9J+1yQm f0xQ== 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; bh=a/qsag3sAyioO3+ak2r/PvC834IWCFPW787+/S1QtlE=; b=wRlUot/sxXuUcOSYkrqQtfCWNcPGdqELAgju25chWqIdnvgP7a3m8uHZLef5WjzIbP vXh1Cqc02RhWEGASsIIGogfKnO97peGopOz/+i4iNbQMJze2Vrk6mUITvW2EFSjgm4K5 a3MQR6LOYKzQFDM56uNoyCCSIeWy09HwCjAZ+kKYgbeUeEra+vmOgth/Xjo43tnpLH70 bA1oTa20bZF8PJwxIM63BXjBLd9L5UZVcDAcuwzXMH87mAOcTF94DUaNw10WSYX7blMC X3PZ80prs7CIM11izQeSkois/HwM/h9K+Rwc/CYEgI4qcB3x+nS5E8uvrU6bVOJivpUB 5chw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a056a00158c00b004fafbbff888si12037495pfk.348.2022.04.05.01.04.14; Tue, 05 Apr 2022 01:04:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232854AbiDEIF1 (ORCPT + 99 others); Tue, 5 Apr 2022 04:05:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236364AbiDEICI (ORCPT ); Tue, 5 Apr 2022 04:02:08 -0400 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9A594B438 for ; Tue, 5 Apr 2022 01:00:09 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id b17so14072174lfv.3 for ; Tue, 05 Apr 2022 01:00:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=a/qsag3sAyioO3+ak2r/PvC834IWCFPW787+/S1QtlE=; b=qJqor+2BC1l2zeAzKb+KYeRKC3MXQSQ/q1DzsJe6brmoCm0mnK22oKHn2c8+eanm0r 1i1B39mqMOs3+SctN/Wm+L93y1Xb9HSCK8sHEGGd5zCLwF9H6AJfxgo4Js6QpKEnh/t9 KPIFZ3C7OuPflphEPoBajEdvbVpj58AUqEDMuN6KJOcKcegsxhMBfqDQRsPwdTjEUfKQ hWRtaT6tToKyJVVhIzNLKBrmPhUOcnbKsrWmy0JYUQYGUq6rpClaAgzp/nzPZsBBWE/X ZpNd4UR77ozbp/5nYkWP1M0K98Eo7UtFjgkxVAaAwwxvbkrj58vsLfps3oDuQucQDH5b HwMw== X-Gm-Message-State: AOAM530rJSTRzuHgA732kk1CgrZgV0eHI50G/4i4P309vx8lOwj2HvKW YlAeRMKg0HPrwUU5F2KVquhsOfyq13aqquyHSzg= X-Received: by 2002:a05:6512:690:b0:44a:30d6:fb1c with SMTP id t16-20020a056512069000b0044a30d6fb1cmr1766791lfe.430.1649145608043; Tue, 05 Apr 2022 01:00:08 -0700 (PDT) MIME-Version: 1.0 References: <20220404201750.1082470-1-luiz.dentz@gmail.com> In-Reply-To: From: Adam Pigg Date: Tue, 5 Apr 2022 08:59:56 +0100 Message-ID: Subject: Re: [RFC BlueZ] gap: Don't attempt to read the appearance if already set To: Luiz Augusto von Dentz Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Luiz On Mon, 4 Apr 2022 at 23:19, Luiz Augusto von Dentz wrote: > > Hi Adam, > > On Mon, Apr 4, 2022 at 1:17 PM Luiz Augusto von Dentz > wrote: > > > > From: Luiz Augusto von Dentz > > > > Devices are unlikely to change appearance over time which is the reason > > why we cache then on the storage so this skips reading it on every > > reconnection. > > --- > > profiles/gap/gas.c | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/profiles/gap/gas.c b/profiles/gap/gas.c > > index ea3249be9..400818d67 100644 > > --- a/profiles/gap/gas.c > > +++ b/profiles/gap/gas.c > > @@ -142,6 +142,11 @@ static void read_appearance_cb(bool success, uint8_t att_ecode, > > > > static void handle_appearance(struct gas *gas, uint16_t value_handle) > > { > > + uint16_t value; > > + > > + if (!device_get_appearance(gas->device, &value)) > > + return; > > + > > if (!bt_gatt_client_read_value(gas->client, value_handle, > > read_appearance_cb, gas, NULL)) > > DBG("Failed to send request to read appearance"); > > -- > > 2.35.1 > > Check if the above works for you. > Yes, this will work for me. Reading the appearance still fails, but at least I can manually set it in the info file, and I can instruct users to do the same, The other way I was thinking about making it work would be to add some kind of quirk to skip reading the appearance altogether, which would probably also require editing a config file anyway, and this way, the appearance value gets set (im using 0x0192) Thanks > -- > Luiz Augusto von Dentz