I am trying to convert a string with the byte number in it into a real byte.

var string = "23"; // Or it could be 4E, CA, 22, FF, or any other byte
var byte = somehowConvertStringToByte(string); // The variable "byte" 
Should look like 0x23 to NodeJS
var otherByte = 0x23; // This is 100% equal to the variable "byte." NodeJS 
will see this variable and "byte" the exact same way.

Hopefully this makes sense. I'm have to generate some stupid checksums to 
get my UPB serial PIM to accept commands. I have the reset of the code 
working. I'm making a CLI script that generates UPB commands and then sends 
them with node-serialport.

Thank you for any help, as this has completely stumped me.

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/90d6eac1-bfff-4ded-8bef-bed54b8634ee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to