Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp32164pxb; Mon, 4 Apr 2022 23:02:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw53lPn63Uvq9bIH0JpDUx/Cc5EOWS8+lEl5hMzorIJzrqahcKEjvNoXK+lqm1kYAU+SQHT X-Received: by 2002:aa7:8889:0:b0:4fd:aae0:a94c with SMTP id z9-20020aa78889000000b004fdaae0a94cmr1819846pfe.76.1649138556149; Mon, 04 Apr 2022 23:02:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649138556; cv=none; d=google.com; s=arc-20160816; b=Db4EbwlvfzZaXkaIA9viEM3BaCDg9r99Kv9ciH+OslD7ZvLdQCEIGTp9o+7GqUbJJA ypZs3In+SfhYIEi1GPiA4NBeRncSvq2WY1zsuYy+nW19ke7znQCF6ZNP8K74Mwozx2l5 SuH9apKzfIPj6hEcQgSDHcvGnxfAZ71+3N1leJQ+6ERXwbXHTYwsu0+l6+9XlzNe1WDs TVoF+mrlP2Ze99ZY46tUIKwm5sU5madoHC3vm4JbJeZHC+ZPCvmlD4+IVsgvkda5dEoG 4sdr2/gaWNqsqRyTIxiGGmMRPMaJreKO1Q/HizV/TgaPRqhHuz17jsjucsEv+0VQOETb /Zow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=ifdbDYzGvBHZT6/nX4ofIMQZjjZvrfb20sKPJA7DE+Y=; b=SPmQdb7dvodg81SncGmG5uQR03nis9MQrZ8NhS57DHLc4Ahxol2Se5NZ+U6yz2mGpv dQsD01JUkZksgW5ZTaPAh6jIk7rgOalXnJgE2VlrBXZR6ECvV5kOR4xGO/BUvCXUxczd NA/tCRbqlIENZxD40toZwhXGA+jNpUvWwoQM/hem/Zr2Fa2nv1C95C2GnW+lY547T0Mh 4krrh8covEUU0cazCfLyhhx7A1jUowJCJbbSWvxbt4Jx5o/7JMuqlX3NSyqdWlGBxool DU5LbliorTPVblQnCEW25arRNZs0ZDKG1pnlV7bW6dDo6A4ztYhEfR4Y60Sg5PKOoMGm E74A== 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 u1-20020a17090341c100b00153b2d165b0si12984953ple.440.2022.04.04.23.01.41; Mon, 04 Apr 2022 23:02:35 -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 S229976AbiDEF4n (ORCPT + 99 others); Tue, 5 Apr 2022 01:56:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229968AbiDEF4m (ORCPT ); Tue, 5 Apr 2022 01:56:42 -0400 Received: from mx1.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D79F6972E for ; Mon, 4 Apr 2022 22:54:44 -0700 (PDT) Received: from [192.168.0.2] (ip5f5ae8ff.dynamic.kabel-deutschland.de [95.90.232.255]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 5BDBC61E64846; Tue, 5 Apr 2022 07:54:41 +0200 (CEST) Message-ID: Date: Tue, 5 Apr 2022 07:54:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC BlueZ] gap: Don't attempt to read the appearance if already set Content-Language: en-US To: Luiz Augusto von Dentz References: <20220404201750.1082470-1-luiz.dentz@gmail.com> Cc: linux-bluetooth@vger.kernel.org From: Paul Menzel In-Reply-To: <20220404201750.1082470-1-luiz.dentz@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Dear Luiz, Am 04.04.22 um 22:17 schrieb Luiz Augusto von Dentz: > 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 s/then/them/ > reconnection. Kind regards, Paul > --- > 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");