Search code examples
objectbluetoothpathdbusavrcp

DBus object path: where to find it?


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.


Solution

  • 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.