diff --git a/src/device.c b/src/device.c
index 01c40a7..77466ff 100644
--- a/src/device.c
+++ b/src/device.c
return (device->authr != NULL);
}
+static int primary_uuid_cmp(gconstpointer a, gconstpointer b)
+{
+ const struct gatt_primary *prim = a;
+ const char *uuid = b;
+
+ return strcasecmp(prim->uuid, uuid);
+}
+
+struct gatt_primary *btd_device_get_primary(struct btd_device *device,
+ const char *uuid)
+{
+ GSList *match;
+
+ match = g_slist_find_custom(device->primaries, uuid, primary_uuid_cmp);
+ if (match)
+ return match->data;
+
+ return NULL;
+}
+
GSList *btd_device_get_primaries(struct btd_device *device)
{
return device->primaries;
diff --git a/src/device.h b/src/device.h
index b9e20cc..8534117 100644
--- a/src/device.h
+++ b/src/device.h
void device_probe_profiles(struct btd_device *device, GSList *profiles);
const sdp_record_t *btd_device_get_record(struct btd_device *device,
const char *uuid);
+struct gatt_primary *btd_device_get_primary(struct btd_device *device,
+ const char *uuid);
GSList *btd_device_get_primaries(struct btd_device *device);
void btd_device_gatt_set_service_changed(struct btd_device *device,
uint16_t start, uint16_t end);