private void addSpecifiedPorts(String names, int PortType) { final String pathSep = System.getProperty("path.separator", ":"); final StringTokenizer tok = new StringTokenizer(names, pathSep); if (debug) System.out.println("\nRXTXCommDriver:addSpecifiedPorts()"); while (tok.hasMoreElements()) { String PortName = tok.nextToken(); if (testRead(PortName, PortType)) CommPortIdentifier.addPortName(PortName, PortType, this); } }
private void addSpecifiedPorts(String names, int PortType) { final String pathSep = System.getProperty("path.separator", ":"); final StringTokenizer tok = new StringTokenizer(names, pathSep); if (debug) System.out.println("\nRXTXCommDriver:addSpecifiedPorts()"); while (tok.hasMoreElements()) { String PortName = tok.nextToken(); if (testRead(PortName, PortType)) CommPortIdentifier.addPortName(PortName, PortType, this); } }
private void addSpecifiedPorts(String names, int PortType) { final String pathSep = System.getProperty("path.separator", ":"); final StringTokenizer tok = new StringTokenizer(names, pathSep); if (debug) System.out.println("\nRXTXCommDriver:addSpecifiedPorts()"); while (tok.hasMoreElements()) { String PortName = tok.nextToken(); if (testRead(PortName, PortType)) CommPortIdentifier.addPortName(PortName, PortType, this); } }
/** handle solaris/sunos /dev/cua/a convention */ private void checkSolaris(String PortName, int PortType) { char p[] = { 91 }; for (p[0] = 97; p[0] < 123; p[0]++) { if (testRead(PortName.concat(new String(p)), PortType)) { CommPortIdentifier.addPortName(PortName.concat(new String(p)), PortType, this); } } /** check for 0-9 in case we have them (Solaris USB) */ for (p[0] = 48; p[0] <= 57; p[0]++) { if (testRead(PortName.concat(new String(p)), PortType)) { CommPortIdentifier.addPortName(PortName.concat(new String(p)), PortType, this); } } }
/** handle solaris/sunos /dev/cua/a convention */ private void checkSolaris(String PortName, int PortType) { char p[] = { 91 }; for( p[0] =97 ;p[0] < 123; p[0]++ ) { if (testRead(PortName.concat(new String(p)),PortType)) { CommPortIdentifier.addPortName( PortName.concat(new String(p)), PortType, this ); } } } private void registerValidPorts(
private void addSpecifiedPorts(String names, int PortType) { final String pathSep = System.getProperty("path.separator", ":"); final StringTokenizer tok = new StringTokenizer(names, pathSep); if (debug) System.out.println("\nRXTXCommDriver:addSpecifiedPorts()"); while (tok.hasMoreElements()) { String PortName = tok.nextToken(); if (debug) System.out.println("Trying " + PortName + "."); if (testRead(PortName, PortType)) { CommPortIdentifier.addPortName(PortName, PortType, this); if (debug) System.out.println("Success: Read from " + PortName + "."); } else { if (debug) System.out.println("Fail: Cannot read from " + PortName + "."); } } }
/** handle solaris/sunos /dev/cua/a convention */ private void checkSolaris(String PortName, int PortType) { char p[] = { 91 }; for( p[0] =97 ;p[0] < 123; p[0]++ ) { if (testRead(PortName.concat(new String(p)),PortType)) { CommPortIdentifier.addPortName( PortName.concat(new String(p)), PortType, this ); } } /** check for 0-9 in case we have them (Solaris USB) */ for( p[0] =48 ;p[0] <= 57; p[0]++ ) { if (testRead(PortName.concat(new String(p)),PortType)) { CommPortIdentifier.addPortName( PortName.concat(new String(p)), PortType, this ); } } } private void registerValidPorts(
/** handle solaris/sunos /dev/cua/a convention */ private void checkSolaris(String PortName, int PortType) { char p[] = { 91 }; for( p[0] =97 ;p[0] < 123; p[0]++ ) { if (testRead(PortName.concat(new String(p)),PortType)) { CommPortIdentifier.addPortName( PortName.concat(new String(p)), PortType, this ); } } /** check for 0-9 in case we have them (Solaris USB) */ for( p[0] =48 ;p[0] <= 57; p[0]++ ) { if (testRead(PortName.concat(new String(p)),PortType)) { CommPortIdentifier.addPortName( PortName.concat(new String(p)), PortType, this ); } } } private void registerValidPorts(
checkSolaris(PortName, PortType); else if (testRead(PortName, PortType)) { CommPortIdentifier.addPortName(PortName, PortType, this);
CommPortIdentifier.addPortName( CandidateDeviceNames[i], PortType, this ); CommPortIdentifier.addPortName( PortName, PortType,
CommPortIdentifier.addPortName( CandidateDeviceNames[i], PortType, this ); CommPortIdentifier.addPortName( PortName, PortType,
else if (testRead(PortName, PortType)) CommPortIdentifier.addPortName( PortName, PortType,
@Override public void initialize() { try { serialPorts.clear(); if (config != null) { List<PortConfig> ports = config.getPorts(); if (ports != null) { for (PortConfig port : ports) { switch (port.getType()) { case SERIAL: Linkable serialPort = new MockRxTxSerialPort(port.getName()); serialPorts.add(serialPort); if (port.getLinkPort() != null) { linkPort(serialPorts, serialPort, port.getLinkPort().getName()); } break; } CommPortIdentifier.addPortName(port.getName(), port.getType().getCode(), this); LOG.info("Port is initialized: " + port.getName()); } } } } catch (IOException e) { LOG.log(Level.WARNING, "Initialization problem", e); } }