2012-05-30 12:59:53

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 00/15] Prefer PAN over DUN

From: Daniel Wagner <[email protected]>

Hi,

the first part of the series moves the UUID string definition into a
new header file inside the core. With this the last patch doesn't have
to include profile header files.

I did not order the defintion or 'improve' them in anyway. If this
approach is okay, I would suggest to add more patches on top of them
in order not to mix the moving and the 'improving' in one go.

cheers,
daniel

changes:

v2: - Move all UUID string definition into one header file
- Change configuration variable name
- This behavior is off by default

Daniel Wagner (15):
sdp: Remove unused BASE_UUID definition
audio: Move UUID defintion to core
network: Move UUID defintion to core
deviceinfo: Move UUID defintion to core
proximity: Move UUID defintion to core
sap: Move UUID definition to core
thermometer: Move UUID definition to core
serial: Move UUID defintion to core
health: Move UUID defintion to core
input: Move UUID defintion to core
pnat: Move UUID defintion to core
device: Move UUID definition to uuid.h
storage: Move UUID defintion to uuid.h
main: Add PreferPANoverDUN configuration switch
device: Ignore DUN if PAN is present

Makefile.am | 3 +-
audio/avctp.c | 1 +
audio/avdtp.c | 1 +
audio/avrcp.c | 1 +
audio/device.h | 16 ----------
audio/manager.c | 1 +
audio/media.c | 1 +
audio/transport.c | 1 +
deviceinfo/deviceinfo.c | 4 +--
deviceinfo/manager.c | 4 +--
health/hdp_manager.c | 2 ++
health/hdp_types.h | 4 ---
health/hdp_util.c | 2 ++
input/device.c | 1 +
input/device.h | 3 --
input/manager.c | 1 +
input/server.c | 1 +
lib/sdp.c | 2 --
network/common.c | 2 ++
network/common.h | 5 ----
network/manager.c | 2 ++
network/server.c | 1 +
plugins/pnat.c | 5 ++--
proximity/manager.c | 6 ++--
proximity/reporter.c | 4 +--
sap/server.c | 3 +-
serial/manager.c | 3 +-
src/device.c | 20 ++++++++++++-
src/hcid.h | 1 +
src/main.c | 8 +++++
src/main.conf | 5 ++++
src/storage.c | 1 +
src/storage.h | 2 --
src/uuid.h | 73 +++++++++++++++++++++++++++++++++++++++++++++
thermometer/manager.c | 4 +--
thermometer/thermometer.c | 7 ++---
36 files changed, 145 insertions(+), 56 deletions(-)
create mode 100644 src/uuid.h

--
1.7.10.130.g36e6c



2012-05-30 13:00:04

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 11/15] pnat: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
plugins/pnat.c | 5 +++--
src/uuid.h | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/plugins/pnat.c b/plugins/pnat.c
index 2d73910..ac35978 100644
--- a/plugins/pnat.c
+++ b/plugins/pnat.c
@@ -50,11 +50,12 @@
#include "adapter.h"
#include "log.h"

+#include "../src/uuid.h"
+
/* FIXME: This location should be build-time configurable */
#define PNATD "/usr/bin/phonet-at"

#define DUN_CHANNEL 1
-#define DUN_UUID "00001103-0000-1000-8000-00805F9B34FB"

#define TTY_TIMEOUT 100
#define TTY_TRIES 10
@@ -347,7 +348,7 @@ static void confirm_cb(GIOChannel *io, gpointer user_data)
return;
}

