GithubHelp home page GithubHelp logo

Comments (3)

KentaHarada avatar KentaHarada commented on August 22, 2024

@kenwdelong

if there is a connection already open, should we close it before we call DfuServiceInitiator.start()?

Yes. You should close the GATT connection before call DFU Library.
Because the connection will be processed in DFU Library.

is is a good or bad idea to clear the GATT cach

I think that it not a good idea. Because refresh() is hide method. I tried it on some Android devices but
Failed to call it(Some android device don't have refresh() method.)

@philips77
Is my understanding correct ?

from android-dfu-library.

philips77 avatar philips77 commented on August 22, 2024

Hi, so in theory you may have as many BluetoothGatt objects as you want (to some extent) connected to the same device. Also other apps can do as well. The system keeps the physical connection and each gatt obj is just an interface of it. The physical connection is closed when the last gatt is disconnected. Keep in mind, that during the dfu you'll get a disconnect event, so there is not much sense in keeping one not closed, unless you want to listen to its notifications... for some reason.

Refresh() method used to help connecting to a device on older platforms. But since Android ~6 it's no longer needed and connections, at least on higher quality phone, are stable. I'd say: try without, try with, check if it's worth. Also it's not easy to use it, as you call it in BluetoothGatt object, which you get on connection. There is no callback for refresh. It tigers internal service discovery after which you will not be notified when it's done, and calling discoverServices() too early will restart it. You may call it after disconnecting, before close(), but then the first connection may fail... And so on :)

from android-dfu-library.

kenwdelong avatar kenwdelong commented on August 22, 2024

Excellent, thank you everyone!

from android-dfu-library.

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.