diff options
author | Wootak Jung <wootak.jung@samsung.com> | 2020-09-10 11:11:46 +0900 |
---|---|---|
committer | Wootak Jung <wootak.jung@samsung.com> | 2020-09-10 11:11:46 +0900 |
commit | a1347393d099989e3b5d9dc9db25007444d6fb86 (patch) | |
tree | fedf021a086b2e05ea5914a07991f37818b5af4e | |
parent | ba8c7450c49692ed522bec273cd3e76b8ad9ae9b (diff) | |
download | bluetooth-a1347393d099989e3b5d9dc9db25007444d6fb86.tar.gz bluetooth-a1347393d099989e3b5d9dc9db25007444d6fb86.tar.bz2 bluetooth-a1347393d099989e3b5d9dc9db25007444d6fb86.zip |
Fix le advertising service data parsing logicsubmit/tizen/20200910.053710accepted/tizen/unified/20200910.123916
Change-Id: I02a964819ebf1e51a39f9f78cf55c30fda5bc700
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
-rw-r--r-- | src/bluetooth-adapter.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/bluetooth-adapter.c b/src/bluetooth-adapter.c index e445a89..d4c22e6 100644 --- a/src/bluetooth-adapter.c +++ b/src/bluetooth-adapter.c @@ -2256,7 +2256,6 @@ static int __bt_find_uuid_in_service_data(bt_advertiser_h advertiser, char *adv_data = NULL; int adv_len = 0; bt_advertiser_s *__adv = (bt_advertiser_s *)advertiser; - bt_adapter_le_advertising_data_type_e data_type = BT_ADAPTER_LE_ADVERTISING_DATA_SERVICE_DATA; if (pkt_type == BT_ADAPTER_LE_PACKET_ADVERTISING) { @@ -2265,8 +2264,10 @@ static int __bt_find_uuid_in_service_data(bt_advertiser_h advertiser, } else if (pkt_type == BT_ADAPTER_LE_PACKET_SCAN_RESPONSE) { adv_data = __adv->scan_rsp_data; adv_len = __adv->scan_rsp_data_len; - } else + } else { + BT_ERR("Invalid Pakcet Type"); return BT_ERROR_INVALID_PARAMETER; + } if (!adv_data) { BT_INFO("Currently there is no advertisement data"); @@ -2278,7 +2279,7 @@ static int __bt_find_uuid_in_service_data(bt_advertiser_h advertiser, len = adv_data[i]; type = adv_data[i + 1]; - if (type == data_type) { + if (type == BT_ADAPTER_LE_ADVERTISING_DATA_SERVICE_DATA) { if (!memcmp((adv_data + i + 2), uuid, 2)) { BT_INFO("uuid matched"); *exist = true; @@ -2286,7 +2287,7 @@ static int __bt_find_uuid_in_service_data(bt_advertiser_h advertiser, } } - i = len + 1; + i += (len + 1); } *exist = false; |