CDC: fix incorrect stop bits (thanks vovkab).

pull/36/head
mike wakerly 2013-04-07 23:06:30 -07:00
rodzic beccfbb409
commit 22c4c9b280
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

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