aboutsummaryrefslogtreecommitdiff
path: root/comms/bluegps/files
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2007-09-06 12:04:27 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2007-09-06 12:04:27 +0000
commitd0ab14ab884e583784d49381e8519f9ec0da8708 (patch)
tree42c082c9441f7caf59d128e576be4b5326d27925 /comms/bluegps/files
parent8e4e3b184c22ddb50734c337605fbb5ac1976734 (diff)
downloadports-d0ab14ab884e583784d49381e8519f9ec0da8708.tar.gz
ports-d0ab14ab884e583784d49381e8519f9ec0da8708.zip
Notes
Diffstat (limited to 'comms/bluegps/files')
-rw-r--r--comms/bluegps/files/patch-aa35
-rw-r--r--comms/bluegps/files/patch-ab74
2 files changed, 109 insertions, 0 deletions
diff --git a/comms/bluegps/files/patch-aa b/comms/bluegps/files/patch-aa
new file mode 100644
index 000000000000..bec396a985cb
--- /dev/null
+++ b/comms/bluegps/files/patch-aa
@@ -0,0 +1,35 @@
+--- bluegps.1 2006-06-04 13:41:03.000000000 +0200
++++ bluegps.1 2007-07-29 18:53:13.000000000 +0200
+@@ -14,8 +14,9 @@
+ .LP
+ The bluetooth address (bdaddr) of the RBT-3000 to be used has to
+ be specified on the command line. This bluetooth address can e.g.
+-be determined using the \fBhcitool(1)\fP command.
+-
++be determined using the \fBhcitool(1)\fP command (linux). Or
++alternatively use the friendly name. (freebsd, see
++\fBbluetooth.hosts(5)\fP).
+ .SH OPTIONS
+ .TP
+ .BI \-d " filename"
+@@ -112,6 +113,13 @@
+ bluegps -d testlog.nmea 00:02:C7:00:11:22
+ .RE
+ .LP
++On freebsd; if there is an entry in /etc/bluetooth/hosts you can
++also use:
++.LP
++.RS +4
++bluegps -d testlog.nmea BlueGPS
++.RE
++.LP
+ If the GPS has been setup to use the password 1234 use the following
+ command:
+ .LP
+@@ -130,4 +138,5 @@
+ accompanies each copy of \fIbluegps\fP.
+ .SH AUTHORS
+ Till Harbaum <Till@Harbaum.org>,
+-Simon Budig <simon@budig.de>
++Simon Budig <simon@budig.de> and
++some minor changes for FreeBSD by Dirk-Willem van Gulik <dirkx@webweaving.org>.
diff --git a/comms/bluegps/files/patch-ab b/comms/bluegps/files/patch-ab
new file mode 100644
index 000000000000..feba011f1158
--- /dev/null
+++ b/comms/bluegps/files/patch-ab
@@ -0,0 +1,74 @@
+--- bluegps.c 2006-06-26 20:28:31.000000000 +0200
++++ bluegps.c 2007-07-29 18:54:17.000000000 +0200
+@@ -27,10 +27,21 @@
+ #include <stdarg.h>
+ #include <ctype.h>
+
++#ifdef __FreeBSD__
++#include <string.h>
++#include <sys/types.h>
++#include <sys/socket.h>
++#else
+ #include <netinet/ip.h>
++#endif
+
++
++#ifdef __FreeBSD__
++#include <bluetooth.h>
++#else
+ #include <bluetooth/bluetooth.h>
+ #include <bluetooth/rfcomm.h>
++#endif
+
+ #include "rbt3000.h"
+
+@@ -269,19 +280,44 @@
+ int
+ rbt3000_connect (char *device_addr)
+ {
+-
++#ifdef __FreeBSD__
++ struct sockaddr_rfcomm rem_addr;
++ struct hostent * he;
++
++ memset(&rem_addr, 0, sizeof(rem_addr));
++ rem_addr.rfcomm_len = sizeof(rem_addr);
++ rem_addr.rfcomm_family = AF_BLUETOOTH;
++ rem_addr.rfcomm_channel = RFCOMM_CHANNEL;
++
++ if ((he = bt_gethostbyname(device_addr))) {
++ context->device = *(bdaddr_t *) he->h_addr_list[0];
++ if (context->messages == MSG_VERBOSE)
++ printf("Actual BT address for '%s': %s\n",
++ device_addr, bt_ntoa(&(context->device),NULL));
++ } else
++ if (!bt_aton(device_addr, &context->device)) {
++ perror("No such device address");
++ return 0;
++ }
++ rem_addr.rfcomm_bdaddr = context->device;
++#else
+ struct sockaddr_rc rem_addr;
+
+- baswap (&context->device, strtoba (device_addr));
+-
+ rem_addr.rc_family = AF_BLUETOOTH;
+- rem_addr.rc_bdaddr = context->device;
+ rem_addr.rc_channel = RFCOMM_CHANNEL;
++ baswap (&context->device, strtoba (device_addr));
++ rem_addr.rc_bdaddr = context->device;
++#endif
+
+ /* bluez connects to BlueClient */
+ if ((context->device_fd = socket (PF_BLUETOOTH,
+ SOCK_STREAM,
+- BTPROTO_RFCOMM)) < 0 )
++#ifdef __FreeBSD__
++ BLUETOOTH_PROTO_RFCOMM
++#else
++ BTPROTO_RFCOMM
++#endif
++ )) < 0 )
+ {
+ perror ("Can't create socket");
+ return 0;