{"action":"created","issue":{"url":"https://api.github.com/repos/sandeepmistry/noble/issues/228","labels_url":"https://api.github.com/repos/sandeepmistry/noble/issues/228/labels{/name}","comments_url":"https://api.github.com/repos/sandeepmistry/noble/issues/228/comments","events_url":"https://api.github.com/repos/sandeepmistry/noble/issues/228/events","html_url":"https://github.com/sandeepmistry/noble/issues/228","id":100830096,"number":228,"title":"Could not start scanning, state is unknown (not poweredOn)","user":{"login":"TorstenRobitzki","id":2026114,"avatar_url":"https://avatars.githubusercontent.com/u/2026114?v=3","gravatar_id":"","url":"https://api.github.com/users/TorstenRobitzki","html_url":"https://github.com/TorstenRobitzki","followers_url":"https://api.github.com/users/TorstenRobitzki/followers","following_url":"https://api.github.com/users/TorstenRobitzki/following{/other_user}","gists_url":"https://api.github.com/users/TorstenRobitzki/gists{/gist_id}","starred_url":"https://api.github.com/users/TorstenRobitzki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TorstenRobitzki/subscriptions","organizations_url":"https://api.github.com/users/TorstenRobitzki/orgs","repos_url":"https://api.github.com/users/TorstenRobitzki/repos","events_url":"https://api.github.com/users/TorstenRobitzki/events{/privacy}","received_events_url":"https://api.github.com/users/TorstenRobitzki/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-13T17:56:11Z","updated_at":"2015-08-13T19:28:55Z","closed_at":null,"body":"Hello,\r\nI've tried to scan for BLE devices:\r\n\r\n    noble = require('noble')\r\n\r\n    noble.startScanning();\r\n    console.log \"Scanning\"\r\n\r\nthis results in a error message (?):\r\n\r\n    noble: Could not start scanning, state is unknown (not poweredOn)\r\n    Scanning\r\n\r\nIs the code wrong or is the message wrong? Is intended, that a message is printed on the screen? Shouldn't an exception being thrown if a precondition is not met?\r\n\r\nI've tried 1.1.0 on OS/X 10.10\r\n\r\nCheers,\r\nTorsten"},"comment":{"url":"https://api.github.com/repos/sandeepmistry/noble/issues/comments/130812323","html_url":"https://github.com/sandeepmistry/noble/issues/228#issuecomment-130812323","issue_url":"https://api.github.com/repos/sandeepmistry/noble/issues/228","id":130812323,"user":{"login":"carlst","id":857385,"avatar_url":"https://avatars.githubusercontent.com/u/857385?v=3","gravatar_id":"","url":"https://api.github.com/users/carlst","html_url":"https://github.com/carlst","followers_url":"https://api.github.com/users/carlst/followers","following_url":"https://api.github.com/users/carlst/following{/other_user}","gists_url":"https://api.github.com/users/carlst/gists{/gist_id}","starred_url":"https://api.github.com/users/carlst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlst/subscriptions","organizations_url":"https://api.github.com/users/carlst/orgs","repos_url":"https://api.github.com/users/carlst/repos","events_url":"https://api.github.com/users/carlst/events{/privacy}","received_events_url":"https://api.github.com/users/carlst/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T19:28:55Z","updated_at":"2015-08-13T19:28:55Z","body":"@TorstenRobitzki: Yes, that is per `noble` spec. Perhaps needed to wait until any BLE device initialization or setup done by `noble` has finished, and the BLE device is ready for scanning to be initiated.\r\n\r\nYou might take a look at some of the examples, such as `examples/peripheral-explorer.js`\r\n\r\nThey are useful to better understand the control flow (scanning, connecting, discovering Services, discovering Characteristics, and so on)."}}