- if (btd_request_authorization(&server->bda, &client->bda, DUN_UUID,
+ if (btd_request_authorization(&server->bda, &client->bda, DUN_GW_UUID,
auth_cb, user_data) < 0) {
error("Requesting DUN authorization failed");
return;
diff --git a/src/uuid.h b/src/uuid.h
index 4bcc397..534a245 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -65,3 +65,5 @@
#define HDP_SINK_UUID "00001402-0000-1000-8000-00805f9b34fb"

#define HID_UUID "00001124-0000-1000-8000-00805f9b34fb"
+
+#define DUN_GW_UUID "00001103-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 13:00:02

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 09/15] health: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
health/hdp_manager.c | 2 ++
health/hdp_types.h | 4 ----
health/hdp_util.c | 2 ++
src/uuid.h | 4 ++++
4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/health/hdp_manager.c b/health/hdp_manager.c
index cccb1a6..7ca338a 100644
--- a/health/hdp_manager.c
+++ b/health/hdp_manager.c
@@ -27,6 +27,8 @@
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>

+#include "../src/uuid.h"
+
#include <btio.h>
#include <adapter.h>
#include <device.h>
diff --git a/health/hdp_types.h b/health/hdp_types.h
index 9a6776f..7f8b015 100644
--- a/health/hdp_types.h
+++ b/health/hdp_types.h
@@ -23,10 +23,6 @@
#ifndef __HDP_TYPES_H__
#define __HDP_TYPES_H__

-#define HDP_UUID "00001400-0000-1000-8000-00805F9B34FB"
-#define HDP_SOURCE_UUID "00001401-0000-1000-8000-00805F9B34FB"
-#define HDP_SINK_UUID "00001402-0000-1000-8000-00805F9B34FB"
-
#define MANAGER_PATH "/org/bluez"

#define HEALTH_MANAGER "org.bluez.HealthManager"
diff --git a/health/hdp_util.c b/health/hdp_util.c
index 3b48e44..8131ff5 100644
--- a/health/hdp_util.c
+++ b/health/hdp_util.c
@@ -38,6 +38,8 @@
#include <sdp-client.h>
#include <glib-helper.h>

+#include "../src/uuid.h"
+
#include <btio.h>

#include <log.h>
diff --git a/src/uuid.h b/src/uuid.h
index 4ed7ede..27e8ab5 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -59,3 +59,7 @@
#define MEASUREMENT_INTERVAL_UUID "00002a21-0000-1000-8000-00805f9b34fb"

#define RFCOMM_UUID_STR "00000003-0000-1000-8000-00805f9b34fb"
+
+#define HDP_UUID "00001400-0000-1000-8000-00805f9b34fb"
+#define HDP_SOURCE_UUID "00001401-0000-1000-8000-00805f9b34fb"
+#define HDP_SINK_UUID "00001402-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 13:00:01

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 08/15] serial: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
serial/manager.c | 3 +--
src/uuid.h | 2 ++
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/serial/manager.c b/serial/manager.c
index b609054..a4eb473 100644
--- a/serial/manager.c
+++ b/serial/manager.c
@@ -50,6 +50,7 @@
#include <gdbus.h>

#include "../src/dbus-common.h"
+#include "../src/uuid.h"
#include "adapter.h"
#include "device.h"

@@ -63,8 +64,6 @@
#include "sdpd.h"
#include "glib-helper.h"

-#define RFCOMM_UUID_STR "00000003-0000-1000-8000-00805F9B34FB"
-
static DBusConnection *connection = NULL;

static int serial_probe(struct btd_device *device, const char *uuid)
diff --git a/src/uuid.h b/src/uuid.h
index 24a0e72..4ed7ede 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -57,3 +57,5 @@
#define TEMPERATURE_TYPE_UUID "00002a1d-0000-1000-8000-00805f9b34fb"
#define INTERMEDIATE_TEMPERATURE_UUID "00002a1e-0000-1000-8000-00805f9b34fb"
#define MEASUREMENT_INTERVAL_UUID "00002a21-0000-1000-8000-00805f9b34fb"
+
+#define RFCOMM_UUID_STR "00000003-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 13:00:06

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 13/15] storage: Move UUID defintion to uuid.h

From: Daniel Wagner <[email protected]>

---
src/storage.c | 1 +
src/storage.h | 2 --
src/uuid.h | 2 ++
3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/storage.c b/src/storage.c
index 7d65fe1..36a5595 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -45,6 +45,7 @@
#include "textfile.h"
#include "glib-helper.h"
#include "storage.h"
+#include "uuid.h"

