* [PATCH v0 1/3] bluetooth: Add list of UUIDs to probe function
2012-06-04 14:11 [PATCH v0 0/3] Prefer PAN over DUN Daniel Wagner
@ 2012-06-04 14:11 ` Daniel Wagner
2012-06-04 14:11 ` [PATCH v0 2/3] bluetooth: Add PAN UUID Daniel Wagner
2012-06-04 14:11 ` [PATCH v0 3/3] dundee: Ignore DUN device if PAN is present Daniel Wagner
2 siblings, 0 replies; 5+ messages in thread
From: Daniel Wagner @ 2012-06-04 14:11 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2978 bytes --]
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
---
dundee/bluetooth.c | 2 +-
plugins/bluetooth.c | 8 +++++---
plugins/bluetooth.h | 2 +-
plugins/hfp_hf.c | 2 +-
plugins/sap.c | 2 +-
5 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dundee/bluetooth.c b/dundee/bluetooth.c
index e2e2bca..5a913cc 100644
--- a/dundee/bluetooth.c
+++ b/dundee/bluetooth.c
@@ -132,7 +132,7 @@ struct dundee_device_driver bluetooth_driver = {
.disconnect = bt_disconnect,
};
-static int bt_probe(const char *path, const char *dev_addr,
+static int bt_probe(GSList *uuids, const char *path, const char *dev_addr,
const char *adapter_addr, const char *alias)
{
struct bluetooth_device *bt;
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index dbf79eb..0be6000 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -265,16 +265,18 @@ static void bluetooth_probe(GSList *uuids, const char *path,
const char *device, const char *adapter,
const char *alias)
{
- for (; uuids; uuids = uuids->next) {
+ GSList *l;
+
+ for (l = uuids; l; l = l->next) {
struct bluetooth_profile *driver;
- const char *uuid = uuids->data;
+ const char *uuid = l->data;
int err;
driver = g_hash_table_lookup(uuid_hash, uuid);
if (driver == NULL)
continue;
- err = driver->probe(path, device, adapter, alias);
+ err = driver->probe(uuids, path, device, adapter, alias);
if (err == 0)
continue;
diff --git a/plugins/bluetooth.h b/plugins/bluetooth.h
index 4fc16ad..c06abf7 100644
--- a/plugins/bluetooth.h
+++ b/plugins/bluetooth.h
@@ -38,7 +38,7 @@
struct bluetooth_profile {
const char *name;
- int (*probe)(const char *device, const char *dev_addr,
+ int (*probe)(GSList *uuids, const char *device, const char *dev_addr,
const char *adapter_addr, const char *alias);
void (*remove)(const char *prefix);
void (*set_alias)(const char *device, const char *);
diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c
index 7c500e3..74780b7 100644
--- a/plugins/hfp_hf.c
+++ b/plugins/hfp_hf.c
@@ -206,7 +206,7 @@ static const GDBusMethodTable agent_methods[] = {
{ }
};
-static int hfp_hf_probe(const char *device, const char *dev_addr,
+static int hfp_hf_probe(GSList *uuids, const char *device, const char *dev_addr,
const char *adapter_addr, const char *alias)
{
struct ofono_modem *modem;
diff --git a/plugins/sap.c b/plugins/sap.c
index d893bc1..7f728f9 100644
--- a/plugins/sap.c
+++ b/plugins/sap.c
@@ -235,7 +235,7 @@ static void sap_post_online(struct ofono_modem *modem)
data->sap_driver->post_online(data->hw_modem);
}
-static int bluetooth_sap_probe(const char *device, const char *dev_addr,
+static int bluetooth_sap_probe(GSList *uuds, const char *device, const char *dev_addr,
const char *adapter_addr, const char *alias)
{
struct ofono_modem *modem;
--
1.7.10.130.g36e6c
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH v0 3/3] dundee: Ignore DUN device if PAN is present
2012-06-04 14:11 [PATCH v0 0/3] Prefer PAN over DUN Daniel Wagner
2012-06-04 14:11 ` [PATCH v0 1/3] bluetooth: Add list of UUIDs to probe function Daniel Wagner
2012-06-04 14:11 ` [PATCH v0 2/3] bluetooth: Add PAN UUID Daniel Wagner
@ 2012-06-04 14:11 ` Daniel Wagner
2012-06-04 14:14 ` Daniel Wagner
2 siblings, 1 reply; 5+ messages in thread
From: Daniel Wagner @ 2012-06-04 14:11 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 793 bytes --]
From: Daniel Wagner <daniel.wagner@bmw-carit.de>
---
dundee/bluetooth.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/dundee/bluetooth.c b/dundee/bluetooth.c
index 5a913cc..8762f51 100644
--- a/dundee/bluetooth.c
+++ b/dundee/bluetooth.c
@@ -141,6 +141,15 @@ static int bt_probe(GSList *uuids, const char *path, const char *dev_addr,
DBG("");
+ for (; uuids; uuids = uuids->next) {
+ const char *uuid = uuids->data;
+
+ if (g_strcmp0(uuid, NAP_UUID) == 0) {
+ ofono_info("Device %s supports DUN and PAN at the same time. DUN is ignored", path);
+ return -EUNATCH;
+ }
+ }
+
/* We already have this device in our hash, ignore */
if (g_hash_table_lookup(bluetooth_hash, path) != NULL)
return -EALREADY;
--
1.7.10.130.g36e6c
^ permalink raw reply related [flat|nested] 5+ messages in thread