X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=blobdiff_plain;f=common%2Fdevices%2Funixserial.c;h=bc7e37eb0dbace25d9f7dfd91df3ea5ad0cca651;hp=51864655dd1aa0ee78f38aadcf04a28ee8dba4cc;hb=a2dfc99dc499ea8600bf5178f8122125d7d7d557;hpb=4ee1266711b695852ec88f06784fd84400cd70bb diff --git a/common/devices/unixserial.c b/common/devices/unixserial.c index 5186465..bc7e37e 100644 --- a/common/devices/unixserial.c +++ b/common/devices/unixserial.c @@ -6,42 +6,8 @@ A Linux/Unix toolset and driver for Nokia mobile phones. - Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml. - Released under the terms of the GNU GPL, see file COPYING for more details. - $Log$ - Revision 1.1.1.1 2001/11/25 21:59:09 short - :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 - - Revision 1.10 2001/11/14 10:46:12 pkot - Small cleanup with __unices__ - - Revision 1.9 2001/09/14 12:15:28 pkot - Cleanups from 0.3.3 (part1) - - Revision 1.8 2001/08/20 23:27:37 pkot - Add hardware shakehand to the link layer (Manfred Jonsson) - - Revision 1.7 2001/07/03 00:03:36 pkot - Small fixes to let gnokii compile and work under solaris (thanks to Artur Kubiak) - - Revision 1.6 2001/03/21 23:36:04 chris - Added the statemachine - This will break gnokii --identify and --monitor except for 6210/7110 - - Revision 1.5 2001/03/19 23:43:46 pkot - Solaris/ *BSD '#if defined' cleanup - - Revision 1.4 2001/03/13 01:21:38 pkot - *BSD updates (Bert Driehuis) - - Revision 1.3 2001/03/06 22:27:46 pkot - Misc docs and Makefiles updates and cleanups - - Revision 1.2 2001/02/21 19:57:05 chris - More fiddling with the directory layout - */ #include "misc.h" @@ -55,6 +21,10 @@ #include #include +#if __unices__ +# include +#endif + #include #include "devices/unixserial.h" @@ -213,17 +183,13 @@ void serial_setdtrrts(int __fd, int __dtr, int __rts) { flags = TIOCM_DTR; - if (__dtr) - ioctl(__fd, TIOCMBIS, &flags); - else - ioctl(__fd, TIOCMBIC, &flags); + if (__dtr) ioctl(__fd, TIOCMBIS, &flags); + else ioctl(__fd, TIOCMBIC, &flags); flags = TIOCM_RTS; - if (__rts) - ioctl(__fd, TIOCMBIS, &flags); - else - ioctl(__fd, TIOCMBIC, &flags); + if (__rts) ioctl(__fd, TIOCMBIS, &flags); + else ioctl(__fd, TIOCMBIC, &flags); } @@ -265,8 +231,12 @@ void serial_changespeed(int __fd, int __speed) { // This is not needed! We set up the speed via cfsetspeed // t.c_cflag &= ~CBAUD; // t.c_cflag |= speed; +#ifdef DEBUG if (cfsetspeed(&t, speed) == -1) - dprintf(_("Serial port speed setting failed\n")); + fprintf(stdout,_("Serial port speed setting failed\n")); +#else + cfsetspeed(&t, speed); +#endif tcsetattr(__fd, TCSADRAIN, &t); #else