344345346347348349350351352353354
// find the port reference serial = SerialService.getSerialService(newPortName); // check if there is no such port if (serial == null) throw new OneWireException( "DS9097EAdapter: selectPort(), Not such serial port: " + newPortName); try {
385386387388389390391392
throws OneWireException { if (serial != null) return serial.getPortName(); else throw new OneWireException( "DS9097EAdapter-getPortName, port not selected"); }
412413414415416417418419420421422
// attempt to open the port serial.closePort(); } catch(IOException ioe) { throw new OneWireException("Error closing serial port"); } finally { // release local exclusive use of port endLocalExclusive();
702703704705706707708709710711712
throws OneWireException { // check if there is no such port if (serial == null) throw new OneWireException("DS9097EAdapter: port not selected "); // check if already have exclusive use if (serial.haveExclusive()) return; else