Re: [PATCH BlueZ v1 4/4] shared/gatt-server: Support Read By Group Type request.

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

 



Hi Luiz,


>> +       if (queue_isempty(q)) {
>> +               ecode = BT_ATT_ERROR_ATTRIBUTE_NOT_FOUND;
>> +               goto error;
>> +       }
>
> This function is quite long, perhaps using queue_foreach be better
> than iterating inline since you destroy the queue at end but it would
> be a problem if one of items fails to be encoded, the funny thing is
> that it is possible to do the same with queue_find and return true to
> interrupt in case of failure but it would be a obvious abuse of the
> API so perhaps queue_foreach_func_t could have a return as well and in
> case it return false we stop.
>

I would have to modify too many places that use queue_foreach by
adding a somewhat suspicious "return true" with no obvious meaning, so
I decided not to do that for this patch set. For v2 I went ahead and
broke the encoding bit into its own helper which I plan to extend in
the future for other read requests. Hopefully this'll make the code
more readable although it doesn't call queue_foreach.

Cheers,
Arman
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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