1
0
mirror of https://github.com/mik3y/usb-serial-for-android synced 2025-07-23 09:55:40 +00:00

CDC: fix incorrect stop bits (thanks vovkab).

This commit is contained in:
mike wakerly 2013-04-07 23:06:30 -07:00
parent beccfbb409
commit 22c4c9b280

View File

@ -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);
}