1

I'm trying to implement some function of AVRCP protocol. Here the documentation:

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

what I don't understand is 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.

Mark
  • 4,338
  • 7
  • 58
  • 120

1 Answers1

1

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.

The former. You(the application I assume) do not need build this object path, the path would return by some DBus methods.

Here the object meaning:

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

[variable prefix] was null basically.
{hci0,hci1,...} was which of your Bluetooth chip, basically it should be hci0.
/dev_XX_XX_XX_XX_XX_XX remote device mac address.
/playerX which player of your target.

You do not need pay much attention of the object path's material, it just a string actually(combined by stack according to specific format)

You may refer:

Properties

      boolean Connected [readonly]

      object Player [readonly, optional]

          Addressed Player object path.
Guo Xingmin
  • 1,013
  • 1
  • 7
  • 7
  • The `Player` property seems to be "self-referential" because to get the value of this property I need to set the object path in the request to the same path I'm trying to find. – Mark Jul 21 '16 at 16:57
  • OK, let me know if you met any other Bluetooth issues. – Guo Xingmin Jul 22 '16 at 05:21
  • Well, it's still not very clear how to get this path. You said a DBus method should return it and of course the `Player` property cannot be used for the reason above. So, how to get it without build it manually? – Mark Jul 23 '16 at 07:27
  • I am not test this(since I am using different stack) but if you can see the line of #121 "Addressed Player object path." and line #252 "Device object path." "[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/" should be the value of line 250 and playerx should be the value of 254. – Guo Xingmin Jul 25 '16 at 03:10
  • Perhaps I don't understand, I apologize. To access the properties at lines #250/254 you need to already know the playerx and object path, because you have to select the path at line #129 which requires... them! Or maybe there is a way to read a property without specifiying the object path? – Mark Jul 25 '16 at 04:45
  • 1
    Never mind. let's from the start of the device. first, we can get the value of "[variable prefix]/{hci0,hci1,...}/dev_XX_XX_XX_XX_XX_XX/" from the create device interface if we are master(or from signal if we are slave), then once we got the above object path, we can get the line 121 i.e. player path right? since this interface only need device object path we just got. then, we can operate "MediaPlayer1 hierarchy" at line124. generally the calling steps would be like "dbusname->objpath ->interface->method" . – Guo Xingmin Jul 25 '16 at 07:18
  • Thank you very much for your explanation. I'm going to write some code based upon your suggestions – Mark Jul 25 '16 at 10:21