OSDN Git Service

HIDH: Initialize the ctrl_cid after trigger l2cap disconnect
authorweichinweng <weichinweng@google.com>
Wed, 21 Apr 2021 07:42:27 +0000 (15:42 +0800)
committerweichinweng <weichinweng@google.com>
Wed, 21 Apr 2021 07:42:27 +0000 (15:42 +0800)
Since the ctrl_cid doesn't initialize, the HIDH sm can't initialize.
Next time, can't correctly trigger connect and handle the ctrl_cid
connect request.

Bug: 184128916
Test: compile && disconnect/reconnect HID device
Tag: #feature
Change-Id: I7bafe8728726d3df1d0bc58c8bc5224260042365

stack/hid/hidh_conn.cc

index 31a30a4..8f725bc 100644 (file)
@@ -535,6 +535,7 @@ static void hidh_l2cif_disconnect(uint16_t l2cap_cid) {
     if (p_hcon->ctrl_cid) {
       HIDH_TRACE_EVENT("HID-Host Initiating L2CAP Ctrl disconnection");
       L2CA_DisconnectReq(p_hcon->ctrl_cid);
+      p_hcon->ctrl_cid = 0;
     }
   }