title: send binary on node.JS serial
body: <p>I'm using SerialPort <a href="https://www.npmjs.com/package/serialport" rel="nofollow noreferrer">https://www.npmjs.com/package/serialport</a> in a node.JS test script. I need to write the following sequence:</p>
  <pre><code>&quot;\xc0\x00--EOF-Pattern--&quot; 
  </code></pre>
  <p>The device behind the Serial port expects the bytes to transmit and then the EOF pattern to show the end of the payload. A number of other binary send works fine.</p>
  <p>However when I try to send &quot;0xC0&quot; it always ends in sending crap bytes. It looks that my hex is always somewhere translated into Unicode (or something similar).</p>
  <p>Even when I do something like</p>
  <pre><code>var buff = Buffer.from(&quot;c0002d2d454f462d2d5061747465726e2d2d&quot;,&quot;hex&quot;);
  </code></pre>
  <p>and send &quot;buff&quot; to the SerialPort the Hex sequence is destroyed. Again - this only happens when a &quot;0xC0&quot; is in.</p>
  <p>Any hint what I can do ? How to prevent ANY recoding on the serial line API ?</p>