From 730775d1226a30c37ff551955f093ddfcd18e600 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 26 Aug 2008 13:59:06 -0300 Subject: Cleanup: unnecessary includes and defines, moved some declarations --- src/adapter.h | 6 ------ src/device.c | 5 +---- src/hcid.h | 28 +--------------------------- src/security.c | 31 ++++++++++++++++++++----------- 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 -#include #include #include #include @@ -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 -#include - -#include - #include #include #include -#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 #include -#include -#include -#include -#include -#include -#include #include #include #include @@ -49,10 +43,23 @@ #include -#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; -- cgit