All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC BlueZ] gap: Don't attempt to read the appearance if already set
@ 2022-04-04 20:17 Luiz Augusto von Dentz
  2022-04-04 20:51 ` Luiz Augusto von Dentz
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2022-04-04 20:17 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [RFC BlueZ] gap: Don't attempt to read the appearance if already set
  2022-04-04 20:17 [RFC BlueZ] gap: Don't attempt to read the appearance if already set Luiz Augusto von Dentz
@ 2022-04-04 20:51 ` Luiz Augusto von Dentz
  2022-04-05  7:59   ` Adam Pigg
  2022-04-04 22:40 ` [RFC,BlueZ] " bluez.test.bot
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2022-04-04 20:51 UTC (permalink / raw)
  To: linux-bluetooth

Hi Adam,

On Mon, Apr 4, 2022 at 1:17 PM Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
>
> 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.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [RFC,BlueZ] gap: Don't attempt to read the appearance if already set
  2022-04-04 20:17 [RFC BlueZ] gap: Don't attempt to read the appearance if already set Luiz Augusto von Dentz
  2022-04-04 20:51 ` Luiz Augusto von Dentz
@ 2022-04-04 22:40 ` bluez.test.bot
  2022-04-05  5:54 ` [RFC BlueZ] " Paul Menzel
  2022-04-06 23:30 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2022-04-04 22:40 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 995 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=628906

---Test result---

Test Summary:
CheckPatch                    PASS      0.65 seconds
GitLint                       PASS      0.45 seconds
Prep - Setup ELL              PASS      45.95 seconds
Build - Prep                  PASS      0.44 seconds
Build - Configure             PASS      9.39 seconds
Build - Make                  PASS      1311.83 seconds
Make Check                    PASS      12.17 seconds
Make Check w/Valgrind         PASS      472.21 seconds
Make Distcheck                PASS      252.30 seconds
Build w/ext ELL - Configure   PASS      8.86 seconds
Build w/ext ELL - Make        PASS      1291.83 seconds
Incremental Build with patchesPASS      0.00 seconds



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC BlueZ] gap: Don't attempt to read the appearance if already set
  2022-04-04 20:17 [RFC BlueZ] gap: Don't attempt to read the appearance if already set Luiz Augusto von Dentz
  2022-04-04 20:51 ` Luiz Augusto von Dentz
  2022-04-04 22:40 ` [RFC,BlueZ] " bluez.test.bot
@ 2022-04-05  5:54 ` Paul Menzel
  2022-04-06 23:30 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: Paul Menzel @ 2022-04-05  5:54 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Dear Luiz,


Am 04.04.22 um 22:17 schrieb Luiz Augusto von Dentz:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 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");

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC BlueZ] gap: Don't attempt to read the appearance if already set
  2022-04-04 20:51 ` Luiz Augusto von Dentz
@ 2022-04-05  7:59   ` Adam Pigg
  0 siblings, 0 replies; 6+ messages in thread
From: Adam Pigg @ 2022-04-05  7:59 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hi Luiz

On Mon, 4 Apr 2022 at 23:19, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
>
> Hi Adam,
>
> On Mon, Apr 4, 2022 at 1:17 PM Luiz Augusto von Dentz
> <luiz.dentz@gmail.com> wrote:
> >
> > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> >
> > 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [RFC BlueZ] gap: Don't attempt to read the appearance if already set
  2022-04-04 20:17 [RFC BlueZ] gap: Don't attempt to read the appearance if already set Luiz Augusto von Dentz
                   ` (2 preceding siblings ...)
  2022-04-05  5:54 ` [RFC BlueZ] " Paul Menzel
@ 2022-04-06 23:30 ` patchwork-bot+bluetooth
  3 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2022-04-06 23:30 UTC (permalink / raw)
  To: Luiz Augusto von Dentz; +Cc: linux-bluetooth

Hello:

This patch was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Mon,  4 Apr 2022 13:17:50 -0700 you wrote:
> From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
> 
> 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(+)

Here is the summary with links:
  - [RFC,BlueZ] gap: Don't attempt to read the appearance if already set
    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=bbeabca44a3d

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-06 23:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-04 20:17 [RFC BlueZ] gap: Don't attempt to read the appearance if already set Luiz Augusto von Dentz
2022-04-04 20:51 ` Luiz Augusto von Dentz
2022-04-05  7:59   ` Adam Pigg
2022-04-04 22:40 ` [RFC,BlueZ] " bluez.test.bot
2022-04-05  5:54 ` [RFC BlueZ] " Paul Menzel
2022-04-06 23:30 ` patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.