{"action":"opened","issue":{"url":"https://api.github.com/repos/sandeepmistry/noble/issues/368","repository_url":"https://api.github.com/repos/sandeepmistry/noble","labels_url":"https://api.github.com/repos/sandeepmistry/noble/issues/368/labels{/name}","comments_url":"https://api.github.com/repos/sandeepmistry/noble/issues/368/comments","events_url":"https://api.github.com/repos/sandeepmistry/noble/issues/368/events","html_url":"https://github.com/sandeepmistry/noble/issues/368","id":144328059,"number":368,"title":"buffer error while accessing a device","user":{"login":"Steckdoserich","id":14337752,"avatar_url":"https://avatars.githubusercontent.com/u/14337752?v=3","gravatar_id":"","url":"https://api.github.com/users/Steckdoserich","html_url":"https://github.com/Steckdoserich","followers_url":"https://api.github.com/users/Steckdoserich/followers","following_url":"https://api.github.com/users/Steckdoserich/following{/other_user}","gists_url":"https://api.github.com/users/Steckdoserich/gists{/gist_id}","starred_url":"https://api.github.com/users/Steckdoserich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Steckdoserich/subscriptions","organizations_url":"https://api.github.com/users/Steckdoserich/orgs","repos_url":"https://api.github.com/users/Steckdoserich/repos","events_url":"https://api.github.com/users/Steckdoserich/events{/privacy}","received_events_url":"https://api.github.com/users/Steckdoserich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-29T17:09:23Z","updated_at":"2016-03-29T17:09:23Z","closed_at":null,"body":"I am trying to write a specific handle of a ble-device. The device has got the following characteristic:\r\n\r\n`handle: 0x0046, char properties: 0x08, char value handle: 0x0047, \r\nuuid: 47e9ee30-47e9-11e4-8939-164230d1df67`\r\n\r\nmy code looks like this:\r\n\r\n```\r\nnode.once('connect', function()\r\n{\r\n  console.log(\"test connected\");\r\n  var data = new Buffer([0,0,0,0]);\r\n  console.log(\"test writeHandle\");\r\n  node.writeHandle(70,data,true, function(error)\r\n  {\r\n      if(error)\r\n      {\r\n        console.log(\"test writeHandle error: \"+error);\r\n      }\r\n      else\r\n      {\r\n        console.log(\"test writeHandle done\");\r\n        //...\r\n      }\r\n   }\r\n}\r\n```\r\nThe console shows the following:\r\n```\r\ntest connected                                                                                                                                                                                                                                                       \r\ntest writeHandle                                                                                                                                                                                                                                                     \r\n                                                                                                                                                                                                                                                                     \r\nERROR: buffer.js:491                                                                                                                                                                                                                                                 \r\nERROR:       length += buf.length;                                                                                                                                                                                                                                   \r\n             ERROR:       ^                                                                                                                                                                                                                                          \r\nERROR: TypeError: Cannot read property 'length' of undefined                                                                                                                                                                                                         \r\n    at Function.Buffer.concat (buffer.js:491:20)                                                                                                                                                                                                                     \r\n    at Object.c1 (/home/root/node_modules/noble/lib/hci-socket/crypto.js:8:19)                                                                                                                                                                                       \r\n    at Smp.handlePairingResponse (/home/root/node_modules/noble/lib/hci-socket/smp.js:86:12)                                                                                                                                                                         \r\n    at Smp.onAclStreamData (/home/root/node_modules/noble/lib/hci-socket/smp.js:57:10)                                                                                                                                                                               \r\n    at emit (events.js:117:20)                                                                                                                                                                                                                                       \r\n    at AclStream.push (/home/root/node_modules/noble/lib/hci-socket/acl-stream.js:35:10)                                                                                                                                                                             \r\n    at NobleBindings.onAclDataPkt (/home/root/node_modules/noble/lib/hci-socket/bindings.js:272:15)                                                                                                                                                                  \r\n    at emit (events.js:106:17)                                                                                                                                                                                                                                       \r\n    at Hci.onSocketData (/home/root/node_modules/noble/lib/hci-socket/hci.js:447:14)                                                                                                                                                                                 \r\n    at BluetoothHciSocket.emit (events.js:95:17)\r\n```\r\nThis error also appears when I am doing something like the following:\r\n`node.discoverSomeServicesAndCharacteristics([],[], function(err, services, characteristics)`\r\n\r\nAm I doing something wrong? Do you need further information about the device?"}}