From: Daniel Wagner <[email protected]>
We have two drivers for the CONNMAN_DEVICE_TYPE_BLUETOOTH and therefore
check owner ship in probe function.
---
plugins/elect.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/plugins/elect.c b/plugins/elect.c
index deafba9..ea28465 100644
--- a/plugins/elect.c
+++ b/plugins/elect.c
@@ -355,9 +355,24 @@ static struct connman_network_driver network_driver = {
static int elect_probe(struct connman_device *device)
{
+ GHashTableIter iter;
+ gpointer key, value;
+
DBG("device %p", device);
- return 0;
+ if (elect_devices == NULL)
+ return -ENOTSUP;
+
+ g_hash_table_iter_init(&iter, elect_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 elect_remove(struct connman_device *device)
--
1.7.8.110.g4cb5d1
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman