2012-12-14 09:12:55

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/network-api.txt | 4 ++--
profiles/network/connection.c | 2 +-
profiles/network/server.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/doc/network-api.txt b/doc/network-api.txt
index b640b9a..1c9d889 100644
--- a/doc/network-api.txt
+++ b/doc/network-api.txt
@@ -8,7 +8,7 @@ Network hierarchy
=================

Service org.bluez
-Interface org.bluez.Network
+Interface org.bluez.Network1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Properties boolean Connected [readonly]
@@ -28,7 +28,7 @@ Network server hierarchy
========================

Service org.bluez
-Interface org.bluez.NetworkServer
+Interface org.bluez.NetworkServer1
Object path /org/bluez/{hci0,hci1,...}

Methods void Register(string uuid, string bridge)
diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index 3157e31..5fa3e1b 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -49,7 +49,7 @@
#include "manager.h"
#include "connection.h"

-#define NETWORK_PEER_INTERFACE "org.bluez.Network"
+#define NETWORK_PEER_INTERFACE "org.bluez.Network1"
#define CON_SETUP_RETRIES 3
#define CON_SETUP_TO 9

diff --git a/profiles/network/server.c b/profiles/network/server.c
index e32e51d..2869c28 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -51,7 +51,7 @@
#include "common.h"
#include "server.h"

-#define NETWORK_SERVER_INTERFACE "org.bluez.NetworkServer"
+#define NETWORK_SERVER_INTERFACE "org.bluez.NetworkServer1"
#define SETUP_TIMEOUT 1

/* Pending Authorization */
--
1.7.11.7



2012-12-14 10:37:45

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces

Hi,

On Fri, Dec 14, 2012 at 12:18 PM, Santiago Carot <[email protected]> wrote:
> Hi,
>
> 2012/12/14 Johan Hedberg <[email protected]>:
>> Hi Luiz,
>>
>> On Fri, Dec 14, 2012, Luiz Augusto von Dentz wrote:
>>> ---
>>> doc/network-api.txt | 4 ++--
>>> profiles/network/connection.c | 2 +-
>>> profiles/network/server.c | 2 +-
>>> 3 files changed, 4 insertions(+), 4 deletions(-)
>>
>> All patches in this set have been applied. Thanks.
>>
>
> just a few comments, Wouldn't it have been better to add an
> API_VERSION macro and stick it besides each interface?, I haven't gone
> deept through each patch but it just looks like you are only adding
> the version number to each interface. In the future it could be
> annoying to have to go through all the source code to increment just
> the version number.

Each interface is independent, so if you break lets say
org.bluez.Network1 API you just change it not everything.

--
Luiz Augusto von Dentz

2012-12-14 10:18:29

by Santiago Carot

[permalink] [raw]
Subject: Re: [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces

Hi,

2012/12/14 Johan Hedberg <[email protected]>:
> Hi Luiz,
>
> On Fri, Dec 14, 2012, Luiz Augusto von Dentz wrote:
>> ---
>> doc/network-api.txt | 4 ++--
>> profiles/network/connection.c | 2 +-
>> profiles/network/server.c | 2 +-
>> 3 files changed, 4 insertions(+), 4 deletions(-)
>
> All patches in this set have been applied. Thanks.
>

just a few comments, Wouldn't it have been better to add an
API_VERSION macro and stick it besides each interface?, I haven't gone
deept through each patch but it just looks like you are only adding
the version number to each interface. In the future it could be
annoying to have to go through all the source code to increment just
the version number.

Regards.

2012-12-14 09:25:15

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH BlueZ 01/13] network: Append version to Network and NetworkServer interfaces

Hi Luiz,

On Fri, Dec 14, 2012, Luiz Augusto von Dentz wrote:
> ---
> doc/network-api.txt | 4 ++--
> profiles/network/connection.c | 2 +-
> profiles/network/server.c | 2 +-
> 3 files changed, 4 insertions(+), 4 deletions(-)

All patches in this set have been applied. Thanks.

Johan

2012-12-14 09:13:07

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 13/13] core: Remove org.bluez.Watcher from bluetooth.conf

From: Luiz Augusto von Dentz <[email protected]>

This interface is not used anywhere
---
src/bluetooth.conf | 1 -
1 file changed, 1 deletion(-)

diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index e5da643..0495200 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -13,7 +13,6 @@
<allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
- <allow send_interface="org.bluez.Watcher"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface="org.bluez.Profile1"/>
--
1.7.11.7


2012-12-14 09:13:06

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 12/13] core: Remove another left over of HFP removal

From: Luiz Augusto von Dentz <[email protected]>

---
src/bluetooth.conf | 1 -
1 file changed, 1 deletion(-)

diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 8dfdc77..e5da643 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -11,7 +11,6 @@
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent1"/>
- <allow send_interface="org.bluez.HandsfreeAgent"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.Watcher"/>
--
1.7.11.7


2012-12-14 09:13:05

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 11/13] sap: Append version to SimAccess interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/sap-api.txt | 2 +-
profiles/sap/sap-dummy.c | 2 +-
profiles/sap/server.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/sap-api.txt b/doc/sap-api.txt
index 92bdd9e..6bd8034 100644
--- a/doc/sap-api.txt
+++ b/doc/sap-api.txt
@@ -8,7 +8,7 @@ Sim Access Profile hierarchy
============================

Service org.bluez
-Interface org.bluez.SimAccess
+Interface org.bluez.SimAccess1
Object path [variable prefix]/{hci0,hci1,...}

Methods void Disconnect()
diff --git a/profiles/sap/sap-dummy.c b/profiles/sap/sap-dummy.c
index 6c717dc..ffaf847 100644
--- a/profiles/sap/sap-dummy.c
+++ b/profiles/sap/sap-dummy.c
@@ -34,7 +34,7 @@
#include "log.h"
#include "sap.h"

-#define SAP_DUMMY_IFACE "org.bluez.SimAccessTest"
+#define SAP_DUMMY_IFACE "org.bluez.SimAccessTest1"
#define SAP_DUMMY_PATH "/org/bluez/test"

enum {
diff --git a/profiles/sap/server.c b/profiles/sap/server.c
index d075e40..01caa33 100644
--- a/profiles/sap/server.c
+++ b/profiles/sap/server.c
@@ -43,7 +43,7 @@
#include "sap.h"
#include "server.h"

-#define SAP_SERVER_INTERFACE "org.bluez.SimAccess"
+#define SAP_SERVER_INTERFACE "org.bluez.SimAccess1"
#define SAP_SERVER_CHANNEL 8

#define PADDING4(x) ((4 - ((x) & 0x03)) & 0x03)
--
1.7.11.7


2012-12-14 09:13:04

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 10/13] proximity: Append version to Proximity interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/proximity-api.txt | 4 ++--
profiles/proximity/monitor.c | 2 +-
profiles/proximity/reporter.h | 2 +-
test/test-proximity | 15 +++++++++------
4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/doc/proximity-api.txt b/doc/proximity-api.txt
index b68a4fe..4719428 100644
--- a/doc/proximity-api.txt
+++ b/doc/proximity-api.txt
@@ -8,7 +8,7 @@ Proximity Monitor hierarchy
===========================

Service org.bluez
-Interface org.bluez.ProximityMonitor
+Interface org.bluez.ProximityMonitor1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Properties string SignalLevel [readonly]
@@ -40,7 +40,7 @@ Shared service used by Proximity Path Loss and Find Me. Allows per device
alert level handling.

Service org.bluez
-Interface org.bluez.ProximityReporter
+Interface org.bluez.ProximityReporter1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Properties string ImmediateAlertLevel [readonly]
diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c
index 023de72..d9ed3ff 100644
--- a/profiles/proximity/monitor.c
+++ b/profiles/proximity/monitor.c
@@ -50,7 +50,7 @@
#include "monitor.h"
#include "textfile.h"

-#define PROXIMITY_INTERFACE "org.bluez.ProximityMonitor"
+#define PROXIMITY_INTERFACE "org.bluez.ProximityMonitor1"

#define ALERT_LEVEL_CHR_UUID 0x2A06
#define POWER_LEVEL_CHR_UUID 0x2A07
diff --git a/profiles/proximity/reporter.h b/profiles/proximity/reporter.h
index 480c668..6a7066d 100644
--- a/profiles/proximity/reporter.h
+++ b/profiles/proximity/reporter.h
@@ -22,7 +22,7 @@
*
*/

-#define PROXIMITY_REPORTER_INTERFACE "org.bluez.ProximityReporter"
+#define PROXIMITY_REPORTER_INTERFACE "org.bluez.ProximityReporter1"

#define IMMEDIATE_ALERT_SVC_UUID 0x1802
#define LINK_LOSS_SVC_UUID 0x1803
diff --git a/test/test-proximity b/test/test-proximity
index d6862de..0cbf315 100755
--- a/test/test-proximity
+++ b/test/test-proximity
@@ -14,8 +14,11 @@ import dbus.mainloop.glib
from optparse import OptionParser, make_option
import bluezutils

+BUS_NAME = 'org.bluez'
+PROXIMITY_MONITOR_INTERFACE = 'org.bluez.ProxymityMonitor1'
+
def properties_changed(interface, changed, invalidated):
- if interface != "org.bluez.ProximityMonitor":
+ if interface != PROXIMITY_MONITOR_INTERFACE:
return

for name, value in changed.iteritems():
@@ -45,19 +48,19 @@ if __name__ == "__main__":
device = bluezutils.find_device(options.address, options.dev_id)
device_path = device.object_path

- bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+ bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME,
path=device_path,
dbus_interface="org.freedesktop.DBus.Properties",
signal_name="PropertiesChanged")

- proximity = dbus.Interface(bus.get_object("org.bluez",
- device_path), "org.bluez.ProximityMonitor")
+ proximity = dbus.Interface(bus.get_object(BUS_NAME, device_path),
+ PROXIMITY_MONITOR_INTERFACE)

- device_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+ device_prop = dbus.Interface(bus.get_object(BUS_NAME, device_path),
"org.freedesktop.DBus.Properties")

print("Proximity SetProperty('%s', '%s')" % (args[0], args[1]))
- device_prop.Set("org.bluez.ProximityMonitor", args[0], args[1])
+ device_prop.Set(PROXIMITY_MONITOR_INTERFACE, args[0], args[1])

mainloop = gobject.MainLoop()
mainloop.run()
--
1.7.11.7


2012-12-14 09:13:03

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 09/13] dbusoob: Append version to OutOfBand interface

From: Luiz Augusto von Dentz <[email protected]>

---
doc/oob-api.txt | 2 +-
plugins/dbusoob.c | 2 +-
test/test-oob | 11 +++++++----
3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/doc/oob-api.txt b/doc/oob-api.txt
index d54f612..a196442 100644
--- a/doc/oob-api.txt
+++ b/doc/oob-api.txt
@@ -11,7 +11,7 @@ Out Of Band hierarchy
=====================

Service org.bluez
-Interface org.bluez.OutOfBand
+Interface org.bluez.OutOfBand1
Object path [variable prefix]/{hci0,hci1,...}

Methods dict ReadLocalData()
diff --git a/plugins/dbusoob.c b/plugins/dbusoob.c
index 77563f1..887a610 100644
--- a/plugins/dbusoob.c
+++ b/plugins/dbusoob.c
@@ -45,7 +45,7 @@
#include "error.h"
#include "storage.h"

-#define OOB_INTERFACE "org.bluez.OutOfBand"
+#define OOB_INTERFACE "org.bluez.OutOfBand1"

struct oob_data {
char *addr;
diff --git a/test/test-oob b/test/test-oob
index 87c558f..681540b 100755
--- a/test/test-oob
+++ b/test/test-oob
@@ -7,6 +7,9 @@ import gobject
import dbus.mainloop.glib
import bluezutils

+BUS_NAME = 'org.bluez'
+OOB_INTERFACE = 'org.bluez.OutOfBand1'
+
def create_device_reply(device):
print("Pairing succeed!")
mainloop.quit()
@@ -61,10 +64,10 @@ if __name__ == '__main__':
print()
print("Reading local Out of Band data...")

- oob_adapter0 = dbus.Interface(bus.get_object("org.bluez",
- adapter0_path), "org.bluez.OutOfBand")
- oob_adapter1 = dbus.Interface(bus.get_object("org.bluez",
- adapter1_path), "org.bluez.OutOfBand")
+ oob_adapter0 = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter0_path), OOB_INTERFACE)
+ oob_adapter1 = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter1_path), OOB_INTERFACE)

oob0 = oob_adapter0.ReadLocalData()
oob1 = oob_adapter1.ReadLocalData()
--
1.7.11.7


2012-12-14 09:13:02

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 08/13] health: Append version to Health interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/health-api.txt | 6 +++---
profiles/health/hdp_types.h | 6 +++---
test/test-health | 25 +++++++++++++++----------
test/test-health-sink | 22 ++++++++++++++--------
4 files changed, 35 insertions(+), 24 deletions(-)

diff --git a/doc/health-api.txt b/doc/health-api.txt
index 7639cd2..193fbce 100644
--- a/doc/health-api.txt
+++ b/doc/health-api.txt
@@ -9,7 +9,7 @@ HealthManager hierarchy
=======================

Service org.bluez
-Interface org.bluez.HealthManager
+Interface org.bluez.HealthManager1
Object path /org/bluez/

Methods object CreateApplication(dict config)
@@ -54,7 +54,7 @@ HealthDevice hierarchy
======================

Service org.bluez
-Interface org.bluez.HealthDevice
+Interface org.bluez.HealthDevice1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Methods boolean Echo()
@@ -112,7 +112,7 @@ HealthChannel hierarchy
=======================

Service org.bluez
-Interface org.bluez.HealthChannel
+Interface org.bluez.HealthChannel1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/chanZZZ

Only the process that created the data channel or the creator of the
diff --git a/profiles/health/hdp_types.h b/profiles/health/hdp_types.h
index 7e4d00f..aff16df 100644
--- a/profiles/health/hdp_types.h
+++ b/profiles/health/hdp_types.h
@@ -25,9 +25,9 @@

#define MANAGER_PATH "/org/bluez"

-#define HEALTH_MANAGER "org.bluez.HealthManager"
-#define HEALTH_DEVICE "org.bluez.HealthDevice"
-#define HEALTH_CHANNEL "org.bluez.HealthChannel"
+#define HEALTH_MANAGER "org.bluez.HealthManager1"
+#define HEALTH_DEVICE "org.bluez.HealthDevice1"
+#define HEALTH_CHANNEL "org.bluez.HealthChannel1"

#define HDP_VERSION 0x0100

diff --git a/test/test-health b/test/test-health
index e0f95a6..666972c 100755
--- a/test/test-health
+++ b/test/test-health
@@ -9,6 +9,12 @@ import gobject
from dbus.mainloop.glib import DBusGMainLoop
import sys

+BUS_NAME = 'org.bluez'
+PATH = '/org/bluez'
+ADAPTER_INTERFACE = 'org.bluez.Adapter1'
+HEALTH_MANAGER_INTERFACE = 'org.bluez.HealthManager1'
+HEALTH_DEVICE_INTERFACE = 'org.bluez.HealthDevice1'
+
DBusGMainLoop(set_as_default=True)
loop = gobject.MainLoop()

@@ -33,8 +39,8 @@ def sig_received(*args, **kwargs):


def enter_mainloop():
- bus.add_signal_receiver(sig_received, bus_name="org.bluez",
- dbus_interface = "org.bluez.HealthDevice",
+ bus.add_signal_receiver(sig_received, bus_name=BUS_NAME,
+ dbus_interface=HEALTH_DEVICE_INTERFACE,
path_keyword="path",
member_keyword="member",
interface_keyword="interface")
@@ -49,8 +55,8 @@ def enter_mainloop():
finally:
print("Exiting, bye")

-hdp_manager = dbus.Interface(bus.get_object("org.bluez", "/org/bluez"),
- "org.bluez.HealthManager")
+hdp_manager = dbus.Interface(bus.get_object(BUS_NAME, PATH),
+ HEALTH_MANAGER_INTERFACE)

role = None
while role == None:
@@ -131,14 +137,14 @@ if not con:
enter_mainloop()
sys.exit()

-manager = dbus.Interface(bus.get_object("org.bluez", "/"),
+manager = dbus.Interface(bus.get_object(BUS_NAME, "/"),
"org.freedesktop.DBus.ObjectManager")

objects = manager.GetManagedObjects()
adapters = []

for path, ifaces in objects.iteritems():
- if ifaces.has_key("org.bluez.Adapter1"):
+ if ifaces.has_key(ADAPTER_INTERFACE):
adapters.append(path)

i = 1
@@ -159,8 +165,7 @@ while select == None:
except KeyboardInterrupt:
sys.exit()

-adapter = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.Adapter1")
+adapter = dbus.Interface(bus.get_object(BUS_NAME, select), ADAPTER_INTERFACE)

devices = adapter.GetProperties()["Devices"]

@@ -186,8 +191,8 @@ while select == None:
except KeyboardInterrupt:
sys.exit()

-device = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.HealthDevice")
+device = dbus.Interface(bus.get_object(BUS_NAME, select),
+ HEALTH_DEVICE_INTERFACE)

echo = None
while echo == None:
diff --git a/test/test-health-sink b/test/test-health-sink
index a14f16b..32afd71 100755
--- a/test/test-health-sink
+++ b/test/test-health-sink
@@ -9,26 +9,32 @@ import gobject
from dbus.mainloop.glib import DBusGMainLoop
import sys

+BUS_NAME = 'org.bluez'
+PATH = '/org/bluez'
+ADAPTER_INTERFACE = 'org.bluez.Adapter1'
+HEALTH_MANAGER_INTERFACE = 'org.bluez.HealthManager1'
+HEALTH_DEVICE_INTERFACE = 'org.bluez.HealthDevice1'
+
DBusGMainLoop(set_as_default=True)
loop = gobject.MainLoop()

bus = dbus.SystemBus()

-hdp_manager = dbus.Interface(bus.get_object("org.bluez", "/org/bluez"),
- "org.bluez.HealthManager")
+hdp_manager = dbus.Interface(bus.get_object(BUS_NAME, PATH),
+ HEALTH_MANAGER_INTERFACE)
app_path = hdp_manager.CreateApplication({"DataType": dbus.types.UInt16(4103),
"Role": "sink"})

print(app_path)

-manager = dbus.Interface(bus.get_object("org.bluez", "/"),
+manager = dbus.Interface(bus.get_object(BUS_NAME, "/"),
"org.freedesktop.DBus.ObjectManager")

objects = manager.GetManagedObjects()
adapters = []

for path, ifaces in objects.iteritems():
- if ifaces.has_key("org.bluez.Adapter1"):
+ if ifaces.has_key(ADAPTER_INTERFACE):
adapters.append(path)

i = 1
@@ -49,8 +55,8 @@ while select == None:
except KeyboardInterrupt:
sys.exit()

-adapter = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.Adapter1")
+adapter = dbus.Interface(bus.get_object(BUS_NAME, select),
+ ADAPTER_INTERFACE)

devices = adapter.GetProperties()["Devices"]

@@ -77,8 +83,8 @@ while select == None:
sys.exit()

print("Connecting to %s" % (select))
-device = dbus.Interface(bus.get_object("org.bluez", select),
- "org.bluez.HealthDevice")
+device = dbus.Interface(bus.get_object(BUS_NAME, select),
+ HEALTH_DEVICE_INTERFACE)

chan = device.CreateChannel(app_path, "Any")

--
1.7.11.7


2012-12-14 09:13:01

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 07/13] core: Append version to Agent interface

From: Luiz Augusto von Dentz <[email protected]>

---
doc/agent-api.txt | 2 +-
src/agent.c | 19 ++++++++++---------
src/bluetooth.conf | 2 +-
test/simple-agent | 24 ++++++++++++++----------
4 files changed, 26 insertions(+), 21 deletions(-)

diff --git a/doc/agent-api.txt b/doc/agent-api.txt
index caed7f8..a1a8969 100644
--- a/doc/agent-api.txt
+++ b/doc/agent-api.txt
@@ -9,7 +9,7 @@ Agent hierarchy
===============

Service unique name
-Interface org.bluez.Agent
+Interface org.bluez.Agent1
Object path freely definable

Methods void Release()
diff --git a/src/agent.c b/src/agent.c
index ec183c0..b36738d 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -48,6 +48,7 @@
#include "agent.h"

#define REQUEST_TIMEOUT (60 * 1000) /* 60 seconds */
+#define AGENT_INTERFACE "org.bluez.Agent1"

typedef enum {
AGENT_REQUEST_PASSKEY,
@@ -91,7 +92,7 @@ static void agent_release(struct agent *agent)
agent_cancel(agent);

message = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "Release");
+ AGENT_INTERFACE, "Release");
if (message == NULL) {
error("Couldn't allocate D-Bus message");
return;
@@ -108,7 +109,7 @@ static int send_cancel_request(struct agent_request *req)
req->agent->path);

message = dbus_message_new_method_call(req->agent->name, req->agent->path,
- "org.bluez.Agent", "Cancel");
+ AGENT_INTERFACE, "Cancel");
if (message == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -301,7 +302,7 @@ static int agent_call_authorize_service(struct agent_request *req,
struct agent *agent = req->agent;

req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "AuthorizeService");
+ AGENT_INTERFACE, "AuthorizeService");
if (!req->msg) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -413,7 +414,7 @@ static int pincode_request_new(struct agent_request *req, const char *device_pat
secure pin. */

req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestPinCode");
+ AGENT_INTERFACE, "RequestPinCode");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -507,7 +508,7 @@ static int passkey_request_new(struct agent_request *req,
struct agent *agent = req->agent;

req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestPasskey");
+ AGENT_INTERFACE, "RequestPasskey");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -563,7 +564,7 @@ static int confirmation_request_new(struct agent_request *req,
struct agent *agent = req->agent;

req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestConfirmation");
+ AGENT_INTERFACE, "RequestConfirmation");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -621,7 +622,7 @@ static int authorization_request_new(struct agent_request *req,
struct agent *agent = req->agent;

req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "RequestAuthorization");
+ AGENT_INTERFACE, "RequestAuthorization");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
@@ -679,7 +680,7 @@ int agent_display_passkey(struct agent *agent, struct btd_device *device,
const gchar *dev_path = device_get_path(device);

message = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "DisplayPasskey");
+ AGENT_INTERFACE, "DisplayPasskey");
if (!message) {
error("Couldn't allocate D-Bus message");
return -1;
@@ -754,7 +755,7 @@ static int display_pincode_request_new(struct agent_request *req,
struct agent *agent = req->agent;

req->msg = dbus_message_new_method_call(agent->name, agent->path,
- "org.bluez.Agent", "DisplayPinCode");
+ AGENT_INTERFACE, "DisplayPinCode");
if (req->msg == NULL) {
error("Couldn't allocate D-Bus message");
return -ENOMEM;
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 0e45935..8dfdc77 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -10,7 +10,7 @@
<policy user="root">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
- <allow send_interface="org.bluez.Agent"/>
+ <allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.HandsfreeAgent"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
diff --git a/test/simple-agent b/test/simple-agent
index 15f2a32..312202a 100755
--- a/test/simple-agent
+++ b/test/simple-agent
@@ -11,6 +11,10 @@ import dbus.mainloop.glib
from optparse import OptionParser
import bluezutils

+BUS_NAME = 'org.bluez'
+AGENT_INTERFACE = 'org.bluez.Agent1'
+AGENT_PATH = "/test/agent"
+
bus = None
device_obj = None
dev_path = None
@@ -40,14 +44,14 @@ class Agent(dbus.service.Object):
def set_exit_on_release(self, exit_on_release):
self.exit_on_release = exit_on_release

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="", out_signature="")
def Release(self):
print("Release")
if self.exit_on_release:
mainloop.quit()

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="os", out_signature="")
def AuthorizeService(self, device, uuid):
print("AuthorizeService (%s, %s)" % (device, uuid))
@@ -56,14 +60,14 @@ class Agent(dbus.service.Object):
return
raise Rejected("Connection rejected by user")

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="o", out_signature="s")
def RequestPinCode(self, device):
print("RequestPinCode (%s)" % (device))
set_trusted(device)
return ask("Enter PIN Code: ")

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="o", out_signature="u")
def RequestPasskey(self, device):
print("RequestPasskey (%s)" % (device))
@@ -71,18 +75,18 @@ class Agent(dbus.service.Object):
passkey = ask("Enter passkey: ")
return dbus.UInt32(passkey)

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="ouq", out_signature="")
def DisplayPasskey(self, device, passkey, entered):
print("DisplayPasskey (%s, %06u entered %u)" %
(device, passkey, entered))

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="os", out_signature="")
def DisplayPinCode(self, device, pincode):
print("DisplayPinCode (%s, %s)" % (device, pincode))

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="ou", out_signature="")
def RequestConfirmation(self, device, passkey):
print("RequestConfirmation (%s, %06d)" % (device, passkey))
@@ -92,7 +96,7 @@ class Agent(dbus.service.Object):
return
raise Rejected("Passkey doesn't match")

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="o", out_signature="")
def RequestAuthorization(self, device):
print("RequestAuthorization (%s)" % (device))
@@ -101,7 +105,7 @@ class Agent(dbus.service.Object):
return
raise Rejected("Pairing rejected")

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="s", out_signature="")
def ConfirmModeChange(self, mode):
print("ConfirmModeChange (%s)" % (mode))
@@ -110,7 +114,7 @@ class Agent(dbus.service.Object):
return
raise Rejected("Mode change by user")

- @dbus.service.method("org.bluez.Agent",
+ @dbus.service.method(AGENT_INTERFACE,
in_signature="", out_signature="")
def Cancel(self):
print("Cancel")
--
1.7.11.7


2012-12-14 09:13:00

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 06/13] alert: Append version to Alert interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/alert-api.txt | 4 ++--
profiles/alert/server.c | 4 ++--
src/bluetooth.conf | 2 +-
test/test-alert | 4 ++--
4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/alert-api.txt b/doc/alert-api.txt
index bcaaaf3..65c065e 100644
--- a/doc/alert-api.txt
+++ b/doc/alert-api.txt
@@ -19,7 +19,7 @@ Alert hierarchy
===============

Service org.bluez
-Interface org.bluez.Alert
+Interface org.bluez.Alert1
Object path /org/bluez

Methods void RegisterAlert(string category, object agent)
@@ -79,7 +79,7 @@ Alert Agent hierarchy
=====================

Service org.bluez
-Interface org.bluez.AlertAgent
+Interface org.bluez.AlertAgent1
Object path freely definable

Methods void MuteOnce()
diff --git a/profiles/alert/server.c b/profiles/alert/server.c
index 20eb5fc..2e8c452 100644
--- a/profiles/alert/server.c
+++ b/profiles/alert/server.c
@@ -63,8 +63,8 @@
#define SUPP_UNREAD_ALERT_CAT_CHR_UUID 0x2A48

#define ALERT_OBJECT_PATH "/org/bluez"
-#define ALERT_INTERFACE "org.bluez.Alert"
-#define ALERT_AGENT_INTERFACE "org.bluez.AlertAgent"
+#define ALERT_INTERFACE "org.bluez.Alert1"
+#define ALERT_AGENT_INTERFACE "org.bluez.AlertAgent1"

/* Maximum length for "Text String Information" */
#define NEW_ALERT_MAX_INFO_SIZE 18
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 5750f49..0e45935 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -16,7 +16,7 @@
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.Watcher"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
- <allow send_interface="org.bluez.AlertAgent"/>
+ <allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
diff --git a/test/test-alert b/test/test-alert
index 1e241a3..066e537 100755
--- a/test/test-alert
+++ b/test/test-alert
@@ -9,8 +9,8 @@ import sys
import os

BUS_NAME = 'org.bluez'
-ALERT_INTERFACE = 'org.bluez.Alert'
-ALERT_AGENT_INTERFACE = 'org.bluez.AlertAgent'
+ALERT_INTERFACE = 'org.bluez.Alert1'
+ALERT_AGENT_INTERFACE = 'org.bluez.AlertAgent1'
BLUEZ_OBJECT_PATH = '/org/bluez'
TEST_OBJECT_PATH = '/org/bluez/test'

--
1.7.11.7


2012-12-14 09:12:59

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 05/13] thermometer: Append version to Thermometer interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/thermometer-api.txt | 6 +++---
profiles/thermometer/thermometer.c | 6 +++---
src/bluetooth.conf | 2 +-
test/test-thermometer | 15 ++++++++++-----
4 files changed, 17 insertions(+), 12 deletions(-)

diff --git a/doc/thermometer-api.txt b/doc/thermometer-api.txt
index cab115f..c7c8a5d 100644
--- a/doc/thermometer-api.txt
+++ b/doc/thermometer-api.txt
@@ -7,7 +7,7 @@ Health Thermometer Manager hierarchy
====================================

Service org.bluez
-Interface org.bluez.ThermometerManager
+Interface org.bluez.ThermometerManager1
Object path [variable prefix]/{hci0,hci1,...}

Methods RegisterWatcher(object agent)
@@ -44,7 +44,7 @@ Health Thermometer Profile hierarchy
====================================

Service org.bluez
-Interface org.bluez.Thermometer
+Interface org.bluez.Thermometer1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX


@@ -77,7 +77,7 @@ Health Thermometer Watcher hierarchy
====================================

Service unique name
-Interface org.bluez.ThermometerWatcher
+Interface org.bluez.ThermometerWatcher1
Object path freely definable

Methods void MeasurementReceived(dict measurement)
diff --git a/profiles/thermometer/thermometer.c b/profiles/thermometer/thermometer.c
index 537db99..15db33e 100644
--- a/profiles/thermometer/thermometer.c
+++ b/profiles/thermometer/thermometer.c
@@ -42,9 +42,9 @@
#include "attrib/gatt.h"
#include "thermometer.h"

-#define THERMOMETER_INTERFACE "org.bluez.Thermometer"
-#define THERMOMETER_MANAGER_INTERFACE "org.bluez.ThermometerManager"
-#define THERMOMETER_WATCHER_INTERFACE "org.bluez.ThermometerWatcher"
+#define THERMOMETER_INTERFACE "org.bluez.Thermometer1"
+#define THERMOMETER_MANAGER_INTERFACE "org.bluez.ThermometerManager1"
+#define THERMOMETER_WATCHER_INTERFACE "org.bluez.ThermometerWatcher1"

/* Temperature measurement flag fields */
#define TEMP_UNITS 0x01
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 137e4e4..5750f49 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -15,7 +15,7 @@
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.Watcher"/>
- <allow send_interface="org.bluez.ThermometerWatcher"/>
+ <allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
diff --git a/test/test-thermometer b/test/test-thermometer
index fdb772f..6c143be 100755
--- a/test/test-thermometer
+++ b/test/test-thermometer
@@ -15,8 +15,13 @@ import dbus.mainloop.glib
from optparse import OptionParser, make_option
import bluezutils

+BUS_NAME = 'org.bluez'
+THERMOMETER_MANAGER_INTERFACE = 'org.bluez.ThermometerManager1'
+THERMOMETER_WATCHER_INTERFACE = 'org.bluez.ThermometerWatcher1'
+THERMOMETER_INTERFACE = 'org.bluez.Thermometer1'
+
class Watcher(dbus.service.Object):
- @dbus.service.method("org.bluez.ThermometerWatcher",
+ @dbus.service.method(THERMOMETER_WATCHER_INTERFACE,
in_signature="oa{sv}", out_signature="")
def MeasurementReceived(self, device, measure):
print("%s measurement received from %s" % (measure["Measurement"], device))
@@ -31,7 +36,7 @@ class Watcher(dbus.service.Object):
print("Type: ", measure["Type"])

def properties_changed(interface, changed, invalidated):
- if interface != "org.bluez.Thermometer":
+ if interface != THERMOMETER_INTERFACE:
return
for name, value in changed.iteritems():
print("Property %s changed: %s" % (name, str(value)))
@@ -63,15 +68,15 @@ if __name__ == "__main__":
options.adapter)
adapter_path = adapter.object_path

- thermometer_manager = dbus.Interface(bus.get_object("org.bluez",
- adapter_path), "org.bluez.ThermometerManager")
+ thermometer_manager = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter_path), THERMOMETER_MANAGER_INTERFACE)

device = bluezutils.find_device_in_objects(managed_objects,
options.address,
options.adapter)
device_path = device.object_path

- bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+ bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME,
path=device_path,
dbus_interface="org.freedesktop.DBus.Properties",
signal_name="PropertiesChanged")
--
1.7.11.7


2012-12-14 09:12:58

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 04/13] cyclingspeed: Append version to CyclingSpeed interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/cyclingspeed-api.txt | 6 +++---
profiles/cyclingspeed/cyclingspeed.c | 6 +++---
src/bluetooth.conf | 2 +-
test/test-cyclingspeed | 23 ++++++++++++++---------
4 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/doc/cyclingspeed-api.txt b/doc/cyclingspeed-api.txt
index 08e11c8..1a2dfee 100644
--- a/doc/cyclingspeed-api.txt
+++ b/doc/cyclingspeed-api.txt
@@ -7,7 +7,7 @@ Cycling Speed and Cadence Manager hierarchy
===========================================

Service org.bluez
-Interface org.bluez.CyclingSpeedManager
+Interface org.bluez.CyclingSpeedManager1
Object path [variable prefix]/{hci0,hci1,...}

Methods RegisterWatcher(object agent)
@@ -25,7 +25,7 @@ Cycling Speed and Cadence Profile hierarchy
===========================================

