A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
| // @credit: http://stackoverflow.com/questions/8609289/convert-a-binary-nodejs-buffer-to-javascript-arraybuffer | |
| // From Buffer to ArrayBuffer: | |
| function toArrayBuffer(buffer) { | |
| var ab = new ArrayBuffer(buffer.length); | |
| var view = new Uint8Array(ab); | |
| for (var i = 0; i < buffer.length; ++i) { | |
| view[i] = buffer[i]; | |
| } |
Every command starts with 1 byte indicating if the command is a request-, write- or response-command. (All bytes are hexadecimal). Every group of bytes is little endian.
A request-command starts with 01 and gets a response-command from the watch, starting with 03. (See Requests for more info)
A write-command starts with 02. (See Writes for more info)