mirror of
https://github.com/mik3y/usb-serial-for-android.git
synced 2026-08-11 16:32:53 +00:00
Throw exception on bad parameters to Prolific
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user