struct match {
GSList *keys;
diff --git a/src/storage.h b/src/storage.h
index c541807..cc00e97 100644
--- a/src/storage.h
+++ b/src/storage.h
@@ -100,5 +100,3 @@ void delete_device_ccc(bdaddr_t *local, bdaddr_t *peer);
int write_longtermkeys(bdaddr_t *local, bdaddr_t *peer, uint8_t bdaddr_type,
const char *key);
gboolean has_longtermkeys(bdaddr_t *local, bdaddr_t *peer, uint8_t bdaddr_type);
-
-#define PNP_UUID "00001200-0000-1000-8000-00805f9b34fb"
diff --git a/src/uuid.h b/src/uuid.h
index 70408a0..6d94593 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -69,3 +69,5 @@
#define DUN_GW_UUID "00001103-0000-1000-8000-00805f9b34fb"

#define GAP_SVC_UUID "00001800-0000-1000-8000-00805f9b34fb"
+
+#define PNP_UUID "00001200-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 13:00:05

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 12/15] device: Move UUID definition to uuid.h

From: Daniel Wagner <[email protected]>

---
src/device.c | 2 +-
src/uuid.h | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/device.c b/src/device.c
index 7ff09aa..928ea2b 100644
--- a/src/device.c
+++ b/src/device.c
@@ -59,6 +59,7 @@
#include "agent.h"
#include "sdp-xml.h"
#include "storage.h"
+#include "uuid.h"
#include "btio.h"
#include "attrib-server.h"
#include "attrib/client.h"
@@ -71,7 +72,6 @@
/* When all services should trust a remote device */
#define GLOBAL_TRUST "[all]"

-#define GAP_SVC_UUID "00001800-0000-1000-8000-00805f9b34fb"
#define APPEARANCE_CHR_UUID 0x2a01

struct btd_disconnect_data {
diff --git a/src/uuid.h b/src/uuid.h
index 534a245..70408a0 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -67,3 +67,5 @@
#define HID_UUID "00001124-0000-1000-8000-00805f9b34fb"

#define DUN_GW_UUID "00001103-0000-1000-8000-00805f9b34fb"
+
+#define GAP_SVC_UUID "00001800-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 12:59:56

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 03/15] network: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
network/common.c | 2 ++
network/common.h | 5 -----
network/manager.c | 2 ++
network/server.c | 1 +
src/uuid.h | 5 +++++
5 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/network/common.c b/network/common.c
index c498c25..9b59935 100644
--- a/network/common.c
+++ b/network/common.c
@@ -42,6 +42,8 @@

#include <glib.h>

+#include "../src/uuid.h"
+
#include "log.h"
#include "common.h"

diff --git a/network/common.h b/network/common.h
index fefb754..cb1f08a 100644
--- a/network/common.h
+++ b/network/common.h
@@ -21,11 +21,6 @@
*
*/

-#define PANU_UUID "00001115-0000-1000-8000-00805f9b34fb"
-#define NAP_UUID "00001116-0000-1000-8000-00805f9b34fb"
-#define GN_UUID "00001117-0000-1000-8000-00805f9b34fb"
-#define BNEP_SVC_UUID "0000000f-0000-1000-8000-00805f9b34fb"
-
int bnep_init(void);
int bnep_cleanup(void);

diff --git a/network/manager.c b/network/manager.c
index dd0f311..9d15ff5 100644
--- a/network/manager.c
+++ b/network/manager.c
@@ -32,6 +32,8 @@
#include <glib.h>
#include <gdbus.h>

+#include "../src/uuid.h"
+
#include "log.h"

#include "adapter.h"
diff --git a/network/server.c b/network/server.c
index e39769a..9a6dc83 100644
--- a/network/server.c
+++ b/network/server.c
@@ -41,6 +41,7 @@

#include "../src/dbus-common.h"
#include "../src/adapter.h"
+#include "../src/uuid.h"

#include "log.h"
#include "error.h"
diff --git a/src/uuid.h b/src/uuid.h
index 8aecec5..61ea6e5 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -36,3 +36,8 @@

#define AVRCP_REMOTE_UUID "0000110e-0000-1000-8000-00805f9b34fb"
#define AVRCP_TARGET_UUID "0000110c-0000-1000-8000-00805f9b34fb"
+
+#define PANU_UUID "00001115-0000-1000-8000-00805f9b34fb"
+#define NAP_UUID "00001116-0000-1000-8000-00805f9b34fb"
+#define GN_UUID "00001117-0000-1000-8000-00805f9b34fb"
+#define BNEP_SVC_UUID "0000000f-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 13:00:07

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 14/15] main: Add PreferPANoverDUN configuration switch

