I'm wondering if the leading zero in the OP's first example is causing a problem, although I have no idea why. It should be accepted, unless it's being interpreted as octal or something.
Thanks for the "Quotes" resopnse... Who knew that you would need quotes and not an escape ""?... I found that Linux and Windows works the same... It was that I put in a number not beginning in 0, NULL "00" just "0"... Maybe this is a good time to take a look at these rules and maybe put them in the "HELP" tab where for common and uncommon injection rules, you might be able to find a hint.
Maybe allow to enter values that have leading zeros to a buffer... and since the "" is an escape , maybe allow that for hex values.
Is that THE way to offer suggestions to the "Help" tab? I kind of figure, if @dceejay is spending a lot of time on the forum answering questions, he may want to not answer the same ones over and over, but maybe the answers can make their way into the "Help" tab....
Examples are really great to get you where you need to be. Just an example of each kind of data, or something that is not the run of the mill. like Buffer: ["0x02","0x0D","0x0A","0x03"] ... [2,56,65,0,3]
I spent way too much time on this one trying to figure out what I did wrong. I try to not bother the forum with the minutia that I should be able to find or read the documentation on my own. I could not find anywhere an example of how to properly structure a buffer with the hexadecimal values to test my printer communication.
It is a suggestion... Not meant at all in disrespect. By the way... you cannot declare a buffer in js with var mybuf= ["0x02","0x00","0x03"]; yields a string array... so that is not "standard JavaScript"...
that is standard javascript/nodejs to declare an array... but that's not how you declare a buffer - try var mybuf= Buffer.from(["0x02","0x00","0x03"]);
but yes - happy to consider a PR to the help info with simple example
I think perhaps I misunderstood what you meant. If you say you want a buffer containing those hex numbers then indeed it is entirely standard JS to say var mybuf= Buffer.from(["0x02","0x00","0x03"]);
Great to hear from you both! I was not aware that I needed the buffer class function to find the syntax. I did not know where to look. I found a reference to an escape \0x… And my point isn’t that you are not correct about the “”, it’s that you cannot draw a straight line between the class function call, (unless noted in help tab….) and applying it in an inject. It’s not native JavaScript, it’s a class function. of course if you invoke the entire realm to be correct, great you win!
Not to worry, my point is only this. Can you please consider updating the help tab for Inject and any other “native” nodes to include the lesser traveled nuances in syntax in order to give us common folk a hint?
You are right, the Buffer class is not part of the javascript spec, but it is part of the nodejs javascript spec.
However, you said in the first post that you wanted to inject a Buffer object. It is difficult to see how that would be possible without the use of the Buffer class.
Why are you asking me in particular to amend the docs (I am not a developer)? Anyone can do it. If you think there is an addition that would be helpful then please get involved and submit a PR.
I’m not asking you. I am asking @dceejay. You happened to chime in with @dceejay. I was also told I need to do a pull request. This is next. It’s not a mission and I don’t need to make a big deal. I’m very happy with this. I only wanted to make a suggestion to help others that find themselves in similar instances.
Ok. I think I can certainly help with that. Tell me where to submit my drafts and I’ll start with the inject node. Ill just start with this suggestion and go from there. I will need you to correct and add content.