diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2022-07-07 04:50:11 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2022-07-07 04:50:11 -0700 |
commit | dd6dc18f57235bf19b3886f51c1c91baa5d62ecc (patch) | |
tree | 57eebc6f0878d2d2aa19ccae6ad8332ecbd4c83d /system/stack/gatt/gatt_api.cc | |
parent | 241b2b700fd3cf842291ce13513d6bbb50564560 (diff) | |
parent | c8523f5c9dfc0d3cf2f3ecc3c7f89326733fb276 (diff) |
Merge c8523f5c9dfc0d3cf2f3ecc3c7f89326733fb276 on remote branch
Change-Id: Ibd4beb7c71dd436610071aff26ccde92e237dfbd
Diffstat (limited to 'system/stack/gatt/gatt_api.cc')
-rw-r--r-- | system/stack/gatt/gatt_api.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/system/stack/gatt/gatt_api.cc b/system/stack/gatt/gatt_api.cc index b55e62563e..303223f6af 100644 --- a/system/stack/gatt/gatt_api.cc +++ b/system/stack/gatt/gatt_api.cc @@ -998,8 +998,8 @@ tGATT_IF GATT_Register(const Uuid& app_uuid128, std::string name, for (i_gatt_if = 0, p_reg = gatt_cb.cl_rcb; i_gatt_if < GATT_MAX_APPS; i_gatt_if++, p_reg++) { if (p_reg->in_use && p_reg->app_uuid128 == app_uuid128) { - LOG(ERROR) << __func__ << ": Application already registered " - << app_uuid128; + LOG_ERROR("Application already registered, uuid=%s", + app_uuid128.ToString().c_str()); return 0; } } @@ -1022,9 +1022,8 @@ tGATT_IF GATT_Register(const Uuid& app_uuid128, std::string name, } } - LOG(ERROR) << __func__ - << ": Unable to register GATT client, MAX client reached: " - << GATT_MAX_APPS; + LOG_ERROR("Unable to register GATT client, MAX client reached: %d", + GATT_MAX_APPS); return 0; } @@ -1111,7 +1110,7 @@ void GATT_Deregister(tGATT_IF gatt_if) { void GATT_StartIf(tGATT_IF gatt_if) { tGATT_REG* p_reg; tGATT_TCB* p_tcb; - RawAddress bda; + RawAddress bda = {}; uint8_t start_idx, found_idx; uint16_t conn_id; tBT_TRANSPORT transport; @@ -1124,10 +1123,15 @@ void GATT_StartIf(tGATT_IF gatt_if) { while ( gatt_find_the_connected_bda(start_idx, bda, &found_idx, &transport)) { p_tcb = gatt_find_tcb_by_addr(bda, transport); + LOG_INFO("GATT interface %d already has connected device %s", +gatt_if, + bda.ToString().c_str()); if (p_reg->app_cb.p_conn_cb && p_tcb) { conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, gatt_if); + LOG_INFO("Invoking callback with connection id %d", conn_id); (*p_reg->app_cb.p_conn_cb)(gatt_if, bda, conn_id, true, GATT_CONN_OK, transport); + } else { + LOG_INFO("Skipping callback as none is registered"); } start_idx = ++found_idx; } |