Skip to content
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

Android Device reconnect exception #42

Open
KeyvanPouyan opened this issue May 13, 2015 · 3 comments
Open

Android Device reconnect exception #42

KeyvanPouyan opened this issue May 13, 2015 · 3 comments

Comments

@KeyvanPouyan
Copy link

For each instance of the IDevice on Android side there is an event subscription. This is done using a Lambda. It is preferred to hook this up to an actual delegate for the purpose of event unsubscription. In the constructor of the Device the DeviceConnected event is being subscribed to. In case of disconnect, this event is not cleared. So the next time the same device is discovered and connected to, previous event gets the first notification. The GATT instance in the initial IDevice is null so it throws an exception.

@smoy
Copy link

smoy commented May 13, 2015

I submitted a pull request to fix that here: #41

@KeyvanPouyan
Copy link
Author

Thanks Steven. Just one more issue I forgot to mention on the issue I created. Upon triggering the connection made event, the returned device is added to the list of connect devices. However it is never removed from the list once disconnected. I don't use that list since my app will only talk to one designated BLE device at a time. It would be nice to fix in case someone is planning on a multi-connection session.

@smoy
Copy link

smoy commented May 14, 2015

I submitted a pull request to address ConnectedDevices property: #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants