arduino-libraries / ArduinoBLE

ArduinoBLE library for Arduino
GNU Lesser General Public License v2.1
310 stars 205 forks source link

`lld_pdu_get_tx_flush_nb HCI packet count mismatch (10, 11)` #359

Open Blue186 opened 6 months ago

Blue186 commented 6 months ago
    pClient  = BLEDevice::createClient();
    pClient->setClientCallbacks(new MyClientCallback());
    // 断链时间有点长
    if(!pClient->connect(*bleMacAddress,BLE_ADDR_TYPE_PUBLIC)){
      Serial.println("connect ERR");
      pClient->disconnect();
      return false;
    }

During the process of scanning from the ble client to the server and establishing a connection, if the Bluetooth signal is unstable, or if I power off the server, it will generate an lld_pdu_get_tx_flush-nb HCI packet count mismatch (10,11) error, and it will take a long time (about 30 seconds) to exit the pClient ->connect() function.

At this point, my customer service end is in a completely stuck state. Only when pClient ->connect() is completed can I exit from the stuck state. How can I quickly exit this invalid connection stuck state?