From 1b4597c7315e8433bfcf0d9cbde0860f890024cf Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 23 Jun 2015 12:03:30 +0300 Subject: [PATCH] shared/ad: Fix adding same instance of service data The code was checking the data in the wrong queue so it was unable to detect the same instance was already discovered. --- src/shared/ad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/ad.c b/src/shared/ad.c index e841d1d04..485bd7bc7 100644 --- a/src/shared/ad.c +++ b/src/shared/ad.c @@ -590,7 +590,7 @@ bool bt_ad_add_service_data(struct bt_ad *ad, const bt_uuid_t *uuid, void *data, if (len > (MAX_ADV_DATA_LEN - 2 - (size_t)bt_uuid_len(uuid))) return false; - new_data = queue_find(ad->service_uuids, service_uuid_match, uuid); + new_data = queue_find(ad->service_data, service_uuid_match, uuid); if (new_data) { if (new_data->len == len && !memcmp(new_data->data, data, len)) return false; -- 2.47.3