mirror of
https://github.com/mik3y/usb-serial-for-android.git
synced 2026-08-11 08:22:52 +00:00
CDC: fix incorrect stop bits (thanks vovkab).
This commit is contained in:
@@ -142,9 +142,9 @@ public class CdcAcmSerialDriver extends CommonUsbSerialDriver {
|
||||
public void setParameters(int baudRate, int dataBits, int stopBits, int parity) {
|
||||
byte stopBitsByte;
|
||||
switch (stopBits) {
|
||||
case STOPBITS_1: stopBitsByte = 1; break;
|
||||
case STOPBITS_1_5: stopBitsByte = 2; break;
|
||||
case STOPBITS_2: stopBitsByte = 3; break;
|
||||
case STOPBITS_1: stopBitsByte = 0; break;
|
||||
case STOPBITS_1_5: stopBitsByte = 1; break;
|
||||
case STOPBITS_2: stopBitsByte = 2; break;
|
||||
default: throw new IllegalArgumentException("Bad value for stopBits: " + stopBits);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user