Re: [BlueZ PATCH v1] shared/gatt-client:Ignore orphaned characteristics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Marcel,


On Fri, May 1, 2020 at 12:26 PM Marcel Holtmann <marcel@xxxxxxxxxxxx> wrote:
>
> Hi Alain,
>
> > The gatt discovery proceedure simplification to discover all
> > characteristics at once has exposed a device side issue where some
> > device implementation reports orphaned characteristics.  While this
> > technically shouldn't be allowed, some instances of this were observed
> > (namely on some Android phones).
> >
> > The fix is to simply skip over orphaned characteristics and continue
> > with everything else that is valid.
> >
> > This has been tested as part of the Android CTS tests against an
> > affected platform and was confirmed to have worked around the issue.
> > ---
> >
> > src/shared/gatt-client.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c
> > index 963ad619f..d604c77a3 100644
> > --- a/src/shared/gatt-client.c
> > +++ b/src/shared/gatt-client.c
> > @@ -632,7 +632,10 @@ static bool discover_descs(struct discovery_op *op, bool *discovering)
> >                       util_debug(client->debug_callback, client->debug_data,
> >                               "Failed to insert characteristic at 0x%04x",
> >                               chrc_data->value_handle);
> > -                     goto failed;
> > +
> > +                     /* Skip over invalid characteristic */
> > +                     free(chrc_data);
> > +                     continue;
> >               }
>
> should we add a warning here?
Is there a good way other than the util_debug mechanism to write  a warning?

>
> And I think it would be good to have a bit more verbose comment why this is done this way instead of aborting.
Ack, will be added in V2.

>
> Regards
>
> Marcel
>



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux