summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/device/serial
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/device/serial') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/device/serial/ser_djg.c10
-rw-r--r--gammu/emb/common/device/serial/ser_unx.c38
-rw-r--r--gammu/emb/common/device/serial/ser_w32.c6
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
@@ -12,5 +12,5 @@ static GSM_Error serial_close(GSM_StateMachine *s)
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- return ERR_NONE;
+ return ERR_NOTIMPLEMENTED;
}
@@ -19,5 +19,5 @@ static GSM_Error serial_open (GSM_StateMachine *s)
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- return ERR_NONE;
+ return ERR_NOTIMPLEMENTED;
}
@@ -26,5 +26,5 @@ static GSM_Error serial_setparity(GSM_StateMachine *s, bool parity)
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- return ERR_NONE;
+ return ERR_NOTIMPLEMENTED;
}
@@ -33,5 +33,5 @@ static GSM_Error serial_setdtrrts(GSM_StateMachine *s, bool dtr, bool rts)
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- return ERR_NONE;
+ return ERR_NOTIMPLEMENTED;
}
@@ -40,5 +40,5 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed)
GSM_Device_SerialData *d = &s->Device.Data.Serial;
- 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
@@ -1,4 +1,8 @@
/* (c) 2002-2004 by Marcin Wiacek */
/* 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
+ */
#include "../../gsmstate.h"
@@ -17,4 +21,28 @@
#include "ser_unx.h"
+#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)
{
@@ -30,8 +58,4 @@ static GSM_Error serial_close(GSM_StateMachine *s)
}
-#ifndef O_NONBLOCK
-# define O_NONBLOCK 0
-#endif
-
static GSM_Error serial_open (GSM_StateMachine *s)
{
@@ -178,5 +202,5 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed)
GSM_Device_SerialData *d = &s->Device.Data.Serial;
struct termios t;
- int speed2 = B19200;
+ int speed2 = B19200;
if (tcgetattr(d->hPhone, &t)) {
@@ -203,8 +227,10 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed)
case 19200: speed2 = B19200; break;
case 38400: speed2 = B38400; break;
+#ifdef B57600
case 57600: speed2 = B57600; break;
case 115200: speed2 = B115200; break;
case 230400: speed2 = B230400; break;
case 460800: speed2 = B460800; break;
+#ifdef B500000
case 500000: speed2 = B500000; break;
case 576000: speed2 = B576000; break;
@@ -218,4 +244,6 @@ static GSM_Error serial_setspeed(GSM_StateMachine *s, int speed)
case 3500000: speed2 = B3500000; break;
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,4 +1,8 @@
/* (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
+ */
#include "../../gsmstate.h"