diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2012-12-14 15:37:26 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-12-14 15:37:26 +0200 |
commit | 766efe9e0d996284f4dcc7c5d9fe2f51b38730f5 (patch) | |
tree | 07355d64958952e23f88eed2645dcbf949e6292f /profiles/scanparam | |
parent | 24998ea93418daafa83e86275c664b2fdd1b0f4a (diff) | |
download | bluez-766efe9e0d996284f4dcc7c5d9fe2f51b38730f5.tar.gz |
profiles: Make use of btd_device_get_primary
Diffstat (limited to 'profiles/scanparam')
-rw-r--r-- | profiles/scanparam/scan.c | 19 |
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) |