Giter Site home page Giter Site logo

Comments (4)

SergioChan avatar SergioChan commented on August 23, 2024

连接之前试着调用一下 GATTServer 的 close() 清除之前的连接试试?

from fastble.

beiliubei avatar beiliubei commented on August 23, 2024

+1

from fastble.

Jasonchenlijian avatar Jasonchenlijian commented on August 23, 2024

连接断开之后的重连很简单,在void onDisConnected(BluetoothGatt gatt, int status, BleException exception)调用boolean gatt.connect()方法即可,当外设再次处于可连接状态时,就会自动连上。
连接断开之后可以根据实际情况进行重连,但如果是连接失败的情况,建议不要立即重连,而是调用void closeBluetoothGatt()清空一下状态,并延迟一段时间等待复位,否则会把gatt阻塞,导致手机不重启蓝牙就再也无法连接任何设备的严重情况。

from fastble.

BaoTaoGitHub avatar BaoTaoGitHub commented on August 23, 2024

俺也一样,俺也遇到一模不两样的问题~

from fastble.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.