If the modem is off the hook when it's stopped, hang up.

This commit is contained in:
akwizgran
2012-12-06 15:33:51 +00:00
parent 584f7de0ab
commit f9ec483791

View File

@@ -91,6 +91,8 @@ class ModemImpl implements Modem, WriteHandler, SerialPortEventListener {
}
public void stop() throws IOException {
if(offHook.tryAcquire()) offHook.release();
else hangUp();
try {
port.closePort();
} catch(SerialPortException e) {