From: Daniel Wagner <[email protected]>

---
src/hcid.h | 1 +
src/main.c | 8 ++++++++
src/main.conf | 5 +++++
3 files changed, 14 insertions(+)

diff --git a/src/hcid.h b/src/hcid.h
index 1e5e15a..2e46a44 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -39,6 +39,7 @@ struct main_opts {
gboolean name_resolv;
gboolean debug_keys;
gboolean gatt_enabled;
+ gboolean prefer_pan;

uint8_t mode;

diff --git a/src/main.c b/src/main.c
index 286baa0..8ae9f6a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -241,6 +241,14 @@ static void parse_config(GKeyFile *config)
else
main_opts.gatt_enabled = boolean;

+ boolean = g_key_file_get_boolean(config, "General",
+ "PreferPANoverDUN", &err);
+ if (err) {
+ DBG("%s", err->message);
+ g_clear_error(&err);
+ } else
+ main_opts.prefer_pan = boolean;
+
main_opts.link_mode = HCI_LM_ACCEPT;

main_opts.link_policy = HCI_LP_RSWITCH | HCI_LP_SNIFF |
diff --git a/src/main.conf b/src/main.conf
index 787ef4f..eda01ec 100644
--- a/src/main.conf
+++ b/src/main.conf
@@ -62,3 +62,8 @@ DebugKeys = false

# Enable the GATT functionality. Default is false
EnableGatt = false
+
+# If a device supports both DUN and PAN at the same time, ignore the
+# DUN profile. Only PAN will be exposed through the D-Bus API in this
+# case. The default is false
+PreferPANoverDUN = false
--
1.7.10.130.g36e6c


2012-05-30 12:59:59

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 06/15] sap: Move UUID definition to core

From: Daniel Wagner <[email protected]>

---
sap/server.c | 3 ++-
src/uuid.h | 2 ++
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/sap/server.c b/sap/server.c
index c83e68a..6f446f5 100644
--- a/sap/server.c
+++ b/sap/server.c
@@ -33,6 +33,8 @@
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>

+#include "../src/uuid.h"
+
#include "adapter.h"
#include "btio.h"
#include "sdpd.h"
@@ -43,7 +45,6 @@
#include "server.h"

#define SAP_SERVER_INTERFACE "org.bluez.SimAccess"
-#define SAP_UUID "0000112D-0000-1000-8000-00805F9B34FB"
#define SAP_SERVER_CHANNEL 8

#define PADDING4(x) ((4 - ((x) & 0x03)) & 0x03)
diff --git a/src/uuid.h b/src/uuid.h
index 2fc3d54..66164b8 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -49,3 +49,5 @@
#define IMMEDIATE_ALERT_UUID "00001802-0000-1000-8000-00805f9b34fb"
#define LINK_LOSS_UUID "00001803-0000-1000-8000-00805f9b34fb"
#define TX_POWER_UUID "00001804-0000-1000-8000-00805f9b34fb"
+
+#define SAP_UUID "0000112D-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 13:00:03

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 10/15] input: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
input/device.c | 1 +
input/device.h | 3 ---
input/manager.c | 1 +
input/server.c | 1 +
src/uuid.h | 2 ++
5 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/input/device.c b/input/device.c
index e2c48b9..1989384 100644
--- a/input/device.c
+++ b/input/device.c
@@ -50,6 +50,7 @@
#include "../src/storage.h"
#include "../src/manager.h"
#include "../src/dbus-common.h"
+#include "../src/uuid.h"

#include "device.h"
#include "error.h"
diff --git a/input/device.h b/input/device.h
index c14b81a..509a353 100644
--- a/input/device.h
+++ b/input/device.h
@@ -21,9 +21,6 @@
*
*/

-#define HSP_HS_UUID "00001108-0000-1000-8000-00805F9B34FB"
-#define HID_UUID "00001124-0000-1000-8000-00805f9b34fb"
-
#define L2CAP_PSM_HIDP_CTRL 0x11
#define L2CAP_PSM_HIDP_INTR 0x13

