Diffstat (limited to 'gammu/emb/common/device/serial') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/device/serial/ser_djg.c | 10 | ||||
-rw-r--r-- | gammu/emb/common/device/serial/ser_unx.c | 38 | ||||
-rw-r--r-- | gammu/emb/common/device/serial/ser_w32.c | 6 |
3 files changed, 43 insertions, 11 deletions
diff --git a/gammu/emb/common/device/serial/ser_djg.c b/gammu/emb/common/device/serial/ser_djg.c index ac9d7c8..2524187 100644 --- a/gammu/emb/common/device/serial/ser_djg.c +++ b/gammu/emb/common/device/serial/ser_djg.c @@ -13,3 +13,3 @@ static GSM_Error serial_close(GSM_StateMachine *s) - return ERR_NONE; + return ERR_NOTIMPLEMENTED; } @@ -20,3 +20,3 @@ static GSM_Error serial_open (GSM_StateMachine *s) - return ERR_NONE; + return ERR_NOTIMPLEMENTED; } @@ -27,3 +27,3 @@ static GSM_Error serial_setparity(GSM_StateMachine *s, bool parity) - return ERR_NONE; + return ERR_NOTIMPLEMENTED; } @@ -34,3 +34,3 @@ static GSM_Error serial_setdtrrts(GSM_StateMachine *s, bool dtr, bool rts) - return ERR_NONE; + return ERR_NOTIMPLEMENTED; } @@ -41,3 +41,3 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed) - return ERR_NONE; + return ERR_NOTIMPLEMENTED; } diff --git a/gammu/emb/common/device/serial/ser_unx.c b/gammu/emb/common/device/serial/ser_unx.c index 2a87b11..69c7515 100644 --- a/gammu/emb/common/device/serial/ser_unx.c +++ b/gammu/emb/common/device/serial/ser_unx.c @@ -2,2 +2,6 @@ /* locking device and settings all speeds by Michal Cihar */ +/* based on some work from Gnokii (www.gnokii.org) + * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot + * GNU GPL version 2 or later + */ @@ -18,2 +22,26 @@ +#ifndef O_NONBLOCK +# define O_NONBLOCK 0 +#endif + +#ifdef __NetBSD__ +# define FNONBLOCK O_NONBLOCK + +# define B57600 0010001 +# define B115200 0010002 +# define B230400 0010003 +# define B460800 0010004 +# define B500000 0010005 +# define B576000 0010006 +# define B921600 0010007 +# define B1000000 0010010 +# define B1152000 0010011 +# define B1500000 0010012 +# define B2000000 0010013 +# define B2500000 0010014 +# define B3000000 0010015 +# define B3500000 0010016 +# define B4000000 0010017 +#endif + static GSM_Error serial_close(GSM_StateMachine *s) @@ -31,6 +59,2 @@ static GSM_Error serial_close(GSM_StateMachine *s) -#ifndef O_NONBLOCK -# define O_NONBLOCK 0 -#endif - static GSM_Error serial_open (GSM_StateMachine *s) @@ -179,3 +203,3 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed) struct termios t; - int speed2 = B19200; + int speed2 = B19200; @@ -204,2 +228,3 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed) case 38400: speed2 = B38400; break; +#ifdef B57600 case 57600: speed2 = B57600; break; @@ -208,2 +233,3 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed) case 460800: speed2 = B460800; break; +#ifdef B500000 case 500000: speed2 = B500000; break; @@ -219,2 +245,4 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed) case 4000000: speed2 = B4000000; break; +#endif +#endif } diff --git a/gammu/emb/common/device/serial/ser_w32.c b/gammu/emb/common/device/serial/ser_w32.c index 9fa0135..7d88fc7 100644 --- a/gammu/emb/common/device/serial/ser_w32.c +++ b/gammu/emb/common/device/serial/ser_w32.c @@ -1,3 +1,7 @@ /* (c) 2002-2004 by Marcin Wiacek */ -/* based on some work from Gnokii, MSDN and others */ +/* based on some work from MSDN and others */ +/* based on some work from Gnokii (www.gnokii.org) + * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot + * GNU GPL version 2 or later + */ |