Hi Arman, >>> +bool bt_gatt_discover_primary_services(struct bt_gatt *gatt, bt_uuid_t *uuid, >>> + bt_gatt_discovery_callback_t callback, >>> + void *user_data); >>> + >>> +bool bt_gatt_discover_included_services(struct bt_gatt *gatt, >>> + struct bt_gatt_handle_range range, >>> + bt_uuid_t *uuid, >>> + bt_gatt_discovery_callback_t callback, >>> + void *user_data); >>> + >>> +bool bt_gatt_discover_characteristics(struct bt_gatt *gatt, >>> + struct bt_gatt_handle_range range, >>> + bt_uuid_t *uuid, >>> + bt_gatt_discovery_callback_t callback, >>> + void *user_data); >>> + >>> +bool bt_gatt_discover_descriptors(struct bt_gatt *gatt, >>> + struct bt_gatt_handle_range range, >>> + bt_gatt_discovery_callback_t callback, >>> + void *user_data); >> >> Should we really expose these low-level operations? Why not just have one bt_gatt_discover() that does all the magic for us. At the end of the day, that is what most devices do when they connect to a remote device. They will update the services they either know or have to discover new ones. > > I think we should have them. I pretty much see bt_gatt as an interface > that translates GATT feature procedures to the underlying ATT protocol > operations. I leave the magic to be the responsibility of the of the > upper-layer, where we will have a client implementation that brings > together src/shared/gatt and src/shared/gatt-db. I'm thinking > something along the lines of a btd_gatt_client for bluetoothd, that > discovers everything, caches all attributes, and makes them accessible > to all the profiles/plugins (this is actually what I'm doing initially > on Chrome OS using GAttrib, since we're against a deadline for > Chrome). Eventually we could use this to remove the attio callbacks. so in the long run I want to share as much code of BlueZ for Android with BlueZ upstream code. Meaning that we should just implement the actual procedures we are doing and not having to repeat the magic to make service discovery smart. > So, to answer your question, I think having these functions at this > level will be useful, especially for testing when we start writing PTS > style tests for GATT. Do you already happen to have a list of PTS test cases that would need special handling? Regards Marcel -- 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