diff --git a/input/manager.c b/input/manager.c
index 4ac5686..2a523dc 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -37,6 +37,7 @@
#include "log.h"
#include "../src/adapter.h"
#include "../src/device.h"
+#include "../src/uuid.h"

#include "device.h"
#include "server.h"
diff --git a/input/server.c b/input/server.c
index 17e7547..b42a00f 100644
--- a/input/server.c
+++ b/input/server.c
@@ -35,6 +35,7 @@
#include <dbus/dbus.h>

#include "log.h"
+#include "../src/uuid.h"

#include "glib-helper.h"
#include "btio.h"
diff --git a/src/uuid.h b/src/uuid.h
index 27e8ab5..4bcc397 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -63,3 +63,5 @@
#define HDP_UUID "00001400-0000-1000-8000-00805f9b34fb"
#define HDP_SOURCE_UUID "00001401-0000-1000-8000-00805f9b34fb"
#define HDP_SINK_UUID "00001402-0000-1000-8000-00805f9b34fb"
+
+#define HID_UUID "00001124-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 13:00:08

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 15/15] device: Ignore DUN if PAN is present

From: Daniel Wagner <[email protected]>

Filtering DUN out at BlueZ level reduces the number of CPU cycles and
memory spend just to figure out that PAN is always preferred over DUN.

Doing this could on a the network manager level (e.g. ConnMan) or
at an intermediate daemon such as dundee which handles AT command
parsing and PPP setup is possible just more expensive.

Therefore, just ignore the DUN completely and do not even announce it.
---
src/device.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/src/device.c b/src/device.c
index 928ea2b..c6112fe 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1530,6 +1530,24 @@ static void update_services(struct browse_req *req, sdp_list_t *recs)

sdp_list_free(svcclass, free);
}
+
+ if (!main_opts.prefer_pan)
+ return;
+
+ if (g_slist_find_custom(req->profiles_added, NAP_UUID,
+ (GCompareFunc) strcmp) != NULL) {
+ GSList *l;
+
+ l = g_slist_find_custom(req->profiles_added,
+ DUN_GW_UUID,
+ (GCompareFunc) strcmp);
+ if (l != NULL) {
+ DBG("Skipping DUN entry because PAN was found.");
+ g_free(l->data);
+ req->profiles_added = g_slist_remove_link(
+ req->profiles_added, l);
+ }
+ }
}

static void store_profiles(struct btd_device *device)
--
1.7.10.130.g36e6c


2012-05-30 13:00:00

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 07/15] thermometer: Move UUID definition to core

From: Daniel Wagner <[email protected]>

---
src/uuid.h | 6 ++++++
thermometer/manager.c | 4 ++--
thermometer/thermometer.c | 7 ++-----
3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/uuid.h b/src/uuid.h
index 66164b8..24a0e72 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -51,3 +51,9 @@
#define TX_POWER_UUID "00001804-0000-1000-8000-00805f9b34fb"

#define SAP_UUID "0000112D-0000-1000-8000-00805f9b34fb"
+
+#define HEALTH_THERMOMETER_UUID "00001809-0000-1000-8000-00805f9b34fb"
+#define TEMPERATURE_MEASUREMENT_UUID "00002a1c-0000-1000-8000-00805f9b34fb"
+#define TEMPERATURE_TYPE_UUID "00002a1d-0000-1000-8000-00805f9b34fb"
+#define INTERMEDIATE_TEMPERATURE_UUID "00002a1e-0000-1000-8000-00805f9b34fb"
+#define MEASUREMENT_INTERVAL_UUID "00002a21-0000-1000-8000-00805f9b34fb"
diff --git a/thermometer/manager.c b/thermometer/manager.c
index 8982beb..a436f38 100644
--- a/thermometer/manager.c
+++ b/thermometer/manager.c
@@ -24,6 +24,8 @@
#include <errno.h>
#include <bluetooth/uuid.h>

+#include "../src/uuid.h"
+
#include "adapter.h"
#include "device.h"
#include "att.h"
@@ -32,8 +34,6 @@
#include "thermometer.h"
#include "manager.h"

