-
Notifications
You must be signed in to change notification settings - Fork 88
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
Connect sometimes throws ConnectionLostException #523
Comments
Hard to say exactly what is going wrong without additional logs. Specifically, Android does some logging itself, and it would indicate if it saw a device disconnect. If it did, then there isn't much that can be done on Kable side (we're just responding to the statuses we get), but if there is no such log indicating a connection failure of some kind, then it could very well be a logic error. Good to know about the KDoc missing the appropriate |
Seems like Android is seeing a device disconnect with error 133. Googling this seems I am not alone. Here is one possibly related issue in this project: and another one in the android connectivity samples: android/connectivity-samples#18 Here are the logs for your confirmation:
The retry seems to work consistently, and I see quite a few people recommending that in the connectivity samples issue above. |
Ya, there isn't much Kable can do about status 133. My understanding is that reconnecting is the correct action to take in that case. Although, as you mentioned #410 may alleviate the issue, but In any case, I do plan to work on #410 soonish. |
For some reason,
peripheral.connect()
randomly throwsConnectionLostException
:It could be a buggy device, but I don't know -- when I try to connect again, it works fine. Thought I'd raise it here just in case there is a logic error. For now, I'm working around this with a retry.
I do also note that the javadoc for
connect
does not declare that it can throwConnectionLostException
, so IDEA soft warns when trying to catch it.The text was updated successfully, but these errors were encountered: