Lines 1-66
Link Here
|
1 |
--- libgammu/device/bluetoth/bluez.c.orig 2011-12-21 17:25:37.000000000 +0400 |
|
|
2 |
+++ libgammu/device/bluetoth/bluez.c 2011-12-23 15:05:14.498122134 +0400 |
3 |
@@ -23,6 +23,8 @@ |
4 |
#ifdef GSM_ENABLE_BLUETOOTHDEVICE |
5 |
#ifdef BLUEZ_FOUND |
6 |
|
7 |
+#define BDADDR_ANY NG_HCI_BDADDR_ANY |
8 |
+ |
9 |
#include <stdlib.h> |
10 |
#include <stdio.h> |
11 |
#include <fcntl.h> |
12 |
@@ -31,11 +33,7 @@ |
13 |
#include <sys/socket.h> |
14 |
#include <sys/time.h> |
15 |
#include <unistd.h> |
16 |
-#include <bluetooth/bluetooth.h> |
17 |
-#include <bluetooth/rfcomm.h> |
18 |
-#include <bluetooth/sdp.h> |
19 |
-#include <bluetooth/sdp_lib.h> |
20 |
-#include <bluetooth/hci_lib.h> |
21 |
+#include <bluetooth.h> |
22 |
|
23 |
#include "../../gsmcomon.h" |
24 |
#include "../devfunc.h" |
25 |
@@ -48,7 +46,7 @@ GSM_Error bluetooth_connect(GSM_StateMac |
26 |
/* Some phones need time till they are accessible after SDP browsing */ |
27 |
for (tries = 0; tries < 5; tries++) { |
28 |
GSM_Device_BlueToothData *d = &s->Device.Data.BlueTooth; |
29 |
- struct sockaddr_rc laddr, raddr; |
30 |
+ struct sockaddr_rfcomm laddr, raddr; |
31 |
bdaddr_t bdaddr; |
32 |
int fd; |
33 |
|
34 |
@@ -61,15 +59,15 @@ GSM_Error bluetooth_connect(GSM_StateMac |
35 |
|
36 |
smprintf(s, "Connecting to RF channel %i\n", port); |
37 |
|
38 |
- fd = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM); |
39 |
+ fd = socket(PF_BLUETOOTH, SOCK_STREAM, BLUETOOTH_PROTO_RFCOMM); |
40 |
if (fd < 0) { |
41 |
smprintf(s, "Can't create socket\n"); |
42 |
continue; |
43 |
} |
44 |
|
45 |
- bacpy(&laddr.rc_bdaddr, BDADDR_ANY); |
46 |
- laddr.rc_family = AF_BLUETOOTH; |
47 |
- laddr.rc_channel = 0; |
48 |
+ bacpy(&laddr.rfcomm_bdaddr, BDADDR_ANY); |
49 |
+ laddr.rfcomm_family = AF_BLUETOOTH; |
50 |
+ laddr.rfcomm_channel = 0; |
51 |
|
52 |
if (bind(fd, (struct sockaddr *)&laddr, sizeof(laddr)) < 0) { |
53 |
smprintf(s, "Can't bind socket (%d, %s)\n", errno, strerror(errno)); |
54 |
@@ -78,9 +76,9 @@ GSM_Error bluetooth_connect(GSM_StateMac |
55 |
} |
56 |
|
57 |
str2ba(device, &bdaddr); |
58 |
- bacpy(&raddr.rc_bdaddr, &bdaddr); |
59 |
- raddr.rc_family = AF_BLUETOOTH; |
60 |
- raddr.rc_channel = port; |
61 |
+ bacpy(&raddr.rfcomm_bdaddr, &bdaddr); |
62 |
+ raddr.rfcomm_family = AF_BLUETOOTH; |
63 |
+ raddr.rfcomm_channel = port; |
64 |
|
65 |
if (connect(fd, (struct sockaddr *)&raddr, sizeof(raddr)) < 0) { |
66 |
smprintf(s, "Can't connect (%d, %s)\n", errno, strerror(errno)); |