-#define HEALTH_THERMOMETER_UUID "00001809-0000-1000-8000-00805f9b34fb"
-
static DBusConnection *connection = NULL;

static gint primary_uuid_cmp(gconstpointer a, gconstpointer b)
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 4df9d2c..43bd821 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -28,6 +28,8 @@
#include <errno.h>
#include <bluetooth/uuid.h>

+#include "../src/uuid.h"
+
#include "dbus-common.h"
#include "adapter.h"
#include "device.h"
@@ -41,11 +43,6 @@

#define THERMOMETER_INTERFACE "org.bluez.Thermometer"

-#define TEMPERATURE_MEASUREMENT_UUID "00002a1c-0000-1000-8000-00805f9b34fb"
-#define TEMPERATURE_TYPE_UUID "00002a1d-0000-1000-8000-00805f9b34fb"
-#define INTERMEDIATE_TEMPERATURE_UUID "00002a1e-0000-1000-8000-00805f9b34fb"
-#define MEASUREMENT_INTERVAL_UUID "00002a21-0000-1000-8000-00805f9b34fb"
-
/* Temperature measurement flag fields */
#define TEMP_UNITS 0x01
#define TEMP_TIME_STAMP 0x02
--
1.7.10.130.g36e6c


2012-05-30 12:59:55

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 02/15] audio: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
Makefile.am | 3 ++-
audio/avctp.c | 1 +
audio/avdtp.c | 1 +
audio/avrcp.c | 1 +
audio/device.h | 16 ----------------
audio/manager.c | 1 +
audio/media.c | 1 +
audio/transport.c | 1 +
src/uuid.h | 38 ++++++++++++++++++++++++++++++++++++++
9 files changed, 46 insertions(+), 17 deletions(-)
create mode 100644 src/uuid.h

diff --git a/Makefile.am b/Makefile.am
index d223a7a..8d96483 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -304,7 +304,8 @@ src_bluetoothd_SOURCES = $(gdbus_sources) $(builtin_sources) \
src/device.h src/device.c src/attio.h \
src/dbus-common.c src/dbus-common.h \
src/event.h src/event.c \
- src/oob.h src/oob.c src/eir.h src/eir.c
+ src/oob.h src/oob.c src/eir.h src/eir.c \
+ src/uuid.h
src_bluetoothd_LDADD = lib/libbluetooth-private.la @GLIB_LIBS@ @DBUS_LIBS@ \
-ldl -lrt
src_bluetoothd_LDFLAGS = $(AM_LDFLAGS) -Wl,--export-dynamic \
diff --git a/audio/avctp.c b/audio/avctp.c
index 5f9afa1..5c2b0d0 100644
--- a/audio/avctp.c
+++ b/audio/avctp.c
@@ -45,6 +45,7 @@

#include "adapter.h"
#include "../src/device.h"
+#include "../src/uuid.h"

#include "log.h"
#include "error.h"
diff --git a/audio/avdtp.c b/audio/avdtp.c
index 34d49d2..785ce59 100644
--- a/audio/avdtp.c
+++ b/audio/avdtp.c
@@ -47,6 +47,7 @@
#include "../src/adapter.h"
#include "../src/manager.h"
#include "../src/device.h"
+#include "../src/uuid.h"

#include "device.h"
#include "manager.h"
diff --git a/audio/avrcp.c b/audio/avrcp.c
index a040099..19e0aad 100644
--- a/audio/avrcp.c
+++ b/audio/avrcp.c
@@ -47,6 +47,7 @@

#include "../src/adapter.h"
#include "../src/device.h"
+#include "../src/uuid.h"

#include "log.h"
#include "error.h"
diff --git a/audio/device.h b/audio/device.h
index 5117fca..75f1da9 100644
--- a/audio/device.h
+++ b/audio/device.h
@@ -22,22 +22,6 @@
*
*/

