Package purejavacomm

Examples of purejavacomm.CommPortIdentifier.open()


  }

  static protected void openPort() throws Exception {
    try {
      CommPortIdentifier portid = CommPortIdentifier.getPortIdentifier(m_TestPortName);
      m_Port = (SerialPort) portid.open(APPLICATION_NAME, 1000);
      m_Out = m_Port.getOutputStream();
      m_In = m_Port.getInputStream();
      drain(m_In);
    } catch (NoSuchPortException e) {
      fail("could no open port '%s'\n", m_TestPortName);
View Full Code Here


  public static void main(String[] args) throws Exception {
    try {

      //CommPortIdentifier portIdent = CommPortIdentifier.getPortIdentifier("tty.usbserial-FTOXM3NX");
      CommPortIdentifier portIdent = CommPortIdentifier.getPortIdentifier("ttyUSB0");
      port = (SerialPort) portIdent.open("speedtest", 1000);
      messageSize = 200;
      messageCount = 500;

      port.setSerialPortParams(230000, 8, 1, 0);
      port.enableReceiveThreshold(messageSize);
View Full Code Here

  {
    String portName = String.valueOf( this.portSelect.getSelectedItem() );

    CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier( portName );

    SerialPort result = ( SerialPort )portId.open( "Serial console tool", 1000 );

    int baudrate = NumberUtils.smartParseInt( String.valueOf( this.portRateSelect.getSelectedItem() ) );

    String db = ( String )this.dataBitsSelect.getSelectedItem();
    int databits;
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.