Re: [PATCH v2 01/11] shared/gatt: Introduce gatt-helpers.h skeleton.

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

 



Hi Marcel,

I gave some thought to the iterator approach (even if we do this in an
upcoming patch set, we might as well continue the discussion here). I
think there is benefit to at least some processing of the PDU, since
the format of its contents vary a lot between the different discovery
procedures (i.e. all primary services, primary services by UUID,
characteristics, and descriptors). This is what I have in mind:

struct bt_gatt_result;
struct bt_gatt_iter;

typedef enum {
        BT_GATT_RESULT_TYPE_SERVICE,
        BT_GATT_RESULT_TYPE_CHARACTERISTIC,
        BT_GATT_RESULT_TYPE_DESCRIPTOR,
} bt_gatt_result_type_t;

bt_gatt_result_type_t bt_gatt_result_get_type(struct bt_gatt_result *result);
void bt_gatt_result_destroy(struct bt_gatt_result *result);

bool bt_gatt_iter_init(struct bt_gatt_iter *iter, struct
bt_gatt_result *result);
bool bt_gatt_iter_next_service(struct bt_gatt_iter *iter,
                                        struct bt_gatt_service **service);
bool bt_gatt_iter_next_characteristic(struct bt_gatt_iter *iter,
                                struct bt_gatt_characteristic **characteristic);
bool bt_gatt_iter_next_descriptor(struct bt_gatt_iter *iter,
                                        struct bt_gatt_descriptor **descriptor);

We keep the initial bt_gatt_service, bt_gatt_characteristic,
bt_gatt_descriptor structures and allow iterating through a linked
list of arrays of these structures. I think the data contained in
those structures are essential and providing anything less isn't very
useful, though we can always add other iterator functions in the
future.

Any thoughts/suggestions?

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