Adapted paul's patch for EMI_X25 SMSC
Vincent.
P. A. Bagyenda a écrit :
Thanks.
On the issue of non-standard speeds, I've tested this on Mac OS X
(which uses bps value as actual speed value) with a 460800 (i.e.
non-standard) modem, and it works just fine. Said modem also works well
under Linux. I believe no issue arises since it is the user
responsibility to provide the correct speed -- and also buy a supported
modem :)
diff -rauw /gateway-cvs/gw/smsc/smsc_emi_x25.c /gateway/gw/smsc/smsc_emi_x25.c
--- /gateway-cvs/gw/smsc/smsc_emi_x25.c 2009-01-14 10:24:05.000000000 +0100
+++ /gateway/gw/smsc/smsc_emi_x25.c 2009-02-16 11:20:55.000000000 +0100
@@ -496,7 +496,23 @@
/* The speed initialisation is pretty important. */
tcgetattr(fd, &tios);
-#if defined(B115200)
+
+#if defined(B921600)
+ cfsetospeed(&tios, B921600);
+ cfsetispeed(&tios, B921600);
+#elif defined(B576000)
+ cfsetospeed(&tios, B576000);
+ cfsetispeed(&tios, B576000);
+#elif defined(B500000)
+ cfsetospeed(&tios, B500000);
+ cfsetispeed(&tios, B500000);
+#elif defined(B460800)
+ cfsetospeed(&tios, B460800);
+ cfsetispeed(&tios, B460800);
+#elif defined(B230400)
+ cfsetospeed(&tios, B230400);
+ cfsetispeed(&tios, B230400);
+#elif defined(B115200)
cfsetospeed(&tios, B115200);
cfsetispeed(&tios, B115200);
#elif defined(B76800)
@@ -512,9 +528,14 @@
cfsetospeed(&tios, B19200);
cfsetispeed(&tios, B19200);
#elif defined(B9600)
+ #if B9600 == 9600
+ cfsetospeed(&tios, 9600);
+ cfsetispeed(&tios, 9600);
+ #else
cfsetospeed(&tios, B9600);
cfsetispeed(&tios, B9600);
#endif
+#endif
kannel_cfmakeraw(&tios);
tios.c_cflag |= (HUPCL | CREAD | CRTSCTS);
ret = tcsetattr(fd, TCSANOW, &tios);