{"action":"created","issue":{"url":"https://api.github.com/repos/pauldemarco/flutter_blue/issues/32","repository_url":"https://api.github.com/repos/pauldemarco/flutter_blue","labels_url":"https://api.github.com/repos/pauldemarco/flutter_blue/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/pauldemarco/flutter_blue/issues/32/comments","events_url":"https://api.github.com/repos/pauldemarco/flutter_blue/issues/32/events","html_url":"https://github.com/pauldemarco/flutter_blue/pull/32","id":293697904,"number":32,"title":"Queue GATT operations, refactor reply channels","user":{"login":"dturing","id":582442,"avatar_url":"https://avatars3.githubusercontent.com/u/582442?v=4","gravatar_id":"","url":"https://api.github.com/users/dturing","html_url":"https://github.com/dturing","followers_url":"https://api.github.com/users/dturing/followers","following_url":"https://api.github.com/users/dturing/following{/other_user}","gists_url":"https://api.github.com/users/dturing/gists{/gist_id}","starred_url":"https://api.github.com/users/dturing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dturing/subscriptions","organizations_url":"https://api.github.com/users/dturing/orgs","repos_url":"https://api.github.com/users/dturing/repos","events_url":"https://api.github.com/users/dturing/events{/privacy}","received_events_url":"https://api.github.com/users/dturing/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-02-01T21:56:31Z","updated_at":"2018-03-16T05:43:59Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/pauldemarco/flutter_blue/pulls/32","html_url":"https://github.com/pauldemarco/flutter_blue/pull/32","diff_url":"https://github.com/pauldemarco/flutter_blue/pull/32.diff","patch_url":"https://github.com/pauldemarco/flutter_blue/pull/32.patch"},"body":"Bluetooth GATT operations cannot run concurrently, so they must be queued up to let old operations\r\nfinish before a new one is triggered.\r\n\r\nAlso, there is no need for a separate EventChannel for every kind of operation; answers (except for\r\nscanning) are now sent via the plugin's main MethodChannel.\r\n\r\nthis mostly does #11, and fixes #30"},"comment":{"url":"https://api.github.com/repos/pauldemarco/flutter_blue/issues/comments/373609709","html_url":"https://github.com/pauldemarco/flutter_blue/pull/32#issuecomment-373609709","issue_url":"https://api.github.com/repos/pauldemarco/flutter_blue/issues/32","id":373609709,"user":{"login":"janekm","id":100807,"avatar_url":"https://avatars2.githubusercontent.com/u/100807?v=4","gravatar_id":"","url":"https://api.github.com/users/janekm","html_url":"https://github.com/janekm","followers_url":"https://api.github.com/users/janekm/followers","following_url":"https://api.github.com/users/janekm/following{/other_user}","gists_url":"https://api.github.com/users/janekm/gists{/gist_id}","starred_url":"https://api.github.com/users/janekm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janekm/subscriptions","organizations_url":"https://api.github.com/users/janekm/orgs","repos_url":"https://api.github.com/users/janekm/repos","events_url":"https://api.github.com/users/janekm/events{/privacy}","received_events_url":"https://api.github.com/users/janekm/received_events","type":"User","site_admin":false},"created_at":"2018-03-16T05:43:59Z","updated_at":"2018-03-16T05:43:59Z","author_association":"NONE","body":"The code that was failing for me looks like this, with some irrelevant code removed:\r\n\r\n```dart\r\n        await _H10device.setNotifyValue(_hrCharacteristic, true);\r\n        _hrSubscription = _H10device.onValueChanged(_hrCharacteristic).listen((value) { }\r\n        await _L8device.setNotifyValue(_ppgCharacteristic, true);\r\n        _ppgSubscription = _L8device.onValueChanged(_ppgCharacteristic).listen((value) {}\r\n        await _L8device.setNotifyValue(_ecgCharacteristic, true);\r\n        _ecgSubscription = _L8device.onValueChanged(_ecgCharacteristic).listen((value) { }\r\n        await _L8device.writeCharacteristic(_controlCharacteristic, [0xab, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x01]);\r\n```\r\n\r\nLooking through FlutterBluePlugin.java, it appears that setNotifyValue is immediately returning the Response rather than waiting for the write to the descriptor to complete, which explains why this kind of code is failing. "}}
{"actor":{"display_login":"janekm"}}