{"action":"created","issue":{"url":"https://api.github.com/repos/sandeepmistry/node-sensortag/issues/37","labels_url":"https://api.github.com/repos/sandeepmistry/node-sensortag/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/sandeepmistry/node-sensortag/issues/37/comments","events_url":"https://api.github.com/repos/sandeepmistry/node-sensortag/issues/37/events","html_url":"https://github.com/sandeepmistry/node-sensortag/issues/37","id":67305696,"number":37,"title":"Trying to connect to 2 tags at once","user":{"login":"hardillb","id":1800845,"avatar_url":"https://avatars.githubusercontent.com/u/1800845?v=3","gravatar_id":"","url":"https://api.github.com/users/hardillb","html_url":"https://github.com/hardillb","followers_url":"https://api.github.com/users/hardillb/followers","following_url":"https://api.github.com/users/hardillb/following{/other_user}","gists_url":"https://api.github.com/users/hardillb/gists{/gist_id}","starred_url":"https://api.github.com/users/hardillb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hardillb/subscriptions","organizations_url":"https://api.github.com/users/hardillb/orgs","repos_url":"https://api.github.com/users/hardillb/repos","events_url":"https://api.github.com/users/hardillb/events{/privacy}","received_events_url":"https://api.github.com/users/hardillb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-04-09T08:17:12Z","updated_at":"2015-11-20T00:46:20Z","closed_at":null,"body":"As mentioned over in the Node-Red side of things, I'm having issues connecting to multiple tags at once.\r\n\r\nThe second discover never happens.  I'm wondering if the discovery phase is shutdown by the connect call. If so I guess the only way to do it is to call discover all, save the list of discovered tags and then connect after a suitable time out period?\r\n\r\n```javascript\r\nvar SensorTag = require('sensortag');\r\n\r\nSensorTag.discoverByUuid(\"34b1f7d136b9\",function(tag){\r\n\tconsole.log(\"found \" + tag.uuid);\r\n\ttag.connect(function(){\r\n\t\ttag.discoverServicesAndCharacteristics(function(){\r\n\t\t\ttag.notifySimpleKey(function(err){\r\n\t\t\t\tconsole.log(err);\r\n\t\t\t});\r\n\t\t\ttag.on('simpleKeyChange', function(left, right){\r\n\t\t\t\tconsole.log(\"button \" + left + \" 34b\");\r\n\t\t\t});\r\n\t\t})\r\n\t});\r\n\t\r\n\t\r\n});\r\n\r\nSensorTag.discoverByUuid('1cba8c20caf3',function(tag){\r\n\tconsole.log(\"found \" + tag.uuid);\r\n\ttag.connect(function(){\r\n\t\ttag.discoverServicesAndCharacteristics(function(){\r\n\t\t\ttag.notifySimpleKey(function(err){\r\n\t\t\t\tconsole.log(err);\r\n\t\t\t});\r\n\t\t\ttag.on('simpleKeyChange', function(left, right){\r\n\t\t\t\tconsole.log(\"button \" + left + \" 1cb\");\r\n\t\t\t});\r\n\t\t})\r\n\t   });\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/sandeepmistry/node-sensortag/issues/comments/158245218","html_url":"https://github.com/sandeepmistry/node-sensortag/issues/37#issuecomment-158245218","issue_url":"https://api.github.com/repos/sandeepmistry/node-sensortag/issues/37","id":158245218,"user":{"login":"sandeepmistry","id":1163840,"avatar_url":"https://avatars.githubusercontent.com/u/1163840?v=3","gravatar_id":"","url":"https://api.github.com/users/sandeepmistry","html_url":"https://github.com/sandeepmistry","followers_url":"https://api.github.com/users/sandeepmistry/followers","following_url":"https://api.github.com/users/sandeepmistry/following{/other_user}","gists_url":"https://api.github.com/users/sandeepmistry/gists{/gist_id}","starred_url":"https://api.github.com/users/sandeepmistry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandeepmistry/subscriptions","organizations_url":"https://api.github.com/users/sandeepmistry/orgs","repos_url":"https://api.github.com/users/sandeepmistry/repos","events_url":"https://api.github.com/users/sandeepmistry/events{/privacy}","received_events_url":"https://api.github.com/users/sandeepmistry/received_events","type":"User","site_admin":false},"created_at":"2015-11-20T00:46:19Z","updated_at":"2015-11-20T00:46:19Z","body":"@jeremyjohnson your question is a bit off topic to this issue. Gitter is a better place for questions like this: https://gitter.im/sandeepmistry/node-sensortag\r\n\r\nHowever, I agree with @hardillb's answer above. The discover phase is required by this library, as the BLE lib it uses ([noble](https://github.com/sandeepmistry/noble)) requires it. "}}