Hi,
I want to report an issue I came across while I was on vacation. A DeviceScan will cause a WLAN disconnect when your mobile device is connected to a foreign network (G3/LTE) - sounds strange? YES you are right - but this is ONLY happening, when you are on roaming!
This summer I have integrated ANT+ support to my Android application - worked smooth like silk - now I have spend my vacation in Spain and I have observed that each time when I start my app a short while after I was disconnected from the Hotel WLAN - and I was unable to re-connect to WLAN while my app was/is running.
It took me a while to get to connection, between ANT+ usage and the WLAN disconnect. But as soon as I deactivate the ANT+ support my my App - the WLAN connection is stable - it is always a pleasure to fire up the IDE at the beach B-)
In my App preferences I store the paired deviceIDs and each launch the app will try to connect to these registered devices. As soon as one of these (previously paired) devices is not available I will get disconnected from the WLAN. But this ONLY happens while I am on roaming (foreign mobile network)! Never happen before @home while implementing & testing (and after my return I can ensure, that it does not happen back in German).
In my actual case I make use of the following methods:
AntPlusBikeSpeedDistancePcc.requestAsyncScanController
or
AntPlusHeartRatePcc.requestAsyncScanController
as soon as I make this call and the corresponding ANT+ device is not in range/available the WLAN will be disconnected!
Since I do not expect hat you will be interested in investigate my source code - this issue could be simply reproduce by using the ANT+ sample Application:
1. Make sure WLAN is on and you are connected
2. Make sure that you are on Mobile Roaming connection (here on my Android 7.1 this is indicated by a small letter 'R'
3. Launch the ANT+ Plugin Sampler App
4. Choose from the List the 'Multi Device Search' demo
5. Push the 'S elect All' button
6. Press the 'Start Search'
7. Notice after a short while (not longer then 45sec) that the Android WLAN symbol disappears from the header bar an the there is no way to connect back to the WLAN while the ANT+ search is running
8. Cancel the running multi device search and notice that you WLAN connection will be reestablished - or if that will not automatically will happen, you can connect again manually.
Please note, that there is no difference, when the Mobile SIM will the deactivated completely - even then - as soon as the scan will be started the WLAN get's disconnected.
The only way I get around it (keep WLAN alive) is be starting my ANT+ HR device, select only the HR-Device in the MultiScan... and as soon as my HR-Device will be listed, connect to it...
So my assumption is, that somewhere in the SCAN process (when there are no devices in range) somewhere in the LIB Code the WLAN disconnect will be caused.
Kind Regards
Matthias
PS: if you need/want more details - just let me know