summaryrefslogtreecommitdiff
path: root/plugins/bluetooth.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-06-01 16:11:30 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-04 16:21:01 +0300
commit84e9bd91181e160d560f60d35d037d900129ae53 (patch)
treeea814ef74b0a4c3f47153f8a27c8386aa0449897 /plugins/bluetooth.c
parent5866cd749920c40d85aa927d1a2fab92f5a45fc1 (diff)
downloadconnman-84e9bd91181e160d560f60d35d037d900129ae53.tar.gz
connman-84e9bd91181e160d560f60d35d037d900129ae53.tar.bz2
connman-84e9bd91181e160d560f60d35d037d900129ae53.zip
bluetooth: Check ownership of device
We have two drivers for the CONNMAN_DEVICE_TYPE_BLUETOOTH and therefore check owner ship in probe function.
Diffstat (limited to 'plugins/bluetooth.c')
-rw-r--r--plugins/bluetooth.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index d1328708..9e1aaa2c 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -885,9 +885,24 @@ static void bluetooth_disconnect(DBusConnection *connection, void *user_data)
static int bluetooth_probe(struct connman_device *device)
{
+ GHashTableIter iter;
+ gpointer key, value;
+
DBG("device %p", device);
- return 0;
+ if (bluetooth_devices == NULL)
+ return -ENOTSUP;
+
+ g_hash_table_iter_init(&iter, bluetooth_devices);
+
+ while (g_hash_table_iter_next(&iter, &key, &value) == TRUE) {
+ struct connman_device *device_pan = value;
+
+ if (device == device_pan)
+ return 0;
+ }
+
+ return -ENOTSUP;
}
static void bluetooth_remove(struct connman_device *device)