OSDN Git Service

Add adaptername plugin
authorBastien Nocera <hadess@hadess.net>
Tue, 28 Jun 2011 09:21:24 +0000 (10:21 +0100)
committerJohan Hedberg <johan.hedberg@intel.com>
Tue, 28 Jun 2011 10:19:20 +0000 (13:19 +0300)
commitc98f635b446d0137f719612853a41e38fb43a1ff
treec4c2bb911bb0dc5fea3db6e09d5d768f2e8f86b8
parent016df2cc8faed6cf088c27a5275fd52167123c0f
Add adaptername plugin

Replacing the name setting code in src/adapter.c.

Moving the adapter naming allows us to use the /etc/machine-info [1]
pretty hostname, as implemented by hostnamed [2] in systemd.

If /etc/machine-info is not present, the adapter name stored
on disk in /var/lib/bluetooth will be used. If no adapter name
has been set yet, the default from the main.conf will be used.

We don't currently number the name of hci0 if a pretty name is
available, but we should instead number it if it happens not
to be the default adapter. As we cannot be told when the default
adapter changes, we'll behave this way for now.

Note that when an adapter name is set automatically from
the pretty hostname, changing it through the D-Bus interface
will fail.

[1]: http://0pointer.de/public/systemd-man/machine-info.html
[2]: http://www.freedesktop.org/wiki/Software/systemd/hostnamed
Makefile.am
configure.ac
plugins/adaptername.c [new file with mode: 0644]
src/adapter.c