Comments (3)
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.
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.
Excellent, thank you everyone!
from android-dfu-library.
Related Issues (20)
- DFU upload stops at 29% on version 2.3.1 HOT 1
- Hello! HOT 1
- Unable to use version 2.3.1 with Unity due to Java 17 not being supported. HOT 2
- [Version Android - 14] - java.lang.SecurityException: One of RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED should be specified when a receiver isn't being registered exclusively for system broadcasts HOT 10
- Crash on Android 14 because of no type on startForeground HOT 5
- Android 14 requires starting FGS with service type specified HOT 2
- Android 14 - Permission FOREGROUND_SERVICE_CONNECTED_DEVICE requires video for play store HOT 1
- Problems with binding for xamarin/maui: string with multiple placeholders HOT 6
- Application stuck after Discovering services. HOT 2
- DFU Service Not Disconnecting and Restarting After Unplanned Disconnections
- `startForeground` doesn't specify a `foregroundServiceType` HOT 2
- nRF connect crashes when device reports 0 bytes for DFU partition HOT 2
- Causing MissingForegroundServiceTypeException on android 14 HOT 1
- Dfu Failing HOT 5
- Fatal Exception: android.app.ForegroundServiceStartNotAllowedException on Android 13 / 14 HOT 6
- What are the Vendor commands used by DFU? HOT 1
- Automatic Reconnection not available on Android 14 HOT 2
- Android 14 GATT 133 1 HOT 3
- Error 8(0x8): GATT CONN TIMEOUT HOT 1
- DfuServiceInitiator requires a new method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-dfu-library.