Skip to contentSkip to conversation

AVRCP: player object path

DISCUSSION Marco Trapanese 3 participants 4 messages Jul 20, 2016 – Jul 21, 2016 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello, I'm trying to implement some function of AVRCP protocol. From here:

http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/media-api.txt

I don't understand how to retreive the |object path| of my player:

Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX

I'm not sure if it is returned from some DBus methods or I have to manually build it using the bluetooth address and the local device.

Thanks!
Marco

#1 lore raw

Hello Marco,

Quoted 11 lines · Marco Trapanese

Hello, I'm trying to implement some function of AVRCP protocol. From here:

http://git.kernel.org/cgit/bluetooth/bluez.git/tree/doc/media-api.txt

I don't understand how to retreive the |object path| of my player:

Object path [variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/playerX

I'm not sure if it is returned from some DBus methods or I have to manually build it using the bluetooth address and the local device.

This is something I'm currently trying to get my head around.

There appears to be a dbus.INTROSPECTABLE_IFACE interface that has an Introspect() method.

I've got an example of using it in Python at:
https://github.com/ukBaz/python-bluezero/blob/master/examples/iterate.py
In build_introspection()

You can do something similar on the command line with:
gdbus introspect --system --dest org.bluez --object-path / --recurse

Hope that helps move you forward.

Regards,
Barry

Quoted 10 lines

Thanks!
Marco

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw

Il 20/07/2016 16:39, Barry Byford ha scritto:

Quoted 6 lines

This is something I'm currently trying to get my head around.

There appears to be a dbus.INTROSPECTABLE_IFACE interface that has an Introspect() method.

Quoted 8 lines

I've got an example of using it in Python at:
https://github.com/ukBaz/python-bluezero/blob/master/examples/iterate.py
In build_introspection()

You can do something similar on the command line with:
gdbus introspect --system --dest org.bluez --object-path / --recurse

Hope that helps move you forward.

Hi Barry,
I was able to get it in this way:

Quoted 2 lines

QDBusInterface *iface = new QDBusInterface("org.bluez", "/org/bluez/hci0", "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus(), this); QString xml = iface->call("Introspect").arguments().at(0).toString();

and then I extract the attribute "name" from the second "node" tag...

#3 lore raw

Hi Marco, Barry,

Quoted 21 lines · Marco Trapanese

Il 20/07/2016 16:39, Barry Byford ha scritto:

Quoted 7 lines

This is something I'm currently trying to get my head around.

There appears to be a dbus.INTROSPECTABLE_IFACE interface that has an Introspect() method.

Quoted 8 lines

I've got an example of using it in Python at:
https://github.com/ukBaz/python-bluezero/blob/master/examples/iterate.py
In build_introspection()

You can do something similar on the command line with:
gdbus introspect --system --dest org.bluez --object-path / --recurse

Hope that helps move you forward.

Hi Barry,
I was able to get it in this way:

Quoted 6 lines
Quoted 3 lines

QDBusInterface *iface = new QDBusInterface("org.bluez", "/org/bluez/hci0", "org.freedesktop.DBus.Introspectable", QDBusConnection::systemBus(), this); QString xml = iface->call("Introspect").arguments().at(0).toString();

and then I extract the attribute "name" from the second "node" tag...

If the issue under discussion here is how to enumerate these objects you should use ObjectManager to do that, you can check how tools/bluetooth-player.c uses our gdbus client helpers to discover the objects, it should be very straight forward if the D-Bus library has support for ObjectManager built-in otherwise you may need to do it yourselves.

Signature · 1 line
Luiz Augusto von Dentz