Loading system/bta/dm/bta_dm_act.cc +3 −2 Original line number Original line Diff line number Diff line Loading @@ -1145,7 +1145,8 @@ void bta_dm_sdp_result(tBTA_DM_MSG* p_data) { BD_NAME_LEN + 1); BD_NAME_LEN + 1); result.disc_ble_res.services = &gatt_uuids; result.disc_ble_res.services = &gatt_uuids; bta_dm_search_cb.p_search_cback(BTA_DM_DISC_BLE_RES_EVT, &result); bta_dm_search_cb.p_search_cback(BTA_DM_GATT_OVER_SDP_RES_EVT, &result); } } } else { } else { /* SDP_DB_FULL means some records with the /* SDP_DB_FULL means some records with the Loading Loading @@ -1373,7 +1374,7 @@ void bta_dm_search_cmpl() { LOG_INFO("GATT services discovered using LE Transport"); LOG_INFO("GATT services discovered using LE Transport"); // send all result back to app // send all result back to app bta_dm_search_cb.p_search_cback(BTA_DM_DISC_BLE_RES_EVT, &result); bta_dm_search_cb.p_search_cback(BTA_DM_GATT_OVER_LE_RES_EVT, &result); bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, nullptr); bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, nullptr); Loading system/bta/include/bta_api.h +3 −2 Original line number Original line Diff line number Diff line Loading @@ -430,11 +430,12 @@ typedef void(tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data); #define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */ #define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */ #define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */ #define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */ #define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */ #define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */ #define BTA_DM_DISC_BLE_RES_EVT \ #define BTA_DM_GATT_OVER_LE_RES_EVT \ 3 /* Discovery result for BLE GATT based servoce on a peer device. */ 3 /* GATT services over LE transport discovered */ #define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */ #define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */ #define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */ #define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */ #define BTA_DM_DID_RES_EVT 7 /* Vendor/Product ID search result */ #define BTA_DM_DID_RES_EVT 7 /* Vendor/Product ID search result */ #define BTA_DM_GATT_OVER_SDP_RES_EVT 8 /* GATT services over SDP discovered */ typedef uint8_t tBTA_DM_SEARCH_EVT; typedef uint8_t tBTA_DM_SEARCH_EVT; Loading system/btif/src/btif_dm.cc +9 −3 Original line number Original line Diff line number Diff line Loading @@ -1553,14 +1553,20 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event, /* no-op */ /* no-op */ break; break; case BTA_DM_DISC_BLE_RES_EVT: { case BTA_DM_GATT_OVER_SDP_RES_EVT: case BTA_DM_GATT_OVER_LE_RES_EVT: { int num_properties = 0; int num_properties = 0; bt_property_t prop[2]; bt_property_t prop[2]; std::vector<uint8_t> property_value; std::vector<uint8_t> property_value; std::set<Uuid> uuids; std::set<Uuid> uuids; RawAddress& bd_addr = p_data->disc_ble_res.bd_addr; RawAddress& bd_addr = p_data->disc_ble_res.bd_addr; LOG_INFO("New BLE UUIDs for %s:", bd_addr.ToString().c_str()); if (event == BTA_DM_GATT_OVER_LE_RES_EVT) { LOG_INFO("New GATT over LE UUIDs for %s:", bd_addr.ToString().c_str()); } else { LOG_INFO("New GATT over SDP UUIDs for %s:", bd_addr.ToString().c_str()); } for (Uuid uuid : *p_data->disc_ble_res.services) { for (Uuid uuid : *p_data->disc_ble_res.services) { if (btif_is_interesting_le_service(uuid)) { if (btif_is_interesting_le_service(uuid)) { if (btif_should_ignore_uuid(uuid)) { if (btif_should_ignore_uuid(uuid)) { Loading @@ -1573,7 +1579,7 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event, } } if (uuids.empty()) { if (uuids.empty()) { LOG_INFO("No well known BLE services discovered"); LOG_INFO("No well known GATT services discovered"); return; return; } } Loading system/btif/src/btif_util.cc +2 −1 Original line number Original line Diff line number Diff line Loading @@ -112,9 +112,10 @@ const char* dump_dm_search_event(uint16_t event) { CASE_RETURN_STR(BTA_DM_INQ_RES_EVT) CASE_RETURN_STR(BTA_DM_INQ_RES_EVT) CASE_RETURN_STR(BTA_DM_INQ_CMPL_EVT) CASE_RETURN_STR(BTA_DM_INQ_CMPL_EVT) CASE_RETURN_STR(BTA_DM_DISC_RES_EVT) CASE_RETURN_STR(BTA_DM_DISC_RES_EVT) CASE_RETURN_STR(BTA_DM_DISC_BLE_RES_EVT) CASE_RETURN_STR(BTA_DM_GATT_OVER_LE_RES_EVT) CASE_RETURN_STR(BTA_DM_DISC_CMPL_EVT) CASE_RETURN_STR(BTA_DM_DISC_CMPL_EVT) CASE_RETURN_STR(BTA_DM_SEARCH_CANCEL_CMPL_EVT) CASE_RETURN_STR(BTA_DM_SEARCH_CANCEL_CMPL_EVT) CASE_RETURN_STR(BTA_DM_GATT_OVER_SDP_RES_EVT) default: default: return "UNKNOWN MSG ID"; return "UNKNOWN MSG ID"; Loading system/btif/test/btif_core_test.cc +4 −1 Original line number Original line Diff line number Diff line Loading @@ -227,10 +227,13 @@ TEST_F(BtifCoreTest, dump_dm_search_event) { std::make_pair(BTA_DM_INQ_RES_EVT, "BTA_DM_INQ_RES_EVT"), std::make_pair(BTA_DM_INQ_RES_EVT, "BTA_DM_INQ_RES_EVT"), std::make_pair(BTA_DM_INQ_CMPL_EVT, "BTA_DM_INQ_CMPL_EVT"), std::make_pair(BTA_DM_INQ_CMPL_EVT, "BTA_DM_INQ_CMPL_EVT"), std::make_pair(BTA_DM_DISC_RES_EVT, "BTA_DM_DISC_RES_EVT"), std::make_pair(BTA_DM_DISC_RES_EVT, "BTA_DM_DISC_RES_EVT"), std::make_pair(BTA_DM_DISC_BLE_RES_EVT, "BTA_DM_DISC_BLE_RES_EVT"), std::make_pair(BTA_DM_GATT_OVER_LE_RES_EVT, "BTA_DM_GATT_OVER_LE_RES_EVT"), std::make_pair(BTA_DM_DISC_CMPL_EVT, "BTA_DM_DISC_CMPL_EVT"), std::make_pair(BTA_DM_DISC_CMPL_EVT, "BTA_DM_DISC_CMPL_EVT"), std::make_pair(BTA_DM_SEARCH_CANCEL_CMPL_EVT, std::make_pair(BTA_DM_SEARCH_CANCEL_CMPL_EVT, "BTA_DM_SEARCH_CANCEL_CMPL_EVT"), "BTA_DM_SEARCH_CANCEL_CMPL_EVT"), std::make_pair(BTA_DM_GATT_OVER_SDP_RES_EVT, "BTA_DM_GATT_OVER_SDP_RES_EVT"), }; }; for (const auto& event : events) { for (const auto& event : events) { ASSERT_STREQ(event.second.c_str(), dump_dm_search_event(event.first)); ASSERT_STREQ(event.second.c_str(), dump_dm_search_event(event.first)); Loading Loading
system/bta/dm/bta_dm_act.cc +3 −2 Original line number Original line Diff line number Diff line Loading @@ -1145,7 +1145,8 @@ void bta_dm_sdp_result(tBTA_DM_MSG* p_data) { BD_NAME_LEN + 1); BD_NAME_LEN + 1); result.disc_ble_res.services = &gatt_uuids; result.disc_ble_res.services = &gatt_uuids; bta_dm_search_cb.p_search_cback(BTA_DM_DISC_BLE_RES_EVT, &result); bta_dm_search_cb.p_search_cback(BTA_DM_GATT_OVER_SDP_RES_EVT, &result); } } } else { } else { /* SDP_DB_FULL means some records with the /* SDP_DB_FULL means some records with the Loading Loading @@ -1373,7 +1374,7 @@ void bta_dm_search_cmpl() { LOG_INFO("GATT services discovered using LE Transport"); LOG_INFO("GATT services discovered using LE Transport"); // send all result back to app // send all result back to app bta_dm_search_cb.p_search_cback(BTA_DM_DISC_BLE_RES_EVT, &result); bta_dm_search_cb.p_search_cback(BTA_DM_GATT_OVER_LE_RES_EVT, &result); bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, nullptr); bta_dm_search_cb.p_search_cback(BTA_DM_DISC_CMPL_EVT, nullptr); Loading
system/bta/include/bta_api.h +3 −2 Original line number Original line Diff line number Diff line Loading @@ -430,11 +430,12 @@ typedef void(tBTA_DM_SEC_CBACK)(tBTA_DM_SEC_EVT event, tBTA_DM_SEC* p_data); #define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */ #define BTA_DM_INQ_RES_EVT 0 /* Inquiry result for a peer device. */ #define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */ #define BTA_DM_INQ_CMPL_EVT 1 /* Inquiry complete. */ #define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */ #define BTA_DM_DISC_RES_EVT 2 /* Discovery result for a peer device. */ #define BTA_DM_DISC_BLE_RES_EVT \ #define BTA_DM_GATT_OVER_LE_RES_EVT \ 3 /* Discovery result for BLE GATT based servoce on a peer device. */ 3 /* GATT services over LE transport discovered */ #define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */ #define BTA_DM_DISC_CMPL_EVT 4 /* Discovery complete. */ #define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */ #define BTA_DM_SEARCH_CANCEL_CMPL_EVT 6 /* Search cancelled */ #define BTA_DM_DID_RES_EVT 7 /* Vendor/Product ID search result */ #define BTA_DM_DID_RES_EVT 7 /* Vendor/Product ID search result */ #define BTA_DM_GATT_OVER_SDP_RES_EVT 8 /* GATT services over SDP discovered */ typedef uint8_t tBTA_DM_SEARCH_EVT; typedef uint8_t tBTA_DM_SEARCH_EVT; Loading
system/btif/src/btif_dm.cc +9 −3 Original line number Original line Diff line number Diff line Loading @@ -1553,14 +1553,20 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event, /* no-op */ /* no-op */ break; break; case BTA_DM_DISC_BLE_RES_EVT: { case BTA_DM_GATT_OVER_SDP_RES_EVT: case BTA_DM_GATT_OVER_LE_RES_EVT: { int num_properties = 0; int num_properties = 0; bt_property_t prop[2]; bt_property_t prop[2]; std::vector<uint8_t> property_value; std::vector<uint8_t> property_value; std::set<Uuid> uuids; std::set<Uuid> uuids; RawAddress& bd_addr = p_data->disc_ble_res.bd_addr; RawAddress& bd_addr = p_data->disc_ble_res.bd_addr; LOG_INFO("New BLE UUIDs for %s:", bd_addr.ToString().c_str()); if (event == BTA_DM_GATT_OVER_LE_RES_EVT) { LOG_INFO("New GATT over LE UUIDs for %s:", bd_addr.ToString().c_str()); } else { LOG_INFO("New GATT over SDP UUIDs for %s:", bd_addr.ToString().c_str()); } for (Uuid uuid : *p_data->disc_ble_res.services) { for (Uuid uuid : *p_data->disc_ble_res.services) { if (btif_is_interesting_le_service(uuid)) { if (btif_is_interesting_le_service(uuid)) { if (btif_should_ignore_uuid(uuid)) { if (btif_should_ignore_uuid(uuid)) { Loading @@ -1573,7 +1579,7 @@ static void btif_dm_search_services_evt(tBTA_DM_SEARCH_EVT event, } } if (uuids.empty()) { if (uuids.empty()) { LOG_INFO("No well known BLE services discovered"); LOG_INFO("No well known GATT services discovered"); return; return; } } Loading
system/btif/src/btif_util.cc +2 −1 Original line number Original line Diff line number Diff line Loading @@ -112,9 +112,10 @@ const char* dump_dm_search_event(uint16_t event) { CASE_RETURN_STR(BTA_DM_INQ_RES_EVT) CASE_RETURN_STR(BTA_DM_INQ_RES_EVT) CASE_RETURN_STR(BTA_DM_INQ_CMPL_EVT) CASE_RETURN_STR(BTA_DM_INQ_CMPL_EVT) CASE_RETURN_STR(BTA_DM_DISC_RES_EVT) CASE_RETURN_STR(BTA_DM_DISC_RES_EVT) CASE_RETURN_STR(BTA_DM_DISC_BLE_RES_EVT) CASE_RETURN_STR(BTA_DM_GATT_OVER_LE_RES_EVT) CASE_RETURN_STR(BTA_DM_DISC_CMPL_EVT) CASE_RETURN_STR(BTA_DM_DISC_CMPL_EVT) CASE_RETURN_STR(BTA_DM_SEARCH_CANCEL_CMPL_EVT) CASE_RETURN_STR(BTA_DM_SEARCH_CANCEL_CMPL_EVT) CASE_RETURN_STR(BTA_DM_GATT_OVER_SDP_RES_EVT) default: default: return "UNKNOWN MSG ID"; return "UNKNOWN MSG ID"; Loading
system/btif/test/btif_core_test.cc +4 −1 Original line number Original line Diff line number Diff line Loading @@ -227,10 +227,13 @@ TEST_F(BtifCoreTest, dump_dm_search_event) { std::make_pair(BTA_DM_INQ_RES_EVT, "BTA_DM_INQ_RES_EVT"), std::make_pair(BTA_DM_INQ_RES_EVT, "BTA_DM_INQ_RES_EVT"), std::make_pair(BTA_DM_INQ_CMPL_EVT, "BTA_DM_INQ_CMPL_EVT"), std::make_pair(BTA_DM_INQ_CMPL_EVT, "BTA_DM_INQ_CMPL_EVT"), std::make_pair(BTA_DM_DISC_RES_EVT, "BTA_DM_DISC_RES_EVT"), std::make_pair(BTA_DM_DISC_RES_EVT, "BTA_DM_DISC_RES_EVT"), std::make_pair(BTA_DM_DISC_BLE_RES_EVT, "BTA_DM_DISC_BLE_RES_EVT"), std::make_pair(BTA_DM_GATT_OVER_LE_RES_EVT, "BTA_DM_GATT_OVER_LE_RES_EVT"), std::make_pair(BTA_DM_DISC_CMPL_EVT, "BTA_DM_DISC_CMPL_EVT"), std::make_pair(BTA_DM_DISC_CMPL_EVT, "BTA_DM_DISC_CMPL_EVT"), std::make_pair(BTA_DM_SEARCH_CANCEL_CMPL_EVT, std::make_pair(BTA_DM_SEARCH_CANCEL_CMPL_EVT, "BTA_DM_SEARCH_CANCEL_CMPL_EVT"), "BTA_DM_SEARCH_CANCEL_CMPL_EVT"), std::make_pair(BTA_DM_GATT_OVER_SDP_RES_EVT, "BTA_DM_GATT_OVER_SDP_RES_EVT"), }; }; for (const auto& event : events) { for (const auto& event : events) { ASSERT_STREQ(event.second.c_str(), dump_dm_search_event(event.first)); ASSERT_STREQ(event.second.c_str(), dump_dm_search_event(event.first)); Loading