Question on correct DBus usage

Havoc Pennington hp at redhat.com
Wed May 2 08:41:42 PDT 2007


Hi,

Arne Caspari wrote:
> org.unicapimaging.UCView.UNIQUE_DEVICE_IDENTIFIER
> 

This doesn't make any sense as an interface, would you have "interface 
UNIQUE_DEVICE_IDENTIFIER" in Java? D-Bus interfaces are the same.

As a bus name, you might do something like this. I'm guessing you meant 
bus name.

> likewise, the object path would be: 
> 
> org/unicapimaging/UCView/UNIQUE_DEVICE_IDENTIFIER

There is probably no point having a unique bus name for every device, if 
you already have a unique path. The bus name is used to locate your 
process, the path is used to locate an object inside the process.

If this is confusing, it's explained in several places in different ways 
(dbus tutorial and I believe the FAQ), maybe one of these is clearer.

In general you can think:
  bus name = hostname
  unique bus name = IP address
  interface = interface (in a programming language, e.g. Java)
  object path = pointer / object reference

> The client needs to introspect the bus and find the matching interface. 

I would suggest just have an object with a ListDevices() method, which 
returns a list of the object paths of the devices.

Havoc


More information about the dbus mailing list