summaryrefslogtreecommitdiff
path: root/plugins/dundee.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2012-06-01 16:11:29 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-04 16:20:59 +0300
commit5866cd749920c40d85aa927d1a2fab92f5a45fc1 (patch)
tree5d84f32c20f90d5eb224248014524dba401df931 /plugins/dundee.c
parent0a342507aba5e2e1c0043139eb00a081863c0264 (diff)
downloadconnman-5866cd749920c40d85aa927d1a2fab92f5a45fc1.tar.gz
connman-5866cd749920c40d85aa927d1a2fab92f5a45fc1.tar.bz2
connman-5866cd749920c40d85aa927d1a2fab92f5a45fc1.zip
dundee: 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/dundee.c')
-rw-r--r--plugins/dundee.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/plugins/dundee.c b/plugins/dundee.c
index e756b6dd..19479acc 100644
--- a/plugins/dundee.c
+++ b/plugins/dundee.c
@@ -339,9 +339,24 @@ static struct connman_network_driver network_driver = {
static int dundee_probe(struct connman_device *device)
{
+ GHashTableIter iter;
+ gpointer key, value;
+
DBG("device %p", device);
- return 0;
+ if (dundee_devices == NULL)
+ return -ENOTSUP;
+
+ g_hash_table_iter_init(&iter, dundee_devices);
+
+ while (g_hash_table_iter_next(&iter, &key, &value) == TRUE) {
+ struct connman_device *device_dun = value;
+
+ if (device == device_dun)
+ return 0;
+ }
+
+ return -ENOTSUP;
}
static void dundee_remove(struct connman_device *device)