NULL port name fix
This commit is contained in:
parent
7dddbec01d
commit
ffd0a5ec9b
|
@ -140,7 +140,12 @@ public class SerialPort {
|
||||||
if(portOpened){
|
if(portOpened){
|
||||||
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_ALREADY_OPENED);
|
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_ALREADY_OPENED);
|
||||||
}
|
}
|
||||||
|
if(portName != null){
|
||||||
portHandle = serialInterface.openPort(portName);
|
portHandle = serialInterface.openPort(portName);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
portHandle = -2;//->Since 2.1.0 NULL port name fix
|
||||||
|
}
|
||||||
//since 0.9.0 ->
|
//since 0.9.0 ->
|
||||||
if(portHandle == -1){
|
if(portHandle == -1){
|
||||||
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_BUSY);
|
throw new SerialPortException(portName, "openPort()", SerialPortException.TYPE_PORT_BUSY);
|
||||||
|
|
Loading…
Reference in New Issue