Added SerialPortException.TYPE_PERMISSION_DENIED support into SerialPort class
This commit is contained in:
parent
fa056da300
commit
82a01329a6
|
@ -151,14 +151,15 @@ public class SerialPort {
|
|||
else {
|
||||
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_NULL_NOT_PERMITTED);//since 2.1.0 -> NULL port name fix
|
||||
}
|
||||
//since 0.9.0 ->
|
||||
if(portHandle == -1){
|
||||
if(portHandle == -1){//since 0.9.0 ->
|
||||
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_BUSY);
|
||||
}
|
||||
else if(portHandle == -2){
|
||||
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_NOT_FOUND);
|
||||
}
|
||||
//<- since 0.9.0
|
||||
}//<- since 0.9.0
|
||||
else if(portHandle == -3){//since 2.2.0 ->
|
||||
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PERMISSION_DENIED);
|
||||
}//<- since 2.2.0
|
||||
portOpened = true;
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue