summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@azingo.com>2008-07-09 14:22:45 +0530
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-28 10:35:30 -0300
commit595bd38a9fe105ef20d1b0527e04c7d28532d22d (patch)
tree40eac498bcad3b19b76f52594f622d254a34f790
parentf169545f05c25960c094c12f11a4ee452fb96ba8 (diff)
Adding device_set_temporary.
Signed-off-by: Alok Barsode <alok.barsode@azingo.com>
-rw-r--r--hcid/adapter.c4
-rw-r--r--hcid/dbus-hci.c8
-rw-r--r--hcid/device.c8
-rw-r--r--hcid/device.h1
4 files changed, 15 insertions, 6 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index 6f501713..029823f4 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -650,7 +650,7 @@ struct device *adapter_create_device(DBusConnection *conn,
if (!device)
return NULL;
- device->temporary = TRUE;
+ device_set_temporary(device, TRUE);
adapter->devices = g_slist_append(adapter->devices, device);
@@ -1600,7 +1600,7 @@ static DBusMessage *create_device(DBusConnection *conn,
if (!device)
return NULL;
- device->temporary = FALSE;
+ device_set_temporary(device, FALSE);
device_browse(device, conn, msg, NULL);
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index d59a4788..1afe3d8f 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -508,7 +508,7 @@ static void create_stored_device_from_profiles(char *key, char *value,
device = device_create(connection, adapter, key);
if (device) {
- device->temporary = FALSE;
+ device_set_temporary(device, FALSE);
adapter->devices = g_slist_append(adapter->devices, device);
device_probe_drivers(device, uuids);
g_slist_free(uuids);
@@ -527,7 +527,7 @@ static void create_stored_device_from_linkkeys(char *key, char *value,
device = device_create(connection, adapter, key);
if (device) {
- device->temporary = FALSE;
+ device_set_temporary(device, FALSE);
adapter->devices = g_slist_append(adapter->devices, device);
}
}
@@ -1141,7 +1141,7 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
if (device) {
debug("hcid_dbus_bonding_process_complete: removing temporary flag");
- device->temporary = FALSE;
+ device_set_temporary(device, FALSE);
dev_path = device_get_path(device);
g_dbus_emit_signal(connection, adapter->path,
@@ -1179,7 +1179,7 @@ proceed:
dbus_connection_send(connection, reply, NULL);
dbus_message_unref(reply);
} else {
- device->temporary = FALSE;
+ device_set_temporary(device, FALSE);
device_browse(device, bonding->conn,
bonding->msg, NULL);
}
diff --git a/hcid/device.c b/hcid/device.c
index bf187493..aad8c2d8 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -978,6 +978,14 @@ gboolean device_is_temporary(struct device *device)
return device->temporary;
}
+void device_set_temporary(struct device *device, gboolean temporary)
+{
+ if (!device)
+ return;
+
+ device->temporary = temporary;
+}
+
int btd_register_device_driver(struct btd_device_driver *driver)
{
const char **uuid;
diff --git a/hcid/device.h b/hcid/device.h
index 3a82cf07..4f40e84a 100644
--- a/hcid/device.h
+++ b/hcid/device.h
@@ -63,6 +63,7 @@ struct agent *device_get_agent(struct device *device);
void device_set_agent(struct device *device, struct agent *agent);
gboolean device_is_busy(struct device *device);
gboolean device_is_temporary(struct device *device);
+void device_set_temporary(struct device *device, gboolean temporary);
#define BTD_UUIDS(args...) ((const char *[]) { args, NULL } )