mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-06-10 01:16:27 +00:00
Merge pull request #39 from vocaro/master
Throw exception on bad parameters to Prolific
This commit is contained in:
commit
c212114340
@ -406,6 +406,9 @@ public class ProlificSerialDriver extends CommonUsbSerialDriver {
|
|||||||
case STOPBITS_2:
|
case STOPBITS_2:
|
||||||
lineRequestData[4] = 2;
|
lineRequestData[4] = 2;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unknown stopBits value: " + stopBits);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (parity) {
|
switch (parity) {
|
||||||
@ -428,6 +431,9 @@ public class ProlificSerialDriver extends CommonUsbSerialDriver {
|
|||||||
case PARITY_SPACE:
|
case PARITY_SPACE:
|
||||||
lineRequestData[5] = 4;
|
lineRequestData[5] = 4;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new IllegalArgumentException("Unknown parity value: " + parity);
|
||||||
}
|
}
|
||||||
|
|
||||||
lineRequestData[6] = (byte) dataBits;
|
lineRequestData[6] = (byte) dataBits;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user