diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2009-08-17 02:15:54 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2009-08-17 02:15:54 +0300 |
commit | 721e56450c28d3e6bbf2168b7fc018b28ea1cccc (patch) | |
tree | 70a19c07c9a5b7ce8f474a0c25be95ec6b3d12dc /src | |
parent | 1c74ef211fe90a98dc0ce9466d0fdfe2fbf26659 (diff) |
Fix Class of Device setting when InitiallyPowered=false
We should only try to derive the major/minor class from
adapter->wanted_cod when the adapter has been fully initialized. If the
adapter isn't initialized wanted_cod will most likely only contain service
class bits so we should instead try to get the necessary major/minor class
from the storage.
Diffstat (limited to 'src')
-rw-r--r-- | src/adapter.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/adapter.c b/src/adapter.c index 6ba5e56f..0ecf62ac 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -1878,7 +1878,7 @@ static int adapter_setup(struct btd_adapter *adapter, const char *mode) strncpy((char *) adapter->dev.name, name, MAX_NAME_LENGTH); /* Set device class */ - if (adapter->wanted_cod) { + if (adapter->initialized && adapter->wanted_cod) { cls[1] = (adapter->wanted_cod >> 8) & 0xff; cls[0] = adapter->wanted_cod & 0xff; } else if (read_local_class(&adapter->bdaddr, cls) < 0) { |