{"action":"created","issue":{"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/73","repository_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le","labels_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/73/comments","events_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/73/events","html_url":"https://github.com/xabre/xamarin-bluetooth-le/issues/73","id":170598428,"number":73,"title":"ConnectToKnownDeviceAsync Crash When Bluetooth is not in Range","user":{"login":"alberk8","id":12510130,"avatar_url":"https://avatars.githubusercontent.com/u/12510130?v=3","gravatar_id":"","url":"https://api.github.com/users/alberk8","html_url":"https://github.com/alberk8","followers_url":"https://api.github.com/users/alberk8/followers","following_url":"https://api.github.com/users/alberk8/following{/other_user}","gists_url":"https://api.github.com/users/alberk8/gists{/gist_id}","starred_url":"https://api.github.com/users/alberk8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alberk8/subscriptions","organizations_url":"https://api.github.com/users/alberk8/orgs","repos_url":"https://api.github.com/users/alberk8/repos","events_url":"https://api.github.com/users/alberk8/events{/privacy}","received_events_url":"https://api.github.com/users/alberk8/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/milestones/2","html_url":"https://github.com/xabre/xamarin-bluetooth-le/milestones/1.1.0","labels_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/milestones/2/labels","id":1836932,"number":2,"title":"1.1.0","description":"","creator":{"login":"xabre","id":6204446,"avatar_url":"https://avatars.githubusercontent.com/u/6204446?v=3","gravatar_id":"","url":"https://api.github.com/users/xabre","html_url":"https://github.com/xabre","followers_url":"https://api.github.com/users/xabre/followers","following_url":"https://api.github.com/users/xabre/following{/other_user}","gists_url":"https://api.github.com/users/xabre/gists{/gist_id}","starred_url":"https://api.github.com/users/xabre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xabre/subscriptions","organizations_url":"https://api.github.com/users/xabre/orgs","repos_url":"https://api.github.com/users/xabre/repos","events_url":"https://api.github.com/users/xabre/events{/privacy}","received_events_url":"https://api.github.com/users/xabre/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2016-06-19T21:21:35Z","updated_at":"2016-08-11T09:51:48Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-08-11T08:55:43Z","updated_at":"2016-08-12T10:13:58Z","closed_at":null,"body":"## Steps to reproduce\r\n\r\n1. Move Bluetooth device out of Range and run the APP to connect to it.\r\n2. await _bleAdapter.ConnectToKnownDeviceAsync(Guid.Parse(\"00000000-0000-0000-0000-f6bfd73398f7\"));\r\n\r\n## Expected behavior\r\nThe ConnectToKnownDeviceAsync Call should return an Exception with out crashing. \r\n\r\n## Actual behavior\r\nThe Call returns an Exception and then Crash the App.\r\n\r\n### Crashlog\r\n08-11 16:45:13.241 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:13.241 D/Mono    ( 7274): Searching for 'java_interop_jnienv_call_boolean_method_a'.\r\n08-11 16:45:13.241 D/Mono    ( 7274): Probing 'java_interop_jnienv_call_boolean_method_a'.\r\n08-11 16:45:13.241 D/Mono    ( 7274): Found as 'java_interop_jnienv_call_boolean_method_a'.\r\n08-11 16:45:13.278 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:13.278 D/Mono    ( 7274): Searching for 'java_interop_jnienv_call_int_method_a'.\r\n08-11 16:45:13.278 D/Mono    ( 7274): Probing 'java_interop_jnienv_call_int_method_a'.\r\n08-11 16:45:13.278 D/Mono    ( 7274): Found as 'java_interop_jnienv_call_int_method_a'.\r\n08-11 16:45:13.284 D/Mono    ( 7274): Assembly Ref addref Plugin.BLE.Abstractions[0x555c27e800] -> System.Threading.Tasks[0x555c291d00]: 2\r\n08-11 16:45:13.284 D/Mono    ( 7274): Assembly Ref addref System.Threading.Tasks[0x555c291d00] -> mscorlib[0x555c2b6830]: 18\r\n08-11 16:45:13.296 D/Mono    ( 7274): Assembly Ref addref Plugin.BLE.Abstractions[0x555c27e800] -> System.Collections[0x555c283920]: 3\r\n08-11 16:45:13.310 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:13.310 D/Mono    ( 7274): Searching for 'java_interop_jnienv_get_static_int_field'.\r\n08-11 16:45:13.310 D/Mono    ( 7274): Probing 'java_interop_jnienv_get_static_int_field'.\r\n08-11 16:45:13.311 D/Mono    ( 7274): Found as 'java_interop_jnienv_get_static_int_field'.\r\n08-11 16:45:13.368 V/BoostFramework( 7274): mAcquireFunc method = public int com.qualcomm.qti.Performance.perfLockAcquire(int,int[])\r\n08-11 16:45:13.368 V/BoostFramework( 7274): mReleaseFunc method = public int com.qualcomm.qti.Performance.perfLockRelease()\r\n08-11 16:45:13.368 V/BoostFramework( 7274): mAcquireTouchFunc method = public int com.qualcomm.qti.Performance.perfLockAcquireTouch(android.view.MotionEvent,android.util.DisplayMetrics,int,int[])\r\n08-11 16:45:13.368 V/BoostFramework( 7274): mIOPStart method = public int com.qualcomm.qti.Performance.perfIOPrefetchStart(int,java.lang.String)\r\n08-11 16:45:13.368 V/BoostFramework( 7274): mIOPStop method = public int com.qualcomm.qti.Performance.perfIOPrefetchStop()\r\n08-11 16:45:13.373 V/BoostFramework( 7274): BoostFramework() : mPerf = com.qualcomm.qti.Performance@1cb8f62\r\n08-11 16:45:13.373 V/BoostFramework( 7274): BoostFramework() : mPerf = com.qualcomm.qti.Performance@12818f3\r\n08-11 16:45:13.423 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:13.423 D/Mono    ( 7274): Searching for 'java_interop_jnienv_call_nonvirtual_object_method_a'.\r\n08-11 16:45:13.423 D/Mono    ( 7274): Probing 'java_interop_jnienv_call_nonvirtual_object_method_a'.\r\n08-11 16:45:13.423 D/Mono    ( 7274): Found as 'java_interop_jnienv_call_nonvirtual_object_method_a'.\r\n08-11 16:45:13.487 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:13.487 D/Mono    ( 7274): Searching for 'java_interop_jnienv_call_void_method_a'.\r\n08-11 16:45:13.487 D/Mono    ( 7274): Probing 'java_interop_jnienv_call_void_method_a'.\r\n08-11 16:45:13.487 D/Mono    ( 7274): Found as 'java_interop_jnienv_call_void_method_a'.\r\n08-11 16:45:13.492 D/Mono    ( 7274): Assembly Ref addref Plugin.BLE.Abstractions[0x555c27e800] -> System.Threading[0x555c280f50]: 3\r\n08-11 16:45:13.512 D/OpenGLRenderer( 7274): Use EGL_SWAP_BEHAVIOR_PRESERVED: true\r\n08-11 16:45:13.520 D/ActivityThreadInjector( 7274): clearCachedDrawables.\r\n08-11 16:45:13.577 I/Adreno  ( 7274): QUALCOMM build                   : 3ab7efa, Iaaff4ce0ae\r\n08-11 16:45:13.577 I/Adreno  ( 7274): Build Date                       : 07/21/16\r\n08-11 16:45:13.577 I/Adreno  ( 7274): OpenGL ES Shader Compiler Version: XE031.07.00.01\r\n08-11 16:45:13.577 I/Adreno  ( 7274): Local Branch                     : \r\n08-11 16:45:13.577 I/Adreno  ( 7274): Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.UM.5.1_RB1.06.00.01.192.038\r\n08-11 16:45:13.577 I/Adreno  ( 7274): Remote Branch                    : NONE\r\n08-11 16:45:13.577 I/Adreno  ( 7274): Reconstruct Branch               : NOTHING\r\n08-11 16:45:13.586 I/OpenGLRenderer( 7274): Initialized EGL, version 1.4\r\n08-11 16:45:17.502 D/Mono    ( 7274): DllImport attempting to load: '__Internal'.\r\n08-11 16:45:17.502 D/Mono    ( 7274): DllImport loaded library '(null)'.\r\n08-11 16:45:17.503 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:17.503 D/Mono    ( 7274): Searching for 'monodroid_get_system_property'.\r\n08-11 16:45:17.503 D/Mono    ( 7274): Probing 'monodroid_get_system_property'.\r\n08-11 16:45:17.503 D/Mono    ( 7274): Found as 'monodroid_get_system_property'.\r\n08-11 16:45:17.503 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:17.503 D/Mono    ( 7274): Searching for 'monodroid_free'.\r\n08-11 16:45:17.503 D/Mono    ( 7274): Probing 'monodroid_free'.\r\n08-11 16:45:17.503 D/Mono    ( 7274): Found as 'monodroid_free'.\r\n08-11 16:45:17.648 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:17.648 D/Mono    ( 7274): Searching for 'java_interop_jnienv_new_local_ref'.\r\n08-11 16:45:17.648 D/Mono    ( 7274): Probing 'java_interop_jnienv_new_local_ref'.\r\n08-11 16:45:17.648 D/Mono    ( 7274): Found as 'java_interop_jnienv_new_local_ref'.\r\n08-11 16:45:17.716 D/Mono    ( 7274): Assembly Ref addref Plugin.BLE[0x555c27fab0] -> System.Core[0x555c264390]: 4\r\n08-11 16:45:17.762 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:17.762 D/Mono    ( 7274): Searching for 'java_interop_jnienv_new_byte_array'.\r\n08-11 16:45:17.762 D/Mono    ( 7274): Probing 'java_interop_jnienv_new_byte_array'.\r\n08-11 16:45:17.762 D/Mono    ( 7274): Found as 'java_interop_jnienv_new_byte_array'.\r\n08-11 16:45:17.763 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:17.763 D/Mono    ( 7274): Searching for 'java_interop_jnienv_set_byte_array_region'.\r\n08-11 16:45:17.763 D/Mono    ( 7274): Probing 'java_interop_jnienv_set_byte_array_region'.\r\n08-11 16:45:17.764 D/Mono    ( 7274): Found as 'java_interop_jnienv_set_byte_array_region'.\r\n08-11 16:45:17.775 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:17.775 D/Mono    ( 7274): Searching for 'java_interop_jnienv_get_byte_array_region'.\r\n08-11 16:45:17.775 D/Mono    ( 7274): Probing 'java_interop_jnienv_get_byte_array_region'.\r\n08-11 16:45:17.775 D/Mono    ( 7274): Found as 'java_interop_jnienv_get_byte_array_region'.\r\n08-11 16:45:17.803 D/BluetoothManager( 7274): getConnectionState()\r\n08-11 16:45:17.803 D/BluetoothManager( 7274): getConnectedDevices\r\n08-11 16:45:17.824 D/BluetoothGatt( 7274): connect() - device: F7:AF:D7:31:80:F7, auto: false\r\n08-11 16:45:17.824 D/BluetoothGatt( 7274): registerApp()\r\n08-11 16:45:17.827 D/BluetoothGatt( 7274): registerApp() - UUID=c124b59b-0e2a-4e3e-bc08-3b46af1cac47\r\n08-11 16:45:17.829 D/BluetoothGatt( 7274): onClientRegistered() - status=0 clientIf=5\r\n08-11 16:45:47.851 D/BluetoothGatt( 7274): onClientConnectionState() - status=133 clientIf=5 device=F6:BF:D7:33:98:F7\r\nThread started:  #2\r\n08-11 16:45:47.951 D/Mono    ( 7274): DllImport attempting to load: '/system/lib64/liblog.so'.\r\n08-11 16:45:47.952 D/Mono    ( 7274): DllImport loaded library '/system/lib64/liblog.so'.\r\n08-11 16:45:47.952 D/Mono    ( 7274): DllImport searching in: '/system/lib64/liblog.so' ('/system/lib64/liblog.so').\r\n08-11 16:45:47.952 D/Mono    ( 7274): Searching for '__android_log_print'.\r\n08-11 16:45:47.952 D/Mono    ( 7274): Probing '__android_log_print'.\r\n08-11 16:45:47.952 D/Mono    ( 7274): Found as '__android_log_print'.\r\n08-11 16:45:47.952 I/mono-stdout( 7274): OnConnectionStateChange: GattCallback error: 133\r\nOnConnectionStateChange: GattCallback error: 133\r\n08-11 16:45:47.961 I/mono-stdout( 7274): Failed to connect peripheral 00000000-0000-0000-0000-f6bfd73398f7: \r\nFailed to connect peripheral 00000000-0000-0000-0000-f6bfd73398f7: \r\nConnectAsync Error: 00000000-0000-0000-0000-f6bfd73398f7 \r\n08-11 16:45:47.966 I/mono-stdout( 7274): ConnectAsync Error: 00000000-0000-0000-0000-f6bfd73398f7 \r\n08-11 16:45:48.008 D/Mono    ( 7274): DllImport searching in: '__Internal' ('(null)').\r\n08-11 16:45:48.009 D/Mono    ( 7274): Searching for 'java_interop_jnienv_call_nonvirtual_boolean_method_a'.\r\n08-11 16:45:48.009 D/Mono    ( 7274): Probing 'java_interop_jnienv_call_nonvirtual_boolean_method_a'.\r\n08-11 16:45:48.009 D/Mono    ( 7274): Found as 'java_interop_jnienv_call_nonvirtual_boolean_method_a'.\r\nDisconnected by user\r\n08-11 16:45:48.012 I/mono-stdout( 7274): Disconnected by user\r\n08-11 16:45:48.024 D/BluetoothGatt( 7274): close()\r\n08-11 16:45:48.024 D/BluetoothGatt( 7274): unregisterApp() - mClientIf=5\r\n08-11 16:45:48.026 I/mono-stdout( 7274): Error while connecting ''. Not raising disconnect event.\r\nError while connecting ''. Not raising disconnect event.\r\nUnhandled Exception:\r\n\r\nPlugin.BLE.Abstractions.Exceptions.DeviceConnectionException: GattCallback error: 133\r\n\r\n## Configuration\r\n\r\n**Version:** 1.1 (download source dated 11-Aug-2016)\r\n\r\n**Platform:** Android 6.0.1\r\nVisual Studio 2015 V14.0.25421.03 Update 3\r\nXamarin 4.1.2.18\r\nXamarin.Android 6.1.2.21\r\nAndroid API 23\r\n\r\n**Device:** Xiaomi Redmi 3S"},"comment":{"url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/comments/239411041","html_url":"https://github.com/xabre/xamarin-bluetooth-le/issues/73#issuecomment-239411041","issue_url":"https://api.github.com/repos/xabre/xamarin-bluetooth-le/issues/73","id":239411041,"user":{"login":"xabre","id":6204446,"avatar_url":"https://avatars.githubusercontent.com/u/6204446?v=3","gravatar_id":"","url":"https://api.github.com/users/xabre","html_url":"https://github.com/xabre","followers_url":"https://api.github.com/users/xabre/followers","following_url":"https://api.github.com/users/xabre/following{/other_user}","gists_url":"https://api.github.com/users/xabre/gists{/gist_id}","starred_url":"https://api.github.com/users/xabre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xabre/subscriptions","organizations_url":"https://api.github.com/users/xabre/orgs","repos_url":"https://api.github.com/users/xabre/repos","events_url":"https://api.github.com/users/xabre/events{/privacy}","received_events_url":"https://api.github.com/users/xabre/received_events","type":"User","site_admin":false},"created_at":"2016-08-12T10:13:58Z","updated_at":"2016-08-12T10:13:58Z","body":"I'll fix it as soon as possible"}}
{"actor":{"display_login":"xabre"}}