OSDN Git Service

Bug fixed the baudrate configuration.
authorShinichiro Nakamura <shinta.main.jp@gmail.com>
Sun, 26 Aug 2012 21:03:24 +0000 (06:03 +0900)
committerShinichiro Nakamura <shinta.main.jp@gmail.com>
Sun, 26 Aug 2012 21:03:24 +0000 (06:03 +0900)
soft/ntlogger/ntlcap/ntlcap.c
soft/ntlogger/ntlcap/serial.h
soft/ntlogger/ntlcap/serial_linux.c

index 1690c1a..fd545e1 100644 (file)
@@ -106,6 +106,15 @@ static int option_callback(
                 case 38400:
                     opt->baudrate = SerialBaud38400;
                     break;
+                case 57600:
+                    opt->baudrate = SerialBaud57600;
+                    break;
+                case 115200:
+                    opt->baudrate = SerialBaud115200;
+                    break;
+                default:
+                    printf("Unsupported baudrate found.\n");
+                    exit(1);
             }
             opt->optflag |= OPTFLAG_BAUDRATE;
             break;
index 23129e6..4c60945 100644 (file)
@@ -50,7 +50,8 @@ enum SerialBaud {
     SerialBaud9600,
     SerialBaud19200,
     SerialBaud38400,
-    SerialBaud57600
+    SerialBaud57600,
+    SerialBaud115200
 };
 
 #ifdef __cplusplus
index 8ac6afe..4ef57f6 100644 (file)
@@ -138,6 +138,10 @@ SERIAL *serial_open(const char *devfile, const enum SerialBaud baud)
         s->termios_new.c_cflag |= B57600;
         baudrate = 57600;
         break;
+    case SerialBaud115200:
+        s->termios_new.c_cflag |= B115200;
+        baudrate = 115200;
+        break;
     default:
         s->termios_new.c_cflag |= B9600;
         baudrate = 9600;