summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-11-29 21:58:35 +0200
committerJohan Hedberg <johan.hedberg@nokia.com>2008-11-29 21:58:35 +0200
commite96edbf1d36d33e55087d4f47342fbc5af95773a (patch)
tree9f0b745cea4a854c8f99fb882341894a3ee22e86
parentfaeb00ab84d97bf5e59f36f5a962af50f22919f4 (diff)
Make adapter_remove_discov_timeout private to adapter.c
-rw-r--r--src/adapter.c27
-rw-r--r--src/adapter.h1
-rw-r--r--src/dbus-hci.c2
3 files changed, 14 insertions, 16 deletions
diff --git a/src/adapter.c b/src/adapter.c
index a44561de..6797820d 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -532,6 +532,18 @@ static uint8_t get_mode(const bdaddr_t *bdaddr, const char *mode)
return MODE_UNKNOWN;
}
+static void adapter_remove_discov_timeout(struct btd_adapter *adapter)
+{
+ if (!adapter)
+ return;
+
+ if(adapter->discov_timeout_id == 0)
+ return;
+
+ g_source_remove(adapter->discov_timeout_id);
+ adapter->discov_timeout_id = 0;
+}
+
static gboolean discov_timeout_handler(void *data)
{
struct btd_adapter *adapter = data;
@@ -3017,19 +3029,6 @@ void adapter_get_address(struct btd_adapter *adapter, bdaddr_t *bdaddr)
bacpy(bdaddr, &adapter->bdaddr);
}
-
-void adapter_remove_discov_timeout(struct btd_adapter *adapter)
-{
- if (!adapter)
- return;
-
- if(adapter->discov_timeout_id == 0)
- return;
-
- g_source_remove(adapter->discov_timeout_id);
- adapter->discov_timeout_id = 0;
-}
-
void adapter_set_state(struct btd_adapter *adapter, int state)
{
gboolean discov_active = FALSE;
@@ -3204,6 +3203,8 @@ void adapter_mode_changed(struct btd_adapter *adapter, uint8_t scan_mode)
if (adapter->scan_mode == scan_mode)
return;
+ adapter_remove_discov_timeout(adapter);
+
switch (scan_mode) {
case SCAN_DISABLED:
adapter->mode = MODE_OFF;
diff --git a/src/adapter.h b/src/adapter.h
index 28faf897..2fc22ca5 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -135,7 +135,6 @@ uint16_t adapter_get_dev_id(struct btd_adapter *adapter);
const gchar *adapter_get_path(struct btd_adapter *adapter);
void adapter_get_address(struct btd_adapter *adapter, bdaddr_t *bdaddr);
void adapter_remove(struct btd_adapter *adapter);
-void adapter_remove_discov_timeout(struct btd_adapter *adapter);
void adapter_set_state(struct btd_adapter *adapter, int state);
int adapter_get_state(struct btd_adapter *adapter);
struct remote_dev_info *adapter_search_found_devices(struct btd_adapter *adapter,
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index ee9f9cab..912ed532 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -1373,8 +1373,6 @@ void hcid_dbus_setscan_enable_complete(bdaddr_t *local)
goto failed;
}
- adapter_remove_discov_timeout(adapter);
-
adapter_mode_changed(adapter, rp.enable);
failed: