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
===========================================
Service org.bluez
-Interface org.bluez.CyclingSpeedManager
+Interface org.bluez.CyclingSpeedManager1
Object path [variable prefix]/{hci0,hci1,...}
Methods RegisterWatcher(object agent)
===========================================
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)
===========================================
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
#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
<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
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]
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)
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)
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"])
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")