summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2008-08-26 13:59:06 -0300
committerClaudio Takahasi <claudio.takahasi@openbossa.org>2008-08-26 13:59:06 -0300
commit730775d1226a30c37ff551955f093ddfcd18e600 (patch)
tree639d2aa51463f10a5394cfb732bc0d4506aa658b
parent978342ab9d2a5175ff9a8e5469abdea75ed1442a (diff)
Cleanup: unnecessary includes and defines, moved some declarations
-rw-r--r--src/adapter.h6
-rw-r--r--src/device.c5
-rw-r--r--src/hcid.h28
-rw-r--r--src/security.c31
4 files changed, 22 insertions, 48 deletions
diff --git a/src/adapter.h b/src/adapter.h
index 4e2366ba..7d6ca9cb 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -24,12 +24,6 @@
#define ADAPTER_INTERFACE "org.bluez.Adapter"
-#define INVALID_DEV_ID 0xFFFF
-
-#define BONDING_TIMEOUT 45000 /* 45 sec */
-
-#define DC_PENDING_TIMEOUT 2000 /* 2 secs */
-
/* Discover types */
#define DISCOVER_TYPE_NONE 0x00
#define STD_INQUIRY 0x01
diff --git a/src/device.c b/src/device.c
index 196314d5..3c75cedf 100644
--- a/src/device.c
+++ b/src/device.c
@@ -27,7 +27,6 @@
#endif
#include <stdio.h>
-#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -59,8 +58,6 @@
#define DEFAULT_XML_BUF_SIZE 1024
#define DISCONNECT_TIMER 2
-#define DEVICE_INTERFACE "org.bluez.Device"
-
struct btd_driver_data {
struct btd_device_driver *driver;
void *priv;
@@ -714,7 +711,7 @@ static void iter_append_record(DBusMessageIter *dict, uint32_t handle,
dbus_message_iter_close_container(dict, &entry);
}
-void append_and_grow_string(void *data, const char *str)
+static void append_and_grow_string(void *data, const char *str)
{
sdp_buf_t *buff = data;
int len;
diff --git a/src/hcid.h b/src/hcid.h
index a367c201..fa62c706 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -23,19 +23,10 @@
*
*/
-#include <time.h>
-#include <sys/types.h>
-
-#include <glib.h>
-
#include <bluetooth/bluetooth.h>
#include <bluetooth/sdp.h>
#include <bluetooth/hci.h>
-#include "logging.h"
-
-#define HCID_CONFIG_FILE CONFIGDIR "/hcid.conf"
-
#define HCID_DEFAULT_DISCOVERABLE_TIMEOUT 180 /* 3 minutes */
/* When all services should trust a remote device */
@@ -100,26 +91,9 @@ struct hcid_opts {
int sock;
};
-extern struct hcid_opts hcid;
-typedef enum {
- REQ_PENDING,
- REQ_SENT
-} req_status_t;
-
-struct hci_req_data {
- int dev_id;
- int event;
- req_status_t status;
- bdaddr_t dba;
- uint16_t ogf;
- uint16_t ocf;
- void *cparam;
- int clen;
-};
+extern struct hcid_opts hcid;
-struct hci_req_data *hci_req_data_new(int dev_id, const bdaddr_t *dba, uint16_t ogf, uint16_t ocf, int event, const void *cparam, int clen);
-void hci_req_queue_append(struct hci_req_data *data);
void hci_req_queue_remove(int dev_id, bdaddr_t *dba);
#define HCID_OFFMODE_DEVDOWN 0
diff --git a/src/security.c b/src/security.c
index 11655271..58fc3471 100644
--- a/src/security.c
+++ b/src/security.c
@@ -29,12 +29,6 @@
#include <stdio.h>
#include <errno.h>
-#include <ctype.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <sys/param.h>
@@ -49,10 +43,23 @@
#include <dbus/dbus.h>
-#include "hcid.h"
#include "textfile.h"
-#include "adapter.h"
-#include "dbus-hci.h"
+
+typedef enum {
+ REQ_PENDING,
+ REQ_SENT
+} req_status_t;
+
+struct hci_req_data {
+ int dev_id;
+ int event;
+ req_status_t status;
+ bdaddr_t dba;
+ uint16_t ogf;
+ uint16_t ocf;
+ void *cparam;
+ int clen;
+};
struct g_io_info {
GIOChannel *channel;
@@ -64,7 +71,9 @@ static struct g_io_info io_data[HCI_MAX_DEV];
static GSList *hci_req_queue = NULL;
-struct hci_req_data *hci_req_data_new(int dev_id, const bdaddr_t *dba, uint16_t ogf, uint16_t ocf, int event, const void *cparam, int clen)
+static struct hci_req_data *hci_req_data_new(int dev_id, const bdaddr_t *dba,
+ uint16_t ogf, uint16_t ocf, int event,
+ const void *cparam, int clen)
{
struct hci_req_data *data;
@@ -121,7 +130,7 @@ static void hci_req_queue_process(int dev_id)
hci_close_dev(dd);
}
-void hci_req_queue_append(struct hci_req_data *data)
+static void hci_req_queue_append(struct hci_req_data *data)
{
GSList *l;
struct hci_req_data *match;