Re: [PATCH 3/4] shared/gatt: Add included service iterator

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

 



Hi Marcin,

>>> +bool bt_gatt_iter_next_included_service(struct bt_gatt_iter *iter,
>>> +                               uint16_t *handle, uint16_t *start_handle,
>>> +                               uint16_t *end_handle, uint8_t uuid[16])
>>> +{
>>> +       struct bt_gatt_result *read_result;
>>> +       const void *pdu_ptr;
>>> +       int i = 0;
>>> +
>>> +       if (!iter || !iter->result || !handle || !start_handle || !end_handle
>>> +                                                               || !uuid)
>>> +               return false;
>>> +
>>> +       if (iter->result->opcode != BT_ATT_OP_READ_BY_TYPE_RSP)
>>> +               return false;
>>
>> Remember that characteristics are also obtained via a Read By Type
>> request. I think we should make it so that
>> bt_gatt_iter_next_included_service and
>> bt_gatt_iter_next_characteristic return false if called on the
>> incorrect PDU. So it might make sense to add a flag to bt_gatt_result
>> such as "is_include" and check against that in both functions.
>>
>
> I think we can use data_length instead of flag. For characteristics
> data_len is 7 or 21, for included it is 6 or 8.
> Is it ok?

Yeah, that would work too (probably might be better actually, since
it's consistent with the ATT protocol PDU approach in those
iterators). So yeah, let's go with your suggestion.

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