summaryrefslogtreecommitdiff
path: root/profiles/scanparam
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2012-12-14 15:37:26 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2012-12-14 15:37:26 +0200
commit766efe9e0d996284f4dcc7c5d9fe2f51b38730f5 (patch)
tree07355d64958952e23f88eed2645dcbf949e6292f /profiles/scanparam
parent24998ea93418daafa83e86275c664b2fdd1b0f4a (diff)
downloadbluez-766efe9e0d996284f4dcc7c5d9fe2f51b38730f5.tar.gz
profiles: Make use of btd_device_get_primary
Diffstat (limited to 'profiles/scanparam')
-rw-r--r--profiles/scanparam/scan.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/profiles/scanparam/scan.c b/profiles/scanparam/scan.c
index d46b79f4e..7c21ac320 100644
--- a/profiles/scanparam/scan.c
+++ b/profiles/scanparam/scan.c
@@ -266,29 +266,18 @@ static void scan_unregister(struct btd_device *device)
g_free(scan);
}
-static gint primary_uuid_cmp(gconstpointer a, gconstpointer b)
-{
- const struct gatt_primary *prim = a;
- const char *uuid = b;
-
- return g_strcmp0(prim->uuid, uuid);
-}
-
static int scan_param_probe(struct btd_profile *p, struct btd_device *device,
GSList *uuids)
{
- GSList *primaries, *l;
+ struct gatt_primary *prim;
DBG("Probing Scan Parameters");
- primaries = btd_device_get_primaries(device);
-
- l = g_slist_find_custom(primaries, SCAN_PARAMETERS_UUID,
- primary_uuid_cmp);
- if (!l)
+ prim = btd_device_get_primary(device, SCAN_PARAMETERS_UUID);
+ if (!prim)
return -EINVAL;
- return scan_register(device, l->data);
+ return scan_register(device, prim);
}
static void scan_param_remove(struct btd_profile *p, struct btd_device *device)