-#define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805f9b34fb"
-
-#define HSP_HS_UUID "00001108-0000-1000-8000-00805f9b34fb"
-#define HSP_AG_UUID "00001112-0000-1000-8000-00805f9b34fb"
-
-#define HFP_HS_UUID "0000111e-0000-1000-8000-00805f9b34fb"
-#define HFP_AG_UUID "0000111f-0000-1000-8000-00805f9b34fb"
-
-#define ADVANCED_AUDIO_UUID "0000110d-0000-1000-8000-00805f9b34fb"
-
-#define A2DP_SOURCE_UUID "0000110a-0000-1000-8000-00805f9b34fb"
-#define A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb"
-
-#define AVRCP_REMOTE_UUID "0000110e-0000-1000-8000-00805f9b34fb"
-#define AVRCP_TARGET_UUID "0000110c-0000-1000-8000-00805f9b34fb"
-
struct source;
struct control;
struct target;
diff --git a/audio/manager.c b/audio/manager.c
index fb7af98..376f563 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -51,6 +51,7 @@
#include "../src/adapter.h"
#include "../src/manager.h"
#include "../src/device.h"
+#include "../src/uuid.h"

#include "log.h"
#include "ipc.h"
diff --git a/audio/media.c b/audio/media.c
index 2a2cf37..99548ae 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -34,6 +34,7 @@

#include "../src/adapter.h"
#include "../src/dbus-common.h"
+#include "../src/uuid.h"

#include "glib-helper.h"
#include "log.h"
diff --git a/audio/transport.c b/audio/transport.c
index 4273282..cc5bc16 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -33,6 +33,7 @@

#include "../src/adapter.h"
#include "../src/dbus-common.h"
+#include "../src/uuid.h"

