Package promauto.utils

Examples of promauto.utils.RpSerialPort.readBytes()


         
      // Command - readhex
      if (cmd[1].equals("readhex") || cmd[1].equals("rh")) {
        RpSerialPort port = getPortForConsoleCommand(cmd);
        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
         
      // Command - write and read string
View Full Code Here


        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
     
      // somebody else's command
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.