summaryrefslogtreecommitdiff
path: root/comms/gammu-devel/files/patch-common-device-bluetoth-bluetoth.c
blob: 729cc7c15a413816dc7815aecd0222ac40b53605 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff -ur /usr/Arch/Nokia/Gammu/gammu-0.90.0/common/device/bluetoth/bluetoth.c ./common/device/bluetoth/bluetoth.c
--- /usr/Arch/Nokia/Gammu/gammu-0.90.0/common/device/bluetoth/bluetoth.c	Sun Nov  2 11:43:28 2003
+++ ./common/device/bluetoth/bluetoth.c	Tue Dec  9 17:19:59 2003
@@ -11,11 +11,10 @@
 #include <string.h>
 
 #ifndef WIN32
-#  include <sys/socket.h>
-#  include <sys/time.h>
-#  include <unistd.h>
-#  include <bluetooth/bluetooth.h>
-#  include <bluetooth/rfcomm.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <bluetooth.h>
 #else
 #  include <windows.h>
 #  include <io.h>
@@ -25,6 +24,11 @@
 #include "../devfunc.h"
 #include "bluetoth.h"
 
+#define BTPROTO_RFCOMM BLUETOOTH_PROTO_RFCOMM
+#define BDADDR_ANY NG_HCI_BDADDR_ANY
+
+#undef WIN32
+
 #ifdef WIN32
 static GSM_Error bluetooth_connect(GSM_StateMachine *s, int port)
 {
@@ -80,7 +84,7 @@
 static GSM_Error bluetooth_connect(GSM_StateMachine *s, int port)
 {
 	GSM_Device_BlueToothData 	*d = &s->Device.Data.BlueTooth;
-	struct sockaddr_rc 		laddr, raddr;
+	struct sockaddr_rfcomm 		laddr, raddr;
 	bdaddr_t			bdaddr;
 	int 				fd;
 
@@ -89,9 +93,9 @@
 		return GE_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");
@@ -100,9 +104,9 @@
 	}
 
 	str2ba(s->CurrentConfig->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");