Package promauto.utils

Examples of promauto.utils.RpSerialPort.writeBytes()


      // Command - write and read hex
      if (cmd[1].equals("hex") || cmd[1].equals("h")) {
        RpSerialPort port = getPortForConsoleCommand(cmd);
        byte[] bout = RpHyperstring.hexStringToBytes(cmd, 3);
        svcConsole.write(JRoboStrings.SVCSERIAL_WRITE_TO + port.getName()+": "+ RpHyperstring.bytesToHexString(bout) +"\n" );
        port.writeBytes(bout);
        byte[] bin = new byte[2048];
        int n = port.readBytes(bin);
        byte[] bb = Arrays.copyOfRange(bin, 0, Math.abs(n));
        svcConsole.write(JRoboStrings.SVCSERIAL_READ_FROM + port.getName()+": "+ RpHyperstring.bytesToHexString(bb) +"\n" );
      } else
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.