Throw exception on bad parameters to Prolific

pull/39/head
Trevor Harmon 2013-11-06 16:02:05 -08:00
rodzic 7e9589d582
commit 275589eeb6
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -406,6 +406,9 @@ public class ProlificSerialDriver extends CommonUsbSerialDriver {
case STOPBITS_2:
lineRequestData[4] = 2;
break;
default:
throw new IllegalArgumentException("Unknown stopBits value: " + stopBits);
}
switch (parity) {
@ -428,6 +431,9 @@ public class ProlificSerialDriver extends CommonUsbSerialDriver {
case PARITY_SPACE:
lineRequestData[5] = 4;
break;
default:
throw new IllegalArgumentException("Unknown parity value: " + parity);
}
lineRequestData[6] = (byte) dataBits;