Loading system/btif/src/btif_gatt_server.cc +7 −5 Original line number Diff line number Diff line Loading @@ -339,12 +339,14 @@ static bt_status_t btif_gatts_open(int server_if, const bt_bdaddr_t* bd_addr, } static void btif_gatts_close_impl(int server_if, BD_ADDR address, int conn_id) { // Cancel pending foreground/background connections // Close active connection if (conn_id != 0) BTA_GATTS_Close(conn_id); else BTA_GATTS_CancelOpen(server_if, address, true); BTA_GATTS_CancelOpen(server_if, address, false); // Close active connection if (conn_id != 0) BTA_GATTS_Close(conn_id); // Cancel pending background connections BTA_GATTS_CancelOpen(server_if, address, false); } static bt_status_t btif_gatts_close(int server_if, const bt_bdaddr_t* bd_addr, Loading system/stack/gatt/gatt_main.cc +9 −1 Original line number Diff line number Diff line Loading @@ -253,11 +253,19 @@ bool gatt_disconnect(tGATT_TCB* p_tcb) { * * Description Update the application use link status * * Returns true if any modifications are made, false otherwise. * Returns true if any modifications are made or * when it already exists, false otherwise. * ******************************************************************************/ bool gatt_update_app_hold_link_status(tGATT_IF gatt_if, tGATT_TCB* p_tcb, bool is_add) { for (int i = 0; i < GATT_MAX_APPS; i++) { if (p_tcb->app_hold_link[i] == gatt_if && is_add) { GATT_TRACE_DEBUG("%s: gatt_if %d already exists at idx %d", __func__, gatt_if, i); return true; } } for (int i = 0; i < GATT_MAX_APPS; i++) { if (p_tcb->app_hold_link[i] == 0 && is_add) { p_tcb->app_hold_link[i] = gatt_if; Loading Loading
system/btif/src/btif_gatt_server.cc +7 −5 Original line number Diff line number Diff line Loading @@ -339,12 +339,14 @@ static bt_status_t btif_gatts_open(int server_if, const bt_bdaddr_t* bd_addr, } static void btif_gatts_close_impl(int server_if, BD_ADDR address, int conn_id) { // Cancel pending foreground/background connections // Close active connection if (conn_id != 0) BTA_GATTS_Close(conn_id); else BTA_GATTS_CancelOpen(server_if, address, true); BTA_GATTS_CancelOpen(server_if, address, false); // Close active connection if (conn_id != 0) BTA_GATTS_Close(conn_id); // Cancel pending background connections BTA_GATTS_CancelOpen(server_if, address, false); } static bt_status_t btif_gatts_close(int server_if, const bt_bdaddr_t* bd_addr, Loading
system/stack/gatt/gatt_main.cc +9 −1 Original line number Diff line number Diff line Loading @@ -253,11 +253,19 @@ bool gatt_disconnect(tGATT_TCB* p_tcb) { * * Description Update the application use link status * * Returns true if any modifications are made, false otherwise. * Returns true if any modifications are made or * when it already exists, false otherwise. * ******************************************************************************/ bool gatt_update_app_hold_link_status(tGATT_IF gatt_if, tGATT_TCB* p_tcb, bool is_add) { for (int i = 0; i < GATT_MAX_APPS; i++) { if (p_tcb->app_hold_link[i] == gatt_if && is_add) { GATT_TRACE_DEBUG("%s: gatt_if %d already exists at idx %d", __func__, gatt_if, i); return true; } } for (int i = 0; i < GATT_MAX_APPS; i++) { if (p_tcb->app_hold_link[i] == 0 && is_add) { p_tcb->app_hold_link[i] = gatt_if; Loading