{"action":"created","issue":{"url":"https://api.github.com/repos/randdusing/BluetoothLE/issues/139","labels_url":"https://api.github.com/repos/randdusing/BluetoothLE/issues/139/labels{/name}","comments_url":"https://api.github.com/repos/randdusing/BluetoothLE/issues/139/comments","events_url":"https://api.github.com/repos/randdusing/BluetoothLE/issues/139/events","html_url":"https://github.com/randdusing/BluetoothLE/issues/139","id":58291498,"number":139,"title":"Can't disconnect a device once it goes out of range","user":{"login":"blhack","id":673603,"avatar_url":"https://avatars.githubusercontent.com/u/673603?v=3","gravatar_id":"","url":"https://api.github.com/users/blhack","html_url":"https://github.com/blhack","followers_url":"https://api.github.com/users/blhack/followers","following_url":"https://api.github.com/users/blhack/following{/other_user}","gists_url":"https://api.github.com/users/blhack/gists{/gist_id}","starred_url":"https://api.github.com/users/blhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blhack/subscriptions","organizations_url":"https://api.github.com/users/blhack/orgs","repos_url":"https://api.github.com/users/blhack/repos","events_url":"https://api.github.com/users/blhack/events{/privacy}","received_events_url":"https://api.github.com/users/blhack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-20T00:08:18Z","updated_at":"2015-02-26T22:57:31Z","closed_at":null,"body":"If I connect to a device, and then the device goes out of range (or if I power the BLE device off), I am unable to disconnect from it.  This means that I am also unable to reconnect, connect, etc. to it.\r\n\r\ndisconnectSuccess is called with status \"disconnecting\", but then never achieves \"disconnect\" status, and disconnectError is never called.\r\n\r\n(Is this normal behavior?  Or is there something else I need to call so that I am able to reconnect to devices if they come back into range?)\r\n\r\nI am on a Nexus 5 - Android 5.0.1."},"comment":{"url":"https://api.github.com/repos/randdusing/BluetoothLE/issues/comments/76293601","html_url":"https://github.com/randdusing/BluetoothLE/issues/139#issuecomment-76293601","issue_url":"https://api.github.com/repos/randdusing/BluetoothLE/issues/139","id":76293601,"user":{"login":"randdusing","id":6188656,"avatar_url":"https://avatars.githubusercontent.com/u/6188656?v=3","gravatar_id":"","url":"https://api.github.com/users/randdusing","html_url":"https://github.com/randdusing","followers_url":"https://api.github.com/users/randdusing/followers","following_url":"https://api.github.com/users/randdusing/following{/other_user}","gists_url":"https://api.github.com/users/randdusing/gists{/gist_id}","starred_url":"https://api.github.com/users/randdusing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randdusing/subscriptions","organizations_url":"https://api.github.com/users/randdusing/orgs","repos_url":"https://api.github.com/users/randdusing/repos","events_url":"https://api.github.com/users/randdusing/events{/privacy}","received_events_url":"https://api.github.com/users/randdusing/received_events","type":"User","site_admin":false},"created_at":"2015-02-26T22:57:31Z","updated_at":"2015-02-26T22:57:31Z","body":"I was able to reproduce the issue and believe it only affects 5.0+. Below 5.0 when a device was disconnected unexpectedly, the function returned status=>SUCCESS (Yes, this didn't really make sense) and state=>DISCONNECT. Now in 5.0, it's returning status=>NO_SUCCESS. My code to handle NO_SUCCESS was incorrect since I assumed this error would only occur on the initial connection attempt. Checking out some other bugs, and I should commit later tonight"}}