OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88daad9
)
neard: Fix reading local OOB data when adapter is not powered
author
Szymon Janc
<szymon.janc@tieto.com>
Mon, 6 May 2013 13:20:52 +0000
(15:20 +0200)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Wed, 8 May 2013 07:12:23 +0000
(10:12 +0300)
Read Local OOB data only if adapter is powered. This fix replying with
error instead of CPS set to inactive when adapter is not powered.
plugins/neard.c
patch
|
blob
|
history
diff --git
a/plugins/neard.c
b/plugins/neard.c
index
dfe4f23
..
e4a4d71
100644
(file)
--- a/
plugins/neard.c
+++ b/
plugins/neard.c
@@
-790,7
+790,7
@@
static DBusMessage *request_oob(DBusConnection *conn, DBusMessage *msg,
store_params(adapter, device, &remote);
- if (!remote.hash) {
+ if (!remote.hash
|| !btd_adapter_get_powered(adapter)
) {
free_oob_params(&remote);
return create_request_oob_reply(adapter, NULL, NULL, msg);
}
@@
-798,6
+798,9
@@
static DBusMessage *request_oob(DBusConnection *conn, DBusMessage *msg,
read_local:
free_oob_params(&remote);
+ if (!btd_adapter_get_powered(adapter))
+ return create_request_oob_reply(adapter, NULL, NULL, msg);
+
err = btd_adapter_read_local_oob_data(adapter);
if (err < 0)
return error_reply(msg, -err);