Re: [Bluez-devel] DBus interface - determining whether a device exists

Johan Hedberg
2006-08-17T12:45:14Z

Hi Matthew,

On Thu, Aug 17, 2006, Matthew Garrett wrote:
> The problem isn't just in actually setting up the connections, it's in
> providing the information about available devices to other applications.
> Nowadays, the right layer for device enumeration is HAL. If I tell my
> system about a mobile phone, then the correct behaviour is for it to
> appear as a HAL object. In order for Network Manager to offer me the
> choice of connecting via my phone, the phone needs to be in HAL. So,
> somehow, at login time the phone needs to be added.
>
> There's two ways of dealing with this. The one that I prefer is that we
> make some effort to determine that the phone actually exists, and then
> add it to HAL in the same way that we would if we'd just done device
> discovery and the phone was discoverable. This needs us to have some
> mechanism for determining whether the phone actually exists. The second
> is that we store the HAL data and repopulate HAL at login time. This is
> more hacky, since we're adding information without even having made a
> token effort to determine whether the device exists or not.
>
> I guess that since we don't have any guarantees that the device exists
> at any given point in time anyway, this makes less difference and we
> should just populate HAL regardless. I suppose I'm open to that.

Maybe you could simply use the list of bonded devices to populate HAL?
You could use the ListBondings method and BondingCreated/BondingRemoved
signals for that.

Johan