#include "log.h"
#include "error.h"
diff --git a/src/uuid.h b/src/uuid.h
new file mode 100644
index 0000000..8aecec5
--- /dev/null
+++ b/src/uuid.h
@@ -0,0 +1,38 @@
+/*
+ *
+ * BlueZ - Bluetooth protocol stack for Linux
+ *
+ * Copyright (C) 2012 BMW Car IT GmbH. All rights reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#define GENERIC_AUDIO_UUID "00001203-0000-1000-8000-00805f9b34fb"
+
+#define HSP_HS_UUID "00001108-0000-1000-8000-00805f9b34fb"
+#define HSP_AG_UUID "00001112-0000-1000-8000-00805f9b34fb"
+
+#define HFP_HS_UUID "0000111e-0000-1000-8000-00805f9b34fb"
+#define HFP_AG_UUID "0000111f-0000-1000-8000-00805f9b34fb"
+
+#define ADVANCED_AUDIO_UUID "0000110d-0000-1000-8000-00805f9b34fb"
+
+#define A2DP_SOURCE_UUID "0000110a-0000-1000-8000-00805f9b34fb"
+#define A2DP_SINK_UUID "0000110b-0000-1000-8000-00805f9b34fb"
+
+#define AVRCP_REMOTE_UUID "0000110e-0000-1000-8000-00805f9b34fb"
+#define AVRCP_TARGET_UUID "0000110c-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 12:59:58

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 05/15] proximity: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
proximity/manager.c | 6 ++----
proximity/reporter.c | 4 ++--
src/uuid.h | 5 +++++
3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/proximity/manager.c b/proximity/manager.c
index 286f7e3..6e89839 100644
--- a/proximity/manager.c
+++ b/proximity/manager.c
@@ -30,6 +30,8 @@
#include <gdbus.h>
#include <bluetooth/uuid.h>

+#include "../src/uuid.h"
+
#include "adapter.h"
#include "device.h"
#include "att.h"
@@ -39,10 +41,6 @@
#include "reporter.h"
#include "manager.h"

-#define IMMEDIATE_ALERT_UUID "00001802-0000-1000-8000-00805f9b34fb"
-#define LINK_LOSS_UUID "00001803-0000-1000-8000-00805f9b34fb"
-#define TX_POWER_UUID "00001804-0000-1000-8000-00805f9b34fb"
-
static DBusConnection *connection = NULL;

static struct enabled enabled = {
diff --git a/proximity/reporter.c b/proximity/reporter.c
index 20779a8..d051477 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
@@ -34,6 +34,8 @@
#include <dbus/dbus.h>
#include <gdbus.h>

+#include "../src/uuid.h"
+
#include "log.h"

#include "dbus-common.h"
@@ -51,8 +53,6 @@

#define BLUEZ_SERVICE "org.bluez"

-#define GATT_UUID "00001801-0000-1000-8000-00805f9b34fb"
-
struct reporter_adapter {
DBusConnection *conn;
struct btd_adapter *adapter;
diff --git a/src/uuid.h b/src/uuid.h
index 7ef19cc..2fc3d54 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -44,3 +44,8 @@

#define PNPID_UUID "00002a50-0000-1000-8000-00805f9b34fb"
#define DEVICE_INFORMATION_UUID "0000180a-0000-1000-8000-00805f9b34fb"
+
+#define GATT_UUID "00001801-0000-1000-8000-00805f9b34fb"
+#define IMMEDIATE_ALERT_UUID "00001802-0000-1000-8000-00805f9b34fb"
+#define LINK_LOSS_UUID "00001803-0000-1000-8000-00805f9b34fb"
+#define TX_POWER_UUID "00001804-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c


2012-05-30 12:59:54

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 01/15] sdp: Remove unused BASE_UUID definition

From: Daniel Wagner <[email protected]>

---
lib/sdp.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/lib/sdp.c b/lib/sdp.c
index de5277f..7cb930f 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -60,8 +60,6 @@
#define SDPDBG(fmt...)
#endif

-#define BASE_UUID "00000000-0000-1000-8000-00805F9B34FB"
-
static uint128_t bluetooth_base_uuid = {
.data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }
--
1.7.10.130.g36e6c


2012-05-30 12:59:57

by Daniel Wagner

[permalink] [raw]
Subject: [PATCH v2 04/15] deviceinfo: Move UUID defintion to core

From: Daniel Wagner <[email protected]>

---
deviceinfo/deviceinfo.c | 4 ++--
deviceinfo/manager.c | 4 ++--
src/uuid.h | 3 +++
3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/deviceinfo/deviceinfo.c b/deviceinfo/deviceinfo.c
index 5dd9293..410b8ff 100644
--- a/deviceinfo/deviceinfo.c
+++ b/deviceinfo/deviceinfo.c
@@ -27,6 +27,8 @@
#include <glib.h>
#include <bluetooth/uuid.h>

+#include "../src/uuid.h"
+
#include "adapter.h"
#include "device.h"
#include "gattrib.h"
@@ -37,8 +39,6 @@
#include "log.h"
#include "deviceinfo.h"

-#define PNPID_UUID "00002a50-0000-1000-8000-00805f9b34fb"
-
struct deviceinfo {
struct btd_device *dev; /* Device reference */
GAttrib *attrib; /* GATT connection */
diff --git a/deviceinfo/manager.c b/deviceinfo/manager.c
index c2378c2..52fdf46 100644
--- a/deviceinfo/manager.c
+++ b/deviceinfo/manager.c
@@ -24,6 +24,8 @@
#include <errno.h>
#include <bluetooth/uuid.h>

+#include "../src/uuid.h"
+
#include "adapter.h"
#include "device.h"
#include "att.h"
@@ -32,8 +34,6 @@
#include "deviceinfo.h"
#include "manager.h"

-#define DEVICE_INFORMATION_UUID "0000180a-0000-1000-8000-00805f9b34fb"
-
static gint primary_uuid_cmp(gconstpointer a, gconstpointer b)
{
const struct gatt_primary *prim = a;
diff --git a/src/uuid.h b/src/uuid.h
index 61ea6e5..7ef19cc 100644
--- a/src/uuid.h
+++ b/src/uuid.h
@@ -41,3 +41,6 @@
#define NAP_UUID "00001116-0000-1000-8000-00805f9b34fb"
#define GN_UUID "00001117-0000-1000-8000-00805f9b34fb"
#define BNEP_SVC_UUID "0000000f-0000-1000-8000-00805f9b34fb"
+
+#define PNPID_UUID "00002a50-0000-1000-8000-00805f9b34fb"
+#define DEVICE_INFORMATION_UUID "0000180a-0000-1000-8000-00805f9b34fb"
--
1.7.10.130.g36e6c