Comments (13)
Could you check now? Or do you want me to release beta-2?
from android-ble-library.
Sorry for the late response, I haven't had the chance to test it before. It is still not working and I think that the issue is that bluetooth state receiver is unregistered once bluetooth is turned off, meaning the new code won't be called in case described in the issue.
close()
is called once bluetooth is turned off:
and that method is unregistering bluetooth receiver:
from android-ble-library.
Oh, true. Let me think what can be done about this...
from android-ble-library.
Is there a specific reason why bluetooth state receiver is unregistered (since it is only doing something on bluetooth off state)?
Could that one be left registered? Others should be re-registered once device connects again.
from android-ble-library.
The initial intention was that you only call 'close()' or even 'disconnect()' and the manager is fully released. Connecting again registers the receiver again. But looks like i forgot about disabling BLE.
from android-ble-library.
But disabling BLE is currently different in that it sets the mOperationInProgress
flag, which actually prevents further connections. Is the regular disconnect call disconnecting gracefully so it does not set these flags and does not clear the queue or? I am not sure if setting the flag is required, since queue is cleared too. I haven't analysed the library completely, so forgive me if I make some incorrect assumptions.
from android-ble-library.
You were right about unregistering the receiver. There's no need to handle STATE_ON them. Instead, I clear the mOperationInProgress
flag. The reference to this object is nullified, but on next enqueue()
it may be set again. Any thought? You need to listen for Bluetooth ON state on your own.
from android-ble-library.
Well, with the new fix I think it will clear up my issue. I need to test it now, I am not sure if there are some other use cases where something might go wrong. I don't think it should though, since whole queue is cleared and current calls are notified about the disconnection.
from android-ble-library.
I can confirm that this fix has resolved my issue. It would be nice if you could include this in beta2.
Thank you for the quick resolution
from android-ble-library.
I'll release in a second.
from android-ble-library.
Released in beta2.
from android-ble-library.
This needs verification again with 2.0-beta9. I had to revert one change that was introduced here.
from android-ble-library.
Fixed, tested and seems to be working. Released in 2.0-beta10.
from android-ble-library.
Related Issues (20)
- Ask a question, thank you HOT 1
- Want to get the characteristic on which the data was received for the characteristics I have subscribed to get notified for HOT 2
- Concurrent modification exception while notifying device disconnected
- Disconnect not working on various Samsung devices HOT 2
- No response from writeCharacteristic HOT 5
- Question: Will this allow me to send HCI Level Commands? HOT 1
- I stoped receiving notifications even when i have still not get all data HOT 23
- Sometimes causing system Bluetooth to crash. HOT 4
- Notification does not clear after setup a device HOT 3
- Connection interval changes on its own HOT 3
- OTA upgrade problem HOT 1
- Cannot connect the BLE device HOT 6
- A couple of questions, possibly bugs HOT 4
- BLE Scanner stop working
- Scanner issue
- Internal write characteistic and dead system exception HOT 1
- Issue with auto connect HOT 1
- Need help with configuration HOT 1
- Issue with disconnect question HOT 3
- Oppo not show Bonding message HOT 1
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-ble-library.