-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple Bluetooth connections (Android) #152
Comments
In terms of instantiating a new connection on each firmware-installation attempt this seems to be the intended behavior indeed (See the comment in the end however). To be precise our library is not doing it. It's merely wrapping around the native Java libraries provided by Nordic and in the particular case of the firmware installer it simply instantiates a "FirmwareUpgradeManager" passing it a transport pointing to the desired BLE device and let's Nordic's manager figure out the rest: Line 107 in d4756e5
As you noticed experimentally the manager instantiates a new android connection every time if you follow our code samples (which instantiate a new FirmwareInstaller() every time). This is perfectly normal and it's the expected behavior. There is no reason for the underlying connection to be cached and reused in such a "firmware-installation context" considering that: (1) the target device will reboot in the end and for that matter the ble-connection is trashed anyway (this immediately rules out the "reusable connection" concept) In regard to the behavior you're seeing in the debug logs can you elaborate a bit more as to what leads you to believe that there are more than 1 connections active towards the device? The debug log you've provided is a bit fussy for me to make heads and tails out of it. I suspect that even though the disconnect method is called somehow it doesn't have the desired effect. Line 206 in d4756e5
Can you share your C# code as a snippet to have a quick look at it? PS: Come to think of it the .Disconnect() implementation can be simplified a bit. Will issue a new beta-version and let you try it out to see if it makes any difference (https://github.com/Laerdal/Laerdal.McuMgr/releases/tag/v2.49.3-beta). Appreciate the report. Let me know how it goes. |
Thank you for your reply, i will test it next week, when im back from vacation. Br |
Hallo i haven't had time to test it further. But i doubt its a big issue. They way i replicated was: |
If you could share the snippet of the C# code I can try to replicate it on my end to be 100% sure that I'm not missing something obvious on Android (per the motto "when stumbling upon something fishy -> investigate" ;) ) Appreciate the feedback. |
You shouldnt spend time on it. I will close this for now and if it ever becomes an issue, i will open a new ticket. BR Pelle. |
Hi,
First of all, thank you so much for providing such a great package!
I’m currently implementing it into our MAUI app and have encountered a few issues. I’m not sure how significant the problem is, but for testing purposes, I’ve been flashing my device with two different firmware versions repeatedly to ensure everything runs smoothly. However, I noticed that each time I update the firmware, a new Bluetooth connection is created.
In this case i have flashed the my device 3 times:
Here 4 times, it keeps adding more connections:
I do
private void CleanupFirmwareInstaller()
{
_firmwareInstaller?.Disconnect();
_firmwareInstaller = null;
}
after each update.
BR Pelle.
The text was updated successfully, but these errors were encountered: