Hi Arman, On 3 October 2014 05:35, Arman Uguray <armansito@xxxxxxxxxxxx> wrote: > 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? > Thanks, > Arman BR Marcin -- 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