summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/device
Side-by-side diff
Diffstat (limited to 'gammu/emb/common/device') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/device/bluetoth/bluez.c29
-rw-r--r--gammu/emb/common/device/devfunc.c12
-rw-r--r--gammu/emb/common/device/irda/irda.c8
-rw-r--r--gammu/emb/common/device/irda/irda_unx.h2
-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
7 files changed, 79 insertions, 26 deletions
diff --git a/gammu/emb/common/device/bluetoth/bluez.c b/gammu/emb/common/device/bluetoth/bluez.c
index 8a4807e..e7e8adf 100644
--- a/gammu/emb/common/device/bluetoth/bluez.c
+++ b/gammu/emb/common/device/bluetoth/bluez.c
@@ -1,3 +1,12 @@
-/* Based on work by Marcel Holtmann and other authors of Bluez */
+/* Based on some work from Bluez (www.bluez.org)
+ * (C) 2000-2001 Qualcomm Incorporated
+ * (C) 2002-2003 Maxim Krasnyansky <maxk@qualcomm.com>
+ * (C) 2002-2004 Marcel Holtmann <marcel@holtmann.org>
+ * GNU GPL version 2
+ */
+/* based on some Marcel Holtmann 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"
@@ -82,5 +91,5 @@ static void print_service_desc(void *value, void *user)
case SDP_UUID32:
case SDP_UUID128:
- proto = 1;//sdp_uuid_to_proto(&p->val.uuid);
+ proto = sdp_uuid_to_proto(&p->val.uuid);
break;
case SDP_UINT8:
@@ -105,11 +114,11 @@ static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, bdaddr_t *bdaddr, st
{
sdp_session_t *sess;
- sdp_list_t *attrid, *search, *seq, *next, *proto = 0;
- uint32_t range = 0x0000ffff;
- char str[20];
sdp_record_t *rec;
+ sdp_list_t *attrid, *search, *seq, *next, *proto = 0;
sdp_data_t *d;
bdaddr_t interface;
+ uint32_t range = 0x0000ffff;
struct search_context subcontext;
+ char str[20];
int channel,channel2;
@@ -143,8 +152,8 @@ static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, bdaddr_t *bdaddr, st
d = sdp_data_get(rec,SDP_ATTR_SVCNAME_PRIMARY);
- if (false) {
+ if (sdp_get_access_protos(rec,&proto) == 0) {
channel = -1;
sdp_list_foreach(proto,print_access_protos,&channel);
- //sdp_list_free(proto,(sdp_free_func_t)sdp_data_free);
+ sdp_list_free(proto,(sdp_free_func_t)sdp_data_free);
}
smprintf(s,"Channel %i",channel);
@@ -163,5 +172,5 @@ static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, bdaddr_t *bdaddr, st
next = seq->next;
free(seq);
- //sdp_record_free(rec);
+ sdp_record_free(rec);
}
sdp_close(sess);
@@ -169,5 +178,5 @@ static GSM_Error bluetooth_checkdevice(GSM_StateMachine *s, bdaddr_t *bdaddr, st
if (channel2 != -1) return bluetooth_connect(s, channel2, str);
- return ERR_UNKNOWN;
+ return ERR_NOTSUPPORTED;
}
@@ -181,5 +190,5 @@ GSM_Error bluetooth_findchannel(GSM_StateMachine *s)
memset(&context, '\0', sizeof(struct search_context));
- //sdp_uuid16_create(&(context.group),PUBLIC_BROWSE_GROUP);
+ sdp_uuid16_create(&(context.group),PUBLIC_BROWSE_GROUP);
if (!strcmp(s->CurrentConfig->Device,"/dev/ttyS1")) {
diff --git a/gammu/emb/common/device/devfunc.c b/gammu/emb/common/device/devfunc.c
index d31ebbf..c58a01f 100644
--- a/gammu/emb/common/device/devfunc.c
+++ b/gammu/emb/common/device/devfunc.c
@@ -1,2 +1,10 @@
+/* Some source from Gnokii (www.gnokii.org)
+ * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
+ * GNU GPL version 2 or later
+ */
+/* Some source from Minicom (http://alioth.debian.org/projects/minicom)
+ * (C) 1991,1992,1993,1994,1995,1996 by Miquel van Smoorenburg
+ * GNU GPL version 2
+ */
#include <string.h>
@@ -106,5 +114,5 @@ bool unlock_device(char **lock_file)
GSM_Error lock_device(const char* port, char **lock_device)
{
-#ifndef WIN32
+#if !defined(WIN32) && !defined(DJGPP)
char *lock_file = NULL;
char buffer[max_buf_len];
@@ -219,5 +227,5 @@ failed:
bool unlock_device(char **lock_file)
{
-#ifndef WIN32
+#if !defined(WIN32) && !defined(DJGPP)
int err;
diff --git a/gammu/emb/common/device/irda/irda.c b/gammu/emb/common/device/irda/irda.c
index fef50ac..e680377 100644
--- a/gammu/emb/common/device/irda/irda.c
+++ b/gammu/emb/common/device/irda/irda.c
@@ -1,5 +1,9 @@
/* (c) 2001-2004 by Marcin Wiacek */
-/* based on some work from Ralf Thelen and MyGnokii */
-/* based on some work from Gnokii and MSDN */
+/* based on some work from Ralf Thelen and MyGnokii (www.mwiacek.com) */
+/* based on some work from MSDN */
+/* 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
+ */
/* You have to include wsock32.lib library to MS VC project to compile it */
diff --git a/gammu/emb/common/device/irda/irda_unx.h b/gammu/emb/common/device/irda/irda_unx.h
index 8dbcb97..7a55273 100644
--- a/gammu/emb/common/device/irda/irda_unx.h
+++ b/gammu/emb/common/device/irda/irda_unx.h
@@ -1,3 +1,3 @@
-/* part of irda.h available in Linux kernel source */
+/* part of irda.h available in Linux kernel source (www.kernel.org) */
/*********************************************************************
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"