aboutsummaryrefslogblamecommitdiff
path: root/comms/gammu-devel/files/patch-bluetooth
blob: 1e698a06007198c2736c33a11273b6e0d376b821 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12



                                                                                           







                                     
                  










                                 
                   

























                                                                         
                 











                                                                        
diff -ru ../gammu-1.01.0.orig/common/device/bluetoth/bluez.c common/device/bluetoth/bluez.c
--- ../gammu-1.01.0.orig/common/device/bluetoth/bluez.c	Thu Mar 10 10:35:58 2005
+++ common/device/bluetoth/bluez.c	Sat Jul  9 12:46:07 2005
@@ -23,6 +23,8 @@
 #ifdef GSM_ENABLE_BLUETOOTHDEVICE
 #ifdef GSM_ENABLE_BLUEZ
 
+#define BDADDR_ANY NG_HCI_BDADDR_ANY
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <fcntl.h>
@@ -31,10 +33,7 @@
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <unistd.h>
-#include <bluetooth/bluetooth.h>
-#include <bluetooth/rfcomm.h>
-#include <bluetooth/sdp.h>
-#include <bluetooth/sdp_lib.h>
+#include <bluetooth.h>
 
 #include "../../gsmcomon.h"
 #include "../devfunc.h"
@@ -43,21 +42,21 @@
 GSM_Error bluetooth_connect(GSM_StateMachine *s, int port, char *device)
 {
 	GSM_Device_BlueToothData 	*d = &s->Device.Data.BlueTooth;
-	struct sockaddr_rc 		laddr, raddr;
+	struct sockaddr_rfcomm 		laddr, raddr;
 	bdaddr_t			bdaddr;
 	int 				fd;
 
 	smprintf(s, "Connecting to RF channel %i\n",port);
 
-	fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
+	fd = socket(PF_BLUETOOTH, SOCK_STREAM, BLUETOOTH_PROTO_RFCOMM);
 	if (fd < 0) {
 		dbgprintf("Can't create socket\n");
 		return ERR_DEVICENODRIVER;
 	}
 
-	bacpy(&laddr.rc_bdaddr, BDADDR_ANY);
-	laddr.rc_family 	= AF_BLUETOOTH;
-	laddr.rc_channel 	= 0;
+	bacpy(&laddr.rfcomm_bdaddr, BDADDR_ANY);
+	laddr.rfcomm_family 	= AF_BLUETOOTH;
+	laddr.rfcomm_channel 	= 0;
 
 	if (bind(fd, (struct sockaddr *)&laddr, sizeof(laddr)) < 0) {
 		dbgprintf("Can't bind socket\n");
@@ -66,9 +65,9 @@
 	}
 
 	str2ba(device, &bdaddr);
-	bacpy(&raddr.rc_bdaddr, &bdaddr);
-	raddr.rc_family 	= AF_BLUETOOTH;
-	raddr.rc_channel 	= port;
+	bacpy(&raddr.rfcomm_bdaddr, &bdaddr);
+	raddr.rfcomm_family 	= AF_BLUETOOTH;
+	raddr.rfcomm_channel 	= port;
 
 	if (connect(fd, (struct sockaddr *)&raddr, sizeof(raddr)) < 0) {
 		dbgprintf("Can't connect\n");