[ANDROID] Multiple calls to Mds.connect()
Hi!
I think I have found a bug in the MDS library.
I have attached a small sample application (with source) to demonstrate the problem.
I connect to my device using the following code:
mMds.connect(mac,mConnectionListener);
This works as expected, disconnecting is done by simply calling:
mMds.disconnect(mac);
However, after connecting again, disconnecting causes the onDisconnect callback to be called twice. Doing this again, causes it do get called three times. onConnectionComplete is always called only once. I am suspecting that the underlying callback/subscription is not deleted correctly. It seems this causes all kinds of problems when connecting/disconnecting to multiple devices frequently.
When looking at my minimal error sample, you would want to take a look to the MoveSenseManager class.
For your convenience, I uploaded a log here which demonstrates the problem.
Hardware: G variant: MDS Library: 1.13.0 (march 18) Android 7 (Asus tablet)
Comments (4)
-
reporter -
reporter - changed title to [ANDROID] Multiple calls to Mds.connect()
-
I can confirm this bug. It also seem to affect the onConnect method which is also called multiple times when reconnecting.
The same thing happens also when I connect 5 sensors. On the first connection onDisconnect and onConnect are called 5 times per sensor which means a total of 25 times. On the second connection, the methods are called 10 times per sensor, total of 50 times. Thus we get a huge amount of spam from those methods after a few reconnections.
I used mobile lib version 1.28.1 and firmware version 1.7.2.
-
- changed status to on hold
Is this still a problem in latest version?
- Log in to comment
Using something like this:
still causes the onDisconnect callback to fire, although onConnectionComplete is not called anymore, when connecting more than once.