Service org.bluez
-Interface org.bluez.CyclingSpeed
+Interface org.bluez.CyclingSpeed1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Methods SetCumulativeWheelRevolutions(uint32 value)
@@ -68,7 +68,7 @@ Cycling Speed and Cadence Watcher hierarchy
===========================================

Service unique name
-Interface org.bluez.CyclingSpeedWatcher
+Interface org.bluez.CyclingSpeedWatcher1
Object path freely definable

Methods void MeasurementReceived(object device, dict measurement)
diff --git a/profiles/cyclingspeed/cyclingspeed.c b/profiles/cyclingspeed/cyclingspeed.c
index e236ff7..e0ba4d2 100644
--- a/profiles/cyclingspeed/cyclingspeed.c
+++ b/profiles/cyclingspeed/cyclingspeed.c
@@ -47,9 +47,9 @@

#define ATT_TIMEOUT 30

-#define CYCLINGSPEED_INTERFACE "org.bluez.CyclingSpeed"
-#define CYCLINGSPEED_MANAGER_INTERFACE "org.bluez.CyclingSpeedManager"
-#define CYCLINGSPEED_WATCHER_INTERFACE "org.bluez.CyclingSpeedWatcher"
+#define CYCLINGSPEED_INTERFACE "org.bluez.CyclingSpeed1"
+#define CYCLINGSPEED_MANAGER_INTERFACE "org.bluez.CyclingSpeedManager1"
+#define CYCLINGSPEED_WATCHER_INTERFACE "org.bluez.CyclingSpeedWatcher1"

#define WHEEL_REV_SUPPORT 0x01
#define CRANK_REV_SUPPORT 0x02
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 72d4248..137e4e4 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -19,7 +19,7 @@
<allow send_interface="org.bluez.AlertAgent"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
- <allow send_interface="org.bluez.CyclingSpeedWatcher"/>
+ <allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
</policy>

<policy at_console="true">
diff --git a/test/test-cyclingspeed b/test/test-cyclingspeed
index 10a16aa..533120a 100755
--- a/test/test-cyclingspeed
+++ b/test/test-cyclingspeed
@@ -14,6 +14,11 @@ import dbus.service
import dbus.mainloop.glib
from optparse import OptionParser, make_option

+BUS_NAME = 'org.bluez'
+CYCLINGSPEED_MANAGER_INTERFACE = 'org.bluez.CyclingSpeedManager1'
+CYCLINGSPEED_WATCHER_INTERFACE = 'org.bluez.CyclingSpeedWatcher1'
+CYCLINGSPEED_INTERFACE = 'org.bluez.CyclingSpeed1'
+
class MeasurementQ:
def __init__(self, wrap_v):
self._now = [None, None]
@@ -50,7 +55,7 @@ class Watcher(dbus.service.Object):
def enable_calc(self, v):
self._circumference = v

- @dbus.service.method("org.bluez.CyclingSpeedWatcher",
+ @dbus.service.method(CYCLINGSPEED_WATCHER_INTERFACE,
in_signature="oa{sv}", out_signature="")
def MeasurementReceived(self, device, measure):
print("Measurement received from %s" % device)
@@ -135,8 +140,8 @@ if __name__ == "__main__":
options.adapter)
device_path = device.object_path

- cscmanager = dbus.Interface(bus.get_object("org.bluez", adapter_path),
- "org.bluez.CyclingSpeedManager")
+ cscmanager = dbus.Interface(bus.get_object(BUS_NAME, adapter_path),
+ CYCLINGSPEED_WATCHER_INTERFACE)

watcher_path = "/test/watcher"
watcher = Watcher(bus, watcher_path)
@@ -144,18 +149,18 @@ if __name__ == "__main__":
watcher.enable_calc(options.circumference)
cscmanager.RegisterWatcher(watcher_path)

- csc = dbus.Interface(bus.get_object("org.bluez", device_path),
- "org.bluez.CyclingSpeed")
+ csc = dbus.Interface(bus.get_object(BUS_NAME, device_path),
+ CYCLINGSPEED_INTERFACE)

- bus.add_signal_receiver(properties_changed, bus_name="org.bluez",
+ bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME,
path=device_path,
dbus_interface="org.freedesktop.DBus.Properties",
signal_name="PropertiesChanged")

- device_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+ device_prop = dbus.Interface(bus.get_object(BUS_NAME, device_path),
"org.freedesktop.DBus.Properties")

- properties = device_prop.GetAll("org.bluez.CyclingSpeed")
+ properties = device_prop.GetAll(CYCLINGSPEED_INTERFACE)

if "Location" in properties:
print("Sensor location: %s" % properties["Location"])
@@ -171,7 +176,7 @@ if __name__ == "__main__":

elif args[0] == "SetLocation":
if properties["MultipleSensorLocationsSupported"]:
- device_prop.Set("org.bluez.CyclingSpeed", "Location", args[1])
+ device_prop.Set(CYCLINGSPEED_INTERFACE, "Location", args[1])
else:
print("Multiple sensor locations not supported")

--
1.7.11.7


2012-12-14 09:12:57

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 03/13] heartrate: Append version to HeartRate interfaces

From: Luiz Augusto von Dentz <[email protected]>

---
doc/heartrate-api.txt | 6 +++---
profiles/heartrate/heartrate.c | 6 +++---
src/bluetooth.conf | 2 +-
test/test-heartrate | 19 ++++++++++++-------
4 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/doc/heartrate-api.txt b/doc/heartrate-api.txt
index d1d5191..0f202bd 100644
--- a/doc/heartrate-api.txt
+++ b/doc/heartrate-api.txt
@@ -8,7 +8,7 @@ Heart Rate Manager hierarchy
============================

