{"action":"created","issue":{"url":"https://api.github.com/repos/01org/corelibs-arduino101/issues/231","repository_url":"https://api.github.com/repos/01org/corelibs-arduino101","labels_url":"https://api.github.com/repos/01org/corelibs-arduino101/issues/231/labels{/name}","comments_url":"https://api.github.com/repos/01org/corelibs-arduino101/issues/231/comments","events_url":"https://api.github.com/repos/01org/corelibs-arduino101/issues/231/events","html_url":"https://github.com/01org/corelibs-arduino101/issues/231","id":164316535,"number":231,"title":"Bluetooth advertising does not start sometimes","user":{"login":"bluetooth-mdw","id":8341666,"avatar_url":"https://avatars.githubusercontent.com/u/8341666?v=3","gravatar_id":"","url":"https://api.github.com/users/bluetooth-mdw","html_url":"https://github.com/bluetooth-mdw","followers_url":"https://api.github.com/users/bluetooth-mdw/followers","following_url":"https://api.github.com/users/bluetooth-mdw/following{/other_user}","gists_url":"https://api.github.com/users/bluetooth-mdw/gists{/gist_id}","starred_url":"https://api.github.com/users/bluetooth-mdw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bluetooth-mdw/subscriptions","organizations_url":"https://api.github.com/users/bluetooth-mdw/orgs","repos_url":"https://api.github.com/users/bluetooth-mdw/repos","events_url":"https://api.github.com/users/bluetooth-mdw/events{/privacy}","received_events_url":"https://api.github.com/users/bluetooth-mdw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/01org/corelibs-arduino101/labels/Under%20Review","name":"Under Review","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"SidLeung","id":15203260,"avatar_url":"https://avatars.githubusercontent.com/u/15203260?v=3","gravatar_id":"","url":"https://api.github.com/users/SidLeung","html_url":"https://github.com/SidLeung","followers_url":"https://api.github.com/users/SidLeung/followers","following_url":"https://api.github.com/users/SidLeung/following{/other_user}","gists_url":"https://api.github.com/users/SidLeung/gists{/gist_id}","starred_url":"https://api.github.com/users/SidLeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SidLeung/subscriptions","organizations_url":"https://api.github.com/users/SidLeung/orgs","repos_url":"https://api.github.com/users/SidLeung/repos","events_url":"https://api.github.com/users/SidLeung/events{/privacy}","received_events_url":"https://api.github.com/users/SidLeung/received_events","type":"User","site_admin":false},"assignees":[{"login":"SidLeung","id":15203260,"avatar_url":"https://avatars.githubusercontent.com/u/15203260?v=3","gravatar_id":"","url":"https://api.github.com/users/SidLeung","html_url":"https://github.com/SidLeung","followers_url":"https://api.github.com/users/SidLeung/followers","following_url":"https://api.github.com/users/SidLeung/following{/other_user}","gists_url":"https://api.github.com/users/SidLeung/gists{/gist_id}","starred_url":"https://api.github.com/users/SidLeung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SidLeung/subscriptions","organizations_url":"https://api.github.com/users/SidLeung/orgs","repos_url":"https://api.github.com/users/SidLeung/repos","events_url":"https://api.github.com/users/SidLeung/events{/privacy}","received_events_url":"https://api.github.com/users/SidLeung/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/01org/corelibs-arduino101/milestones/5","html_url":"https://github.com/01org/corelibs-arduino101/milestones/Deneb","labels_url":"https://api.github.com/repos/01org/corelibs-arduino101/milestones/5/labels","id":1903701,"number":5,"title":"Deneb","description":"","creator":{"login":"kitsunami","id":15161463,"avatar_url":"https://avatars.githubusercontent.com/u/15161463?v=3","gravatar_id":"","url":"https://api.github.com/users/kitsunami","html_url":"https://github.com/kitsunami","followers_url":"https://api.github.com/users/kitsunami/followers","following_url":"https://api.github.com/users/kitsunami/following{/other_user}","gists_url":"https://api.github.com/users/kitsunami/gists{/gist_id}","starred_url":"https://api.github.com/users/kitsunami/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kitsunami/subscriptions","organizations_url":"https://api.github.com/users/kitsunami/orgs","repos_url":"https://api.github.com/users/kitsunami/repos","events_url":"https://api.github.com/users/kitsunami/events{/privacy}","received_events_url":"https://api.github.com/users/kitsunami/received_events","type":"User","site_admin":false},"open_issues":19,"closed_issues":7,"state":"open","created_at":"2016-07-25T22:45:44Z","updated_at":"2016-10-07T23:19:26Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-07-07T14:03:21Z","updated_at":"2016-10-10T20:19:34Z","closed_at":null,"body":"I'm testing implementing and testing various standard Bluetooth profiles on the Genuino 101. I'm proceeding in alphabetical order.... naturally. Alert Notification was OK. But... Automation IO revealed a problem which seemed to relate to descriptors. Basically the device does not start advertising. I stripped my code right down and isolated the problem to a degree.\r\n\r\n@sandeepmistry went somewhat further and says \"I've tracked it now to this line returning 0x285 instead or 0:\r\n\r\nhttps://github.com/01org/corelibs-arduino101/blob/master/libraries/CurieBLE/src/BLECharacteristic.cpp#L205\r\n\r\n\"\r\n\r\nHere's some code to illustrate the issue\r\n\r\n```\r\n// DOES NOT ADVERTISE\r\n\r\nunsigned char AutomationIO_Digital_props = BLEWrite | BLEWriteWithoutResponse | 0;\r\nunsigned char AutomationIO_Analog_props = BLEWrite | BLEWriteWithoutResponse | 0;\r\nunsigned char AutomationIO_Aggregate_props = BLEWrite | BLEWriteWithoutResponse | 0;\r\n\r\n// Services and Characteristics\r\nBLEService AutomationIO(\"1815\");\r\nBLECharacteristic AutomationIO_Digital(\"2A56\", AutomationIO_Digital_props, 20);\r\nBLEDescriptor AutomationIO_Digital_CharacteristicPresentationFormat(\"2904\", \"0\");\r\n\r\n// Note I also tried:\r\n// BLEDescriptor AutomationIO_Digital_CharacteristicPresentationFormat(\"2904\", 0);\r\n// and\r\n// BLEDescriptor AutomationIO_Digital_CharacteristicPresentationFormat(\"2904\", 0 , 1);\r\n// and\r\n// unsigned char buffer[7]={0x00,0x00,0x00,0x00,0x00,0x00,0x00};\r\n// BLEDescriptor AutomationIO_Digital_CharacteristicPresentationFormat(\"2904\", buffer, 7);\r\n\r\n\r\n// GAP properties\r\nchar device_name[] = \"My Device\";\r\n\r\nvoid setup() {\r\n\r\n// set advertising packet content\r\n\r\n  blePeripheral.setLocalName(device_name);\r\n\r\n// add services and characteristics\r\n  blePeripheral.addAttribute(AutomationIO);\r\n  blePeripheral.addAttribute(AutomationIO_Digital);\r\n  blePeripheral.addAttribute(AutomationIO_Digital_CharacteristicPresentationFormat);\r\n// begin advertising\r\n  blePeripheral.begin();\r\n}\r\n```\r\n\r\n```\r\n// ADVERTISES if I use a different descriptor instead\r\nunsigned char AutomationIO_Digital_props = BLEWrite | BLEWriteWithoutResponse | 0;\r\nunsigned char AutomationIO_Analog_props = BLEWrite | BLEWriteWithoutResponse | 0;\r\nunsigned char AutomationIO_Aggregate_props = BLEWrite | BLEWriteWithoutResponse | 0;\r\n\r\n// Services and Characteristics\r\nBLEService AutomationIO(\"1815\");\r\nBLECharacteristic AutomationIO_Digital(\"2A56\", AutomationIO_Digital_props, 20);\r\nBLEDescriptor tempDescriptor = BLEDescriptor(\"2901\", \"Temp Celsius\");\r\n\r\n// GAP properties\r\nchar device_name[] = \"My Device\";\r\n\r\nvoid setup() {\r\n\r\n// set advertising packet content\r\n\r\n blePeripheral.setLocalName(device_name);\r\n\r\n// add services and characteristics\r\n  blePeripheral.addAttribute(AutomationIO);\r\n  blePeripheral.addAttribute(AutomationIO_Digital);\r\n  blePeripheral.addAttribute(tempDescriptor);\r\n// begin advertising\r\n  blePeripheral.begin();\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/01org/corelibs-arduino101/issues/comments/252735026","html_url":"https://github.com/01org/corelibs-arduino101/issues/231#issuecomment-252735026","issue_url":"https://api.github.com/repos/01org/corelibs-arduino101/issues/231","id":252735026,"user":{"login":"eriknyquist","id":6616775,"avatar_url":"https://avatars.githubusercontent.com/u/6616775?v=3","gravatar_id":"","url":"https://api.github.com/users/eriknyquist","html_url":"https://github.com/eriknyquist","followers_url":"https://api.github.com/users/eriknyquist/followers","following_url":"https://api.github.com/users/eriknyquist/following{/other_user}","gists_url":"https://api.github.com/users/eriknyquist/gists{/gist_id}","starred_url":"https://api.github.com/users/eriknyquist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eriknyquist/subscriptions","organizations_url":"https://api.github.com/users/eriknyquist/orgs","repos_url":"https://api.github.com/users/eriknyquist/repos","events_url":"https://api.github.com/users/eriknyquist/events{/privacy}","received_events_url":"https://api.github.com/users/eriknyquist/received_events","type":"User","site_admin":false},"created_at":"2016-10-10T20:19:34Z","updated_at":"2016-10-10T20:19:34Z","body":"@bluetooth-mdw, since you posted this issie, the BLE central feature has been added, and the peripheral code has also been re-factored. Are you still seeing this issue?"}}
{"actor":{"display_login":"eriknyquist"}}