{"action":"closed","issue":{"url":"https://api.github.com/repos/dcodeIO/ByteBuffer.js/issues/41","labels_url":"https://api.github.com/repos/dcodeIO/ByteBuffer.js/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/dcodeIO/ByteBuffer.js/issues/41/comments","events_url":"https://api.github.com/repos/dcodeIO/ByteBuffer.js/issues/41/events","html_url":"https://github.com/dcodeIO/ByteBuffer.js/issues/41","id":54141562,"number":41,"title":"Error","user":{"login":"jpacora","id":2137673,"avatar_url":"https://avatars.githubusercontent.com/u/2137673?v=3","gravatar_id":"","url":"https://api.github.com/users/jpacora","html_url":"https://github.com/jpacora","followers_url":"https://api.github.com/users/jpacora/followers","following_url":"https://api.github.com/users/jpacora/following{/other_user}","gists_url":"https://api.github.com/users/jpacora/gists{/gist_id}","starred_url":"https://api.github.com/users/jpacora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpacora/subscriptions","organizations_url":"https://api.github.com/users/jpacora/orgs","repos_url":"https://api.github.com/users/jpacora/repos","events_url":"https://api.github.com/users/jpacora/events{/privacy}","received_events_url":"https://api.github.com/users/jpacora/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-13T02:02:03Z","updated_at":"2015-06-02T02:33:01Z","closed_at":"2015-06-02T02:33:01Z","body":"Hello, im having this error:\r\nRangeError: Illegal range: 0 <= 21 <= 16 <= 32\r\n\r\nMy code is:\r\n  var cmd = 'DYD,000000#';\r\n  var command = new ByteBuffer();\r\n  command.writeByte(0x78);\r\n  command.writeByte(0x78); // size\r\n  command.writeByte(5 + cmd.length); // size\r\n  command.writeByte(0x80); //Protocol Number\r\n  command.writeByte(4 + cmd.length); //Length of Command\r\n  command.writeByte(0x91); // Server Flag Bit end\r\n  command.writeUTF8String(cmd)\r\n  command.writeShort(crc.crc16ccitt(command.slice(2, 4)));\r\n  command.writeByte(0x0D); command.writeByte(0x0A); // ending\r\n  console.dir(command)\r\n  socket.write(command.toString('hex'))"}}