Service org.bluez
-Interface org.bluez.HeartRateManager
+Interface org.bluez.HeartRateManager1
Object path [variable prefix]/{hci0,hci1,...}

Methods RegisterWatcher(object agent)
@@ -25,7 +25,7 @@ Heart Rate Profile hierarchy
============================

Service org.bluez
-Interface org.bluez.HeartRate
+Interface org.bluez.HeartRate1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Methods Reset()
@@ -47,7 +47,7 @@ Heart Rate Watcher hierarchy
============================

Service unique name
-Interface org.bluez.HeartRateWatcher
+Interface org.bluez.HeartRateWatcher1
Object path freely definable

Methods void MeasurementReceived(object device, dict measurement)
diff --git a/profiles/heartrate/heartrate.c b/profiles/heartrate/heartrate.c
index 155100e..f4edf09 100644
--- a/profiles/heartrate/heartrate.c
+++ b/profiles/heartrate/heartrate.c
@@ -41,9 +41,9 @@
#include "log.h"
#include "heartrate.h"

-#define HEART_RATE_INTERFACE "org.bluez.HeartRate"
-#define HEART_RATE_MANAGER_INTERFACE "org.bluez.HeartRateManager"
-#define HEART_RATE_WATCHER_INTERFACE "org.bluez.HeartRateWatcher"
+#define HEART_RATE_INTERFACE "org.bluez.HeartRate1"
+#define HEART_RATE_MANAGER_INTERFACE "org.bluez.HeartRateManager1"
+#define HEART_RATE_WATCHER_INTERFACE "org.bluez.HeartRateWatcher1"

#define HR_VALUE_FORMAT 0x01
#define SENSOR_CONTACT_DETECTED 0x02
diff --git a/src/bluetooth.conf b/src/bluetooth.conf
index 6111fdb..72d4248 100644
--- a/src/bluetooth.conf
+++ b/src/bluetooth.conf
@@ -18,7 +18,7 @@
<allow send_interface="org.bluez.ThermometerWatcher"/>
<allow send_interface="org.bluez.AlertAgent"/>
<allow send_interface="org.bluez.Profile1"/>
- <allow send_interface="org.bluez.HeartRateWatcher"/>
+ <allow send_interface="org.bluez.HeartRateWatcher1"/>
<allow send_interface="org.bluez.CyclingSpeedWatcher"/>
</policy>

diff --git a/test/test-heartrate b/test/test-heartrate
index 47dd012..f26b3db 100755
--- a/test/test-heartrate
+++ b/test/test-heartrate
@@ -15,8 +15,13 @@ import dbus.mainloop.glib
from optparse import OptionParser, make_option
import bluezutils

+BUS_NAME = 'org.bluez'
+HEARTRATE_MANAGER_INTERFACE = 'org.bluez.HeartRateManager1'
+HEARTRATE_WATCHER_INTERFACE = 'org.bluez.HeartRateWatcher1'
+HEARTRATE_INTERFACE = 'org.bluez.HeartRate1'
+
class Watcher(dbus.service.Object):
- @dbus.service.method("org.bluez.HeartRateWatcher",
+ @dbus.service.method(HEARTRATE_WATCHER_INTERFACE,
in_signature="oa{sv}", out_signature="")
def MeasurementReceived(self, device, measure):
print("Measurement received from %s" % device)
@@ -59,8 +64,8 @@ if __name__ == "__main__":
options.adapter)
adapter_path = adapter.object_path

- heartrateManager = dbus.Interface(bus.get_object("org.bluez",
- adapter_path), "org.bluez.HeartRateManager")
+ heartrateManager = dbus.Interface(bus.get_object(BUS_NAME,
+ adapter_path), HEARTRATE_MANAGER_INTERFACE)

path = "/test/watcher"
heartrateManager.RegisterWatcher(path)
@@ -70,15 +75,15 @@ if __name__ == "__main__":
options.adapter)
device_path = device.object_path

- heartrate = dbus.Interface(bus.get_object("org.bluez",
- device_path), "org.bluez.HeartRate")
+ heartrate = dbus.Interface(bus.get_object(BUS_NAME, device_path),
+ HEARTRATE_INTERFACE)

watcher = Watcher(bus, path)

- dev_prop = dbus.Interface(bus.get_object("org.bluez", device_path),
+ dev_prop = dbus.Interface(bus.get_object(BUS_NAME, device_path),
"org.freedesktop.DBus.Properties")

- properties = dev_prop.GetAll("org.bluez.HeartRate")
+ properties = dev_prop.GetAll(HEARTRATE_INTERFACE)

if "Location" in properties:
print("Sensor location: %s" % properties["Location"])
--
1.7.11.7


2012-12-14 09:12:56

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH BlueZ 02/13] audio: Append version to Control interface

From: Luiz Augusto von Dentz <[email protected]>

---
doc/control-api.txt | 2 +-
profiles/audio/control.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/control-api.txt b/doc/control-api.txt
index 55cebe8..5fc8991 100644
--- a/doc/control-api.txt
+++ b/doc/control-api.txt
@@ -9,7 +9,7 @@ Control hierarchy
=================

Service org.bluez
-Interface org.bluez.Control
+Interface org.bluez.Control1
Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX

Methods void Play()
diff --git a/profiles/audio/control.h b/profiles/audio/control.h
index 800a151..878dd1e 100644
--- a/profiles/audio/control.h
+++ b/profiles/audio/control.h
@@ -22,7 +22,7 @@
*
*/

-#define AUDIO_CONTROL_INTERFACE "org.bluez.Control"
+#define AUDIO_CONTROL_INTERFACE "org.bluez.Control1"

struct control *control_init(struct audio_device *dev, GSList *uuids);
void control_update(struct control *control, GSList *uuids);
--
1.7.11.7