summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adapter.c34
-rw-r--r--src/adapter.h1
-rw-r--r--src/agent.c4
-rw-r--r--src/dbus-common.c3
-rw-r--r--src/dbus-database.c7
-rw-r--r--src/dbus-hci.c1
-rw-r--r--src/dbus-hci.h2
-rw-r--r--src/device.c6
-rw-r--r--src/error.c6
-rw-r--r--src/main.c1
-rw-r--r--src/manager.c10
11 files changed, 9 insertions, 66 deletions
diff --git a/src/adapter.c b/src/adapter.c
index e8e27715..b5e48dcb 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -32,10 +32,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
-#include <time.h>
-#include <sys/param.h>
#include <sys/ioctl.h>
-#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
@@ -56,7 +53,6 @@
#include "device.h"
#include "textfile.h"
-#include "oui.h"
#include "dbus-common.h"
#include "dbus-hci.h"
#include "dbus-database.h"
@@ -177,20 +173,6 @@ static int auth_req_cmp(const void *p1, const void *p2)
return bda ? bacmp(&pb1->bdaddr, bda) : -1;
}
-void adapter_auth_request_replied(struct adapter *adapter, bdaddr_t *dba)
-{
- GSList *l;
- struct pending_auth_info *auth;
-
- l = g_slist_find_custom(adapter->auth_reqs, dba, auth_req_cmp);
- if (!l)
- return;
-
- auth = l->data;
-
- auth->replied = TRUE;
-}
-
struct pending_auth_info *adapter_find_auth_request(struct adapter *adapter,
bdaddr_t *dba)
{
@@ -490,12 +472,14 @@ static DBusMessage *set_mode(DBusConnection *conn, DBusMessage *msg,
} else {
/* discoverable or limited */
if ((scan_enable & SCAN_INQUIRY) && (new_mode != adapter->mode)) {
- if (adapter->discov_timeout_id)
+ if (adapter->discov_timeout_id) {
g_source_remove(adapter->discov_timeout_id);
+ adapter->discov_timeout_id = 0;
+ }
if (!adapter->sessions && !adapter->discov_timeout)
- adapter->discov_timeout_id = g_timeout_add(adapter->discov_timeout * 1000,
- discov_timeout_handler, adapter);
+ adapter_set_discov_timeout(adapter,
+ adapter->discov_timeout * 1000);
}
}
done:
@@ -509,7 +493,7 @@ done:
return dbus_message_new_method_return(msg);
}
-gint find_session(struct mode_req *req, DBusMessage *msg)
+static gint find_session(struct mode_req *req, DBusMessage *msg)
{
const char *name = dbus_message_get_sender(req->msg);
const char *sender = dbus_message_get_sender(msg);
@@ -590,9 +574,7 @@ static DBusMessage *set_discoverable_timeout(DBusConnection *conn,
}
if ((timeout != 0) && (adapter->scan_mode & SCAN_INQUIRY))
- adapter->discov_timeout_id = g_timeout_add(timeout * 1000,
- discov_timeout_handler,
- adapter);
+ adapter_set_discov_timeout(adapter, timeout * 1000);
adapter->discov_timeout = timeout;
@@ -2651,7 +2633,7 @@ const gchar *adapter_get_address(struct adapter *adapter)
return adapter->address;
}
-gboolean discov_timeout_handler(void *data)
+static gboolean discov_timeout_handler(void *data)
{
struct adapter *adapter = data;
struct hci_request rq;
diff --git a/src/adapter.h b/src/adapter.h
index 729ef683..4e2366ba 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -159,7 +159,6 @@ int pending_remote_name_cancel(struct adapter *adapter);
void remove_pending_device(struct adapter *adapter);
-void adapter_auth_request_replied(struct adapter *adapter, bdaddr_t *dba);
struct pending_auth_info *adapter_find_auth_request(struct adapter *adapter,
bdaddr_t *dba);
void adapter_remove_auth_request(struct adapter *adapter, bdaddr_t *dba);
diff --git a/src/agent.c b/src/agent.c
index f0a6a44d..feb2b9cf 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -35,17 +35,13 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
-#include <bluetooth/sdp.h>
#include <glib.h>
#include <dbus/dbus.h>
#include <gdbus.h>
#include "hcid.h"
-#include "dbus-common.h"
-#include "error.h"
#include "adapter.h"
-#include "dbus-hci.h"
#include "device.h"
#include "agent.h"
diff --git a/src/dbus-common.c b/src/dbus-common.c
index 530f432e..ed41df8d 100644
--- a/src/dbus-common.c
+++ b/src/dbus-common.c
@@ -37,8 +37,6 @@
#include <bluetooth/bluetooth.h>
#include <bluetooth/l2cap.h>
-#include <bluetooth/sdp.h>
-#include <bluetooth/sdp_lib.h>
#include <glib.h>
#include <dbus/dbus.h>
@@ -48,7 +46,6 @@
#include "manager.h"
#include "adapter.h"
#include "dbus-hci.h"
-#include "dbus-database.h"
#include "dbus-common.h"
#define BLUEZ_NAME "org.bluez"
diff --git a/src/dbus-database.c b/src/dbus-database.c
index 46b1cbde..4d2bb911 100644
--- a/src/dbus-database.c
+++ b/src/dbus-database.c
@@ -38,15 +38,10 @@
#include <gdbus.h>
-#include "hcid.h"
#include "sdpd.h"
#include "sdp-xml.h"
-#include "manager.h"
-#include "adapter.h"
-#include "dbus-hci.h"
-#include "dbus-common.h"
#include "error.h"
-#include "dbus-database.h"
+#include "logging.h"
static GSList *records = NULL;
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 9370cf73..65b28da0 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -54,7 +54,6 @@
#include "glib-helper.h"
#include "dbus-common.h"
#include "agent.h"
-#include "dbus-hci.h"
static DBusConnection *connection = NULL;
diff --git a/src/dbus-hci.h b/src/dbus-hci.h
index 18de81b7..e052197a 100644
--- a/src/dbus-hci.h
+++ b/src/dbus-hci.h
@@ -66,8 +66,6 @@ int found_device_req_name(struct adapter *dbus_data);
int set_limited_discoverable(int dd, const uint8_t *cls, gboolean limited);
int set_service_classes(int dd, const uint8_t *cls, uint8_t value);
-int discov_timeout_handler(void *data);
-
void set_dbus_connection(DBusConnection *conn);
DBusConnection *get_dbus_connection(void);
diff --git a/src/device.c b/src/device.c
index a8f40f8e..196314d5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -29,13 +29,8 @@
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
-#include <stdarg.h>
#include <unistd.h>
-#include <sys/time.h>
#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/param.h>
-#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
@@ -48,7 +43,6 @@
#include <gdbus.h>
#include "hcid.h"
-#include "sdpd.h"
#include "logging.h"
#include "textfile.h"
diff --git a/src/error.c b/src/error.c
index 825cde4f..2f5fc7e0 100644
--- a/src/error.c
+++ b/src/error.c
@@ -27,12 +27,6 @@
#include <config.h>
#endif
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-
-#include <gdbus.h>
-
#include "error.h"
/* Helper function - internal use only */
diff --git a/src/main.c b/src/main.c
index bf83b3f3..d5f92300 100644
--- a/src/main.c
+++ b/src/main.c
@@ -54,7 +54,6 @@
#include "dbus-common.h"
#include "dbus-database.h"
#include "dbus-hci.h"
-#include "device.h"
#include "agent.h"
#include "manager.h"
diff --git a/src/manager.c b/src/manager.c
index 9b7e4439..0b6af1b5 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -48,18 +48,8 @@
#include "logging.h"
#include "textfile.h"
-#include "hcid.h"
-#include "sdpd.h"
#include "adapter.h"
-#include "dbus-common.h"
#include "error.h"
-#include "dbus-hci.h"
-#include "dbus-database.h"
-#include "sdp-xml.h"
-#include "oui.h"
-#include "agent.h"
-#include "device.h"
-
#include "manager.h"
static DBusConnection *connection = NULL;