* [PATCH 1/2] neard: Set device UUIDs from EIR @ 2014-01-18 12:42 Szymon Janc 2014-01-18 12:43 ` [PATCH 2/2] neard: Refactor request_oob function Szymon Janc 2014-01-18 13:20 ` [PATCH 1/2] neard: Set device UUIDs from EIR Johan Hedberg 0 siblings, 2 replies; 3+ messages in thread From: Szymon Janc @ 2014-01-18 12:42 UTC (permalink / raw) To: linux-bluetooth; +Cc: Szymon Janc Handle UUIDs received in EIR from neard in same way as UUIDs received on device discovery. --- plugins/neard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/neard.c b/plugins/neard.c index 35fdaeb..da6e37c 100644 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -643,7 +643,8 @@ static void store_params(struct btd_adapter *adapter, struct btd_device *device, btd_device_device_set_name(device, params->name); } - /* TODO handle UUIDs? */ + if (params->services) + device_add_eir_uuids(device, params->services); if (params->hash) { btd_adapter_add_remote_oob_data(adapter, ¶ms->address, -- 1.8.5.3 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] neard: Refactor request_oob function 2014-01-18 12:42 [PATCH 1/2] neard: Set device UUIDs from EIR Szymon Janc @ 2014-01-18 12:43 ` Szymon Janc 2014-01-18 13:20 ` [PATCH 1/2] neard: Set device UUIDs from EIR Johan Hedberg 1 sibling, 0 replies; 3+ messages in thread From: Szymon Janc @ 2014-01-18 12:43 UTC (permalink / raw) To: linux-bluetooth; +Cc: Szymon Janc This makes function flow easier to follow. --- plugins/neard.c | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/plugins/neard.c b/plugins/neard.c index da6e37c..b546750 100644 --- a/plugins/neard.c +++ b/plugins/neard.c @@ -768,42 +768,39 @@ static DBusMessage *request_oob(DBusConnection *conn, DBusMessage *msg, if (err < 0) return error_reply(msg, -err); - if (bacmp(&remote.address, BDADDR_ANY) == 0) - goto read_local; - - device = btd_adapter_get_device(adapter, &remote.address, - BDADDR_BREDR); + if (bacmp(&remote.address, BDADDR_ANY) == 0) { + if (btd_adapter_get_powered(adapter)) + goto read_local; - err = check_device(device); - if (err < 0) { - free_oob_params(&remote); + goto done; + } - if (err == -EALREADY) - return create_request_oob_reply(adapter, NULL, NULL, - msg); + device = btd_adapter_get_device(adapter, &remote.address, BDADDR_BREDR); - return error_reply(msg, -err); - } + err = check_device(device); + if (err < 0) + goto done; if (!btd_adapter_get_pairable(adapter)) { - free_oob_params(&remote); - - return error_reply(msg, ENONET); + err = -ENONET; + goto done; } store_params(adapter, device, &remote); - if (!remote.hash || !btd_adapter_get_powered(adapter)) { - free_oob_params(&remote); - return create_request_oob_reply(adapter, NULL, NULL, msg); - } + if (remote.hash && btd_adapter_get_powered(adapter)) + goto read_local; +done: + free_oob_params(&remote); + + if (err < 0 && err != -EALREADY) + return error_reply(msg, -err); + + return create_request_oob_reply(adapter, NULL, NULL, 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); -- 1.8.5.3 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] neard: Set device UUIDs from EIR 2014-01-18 12:42 [PATCH 1/2] neard: Set device UUIDs from EIR Szymon Janc 2014-01-18 12:43 ` [PATCH 2/2] neard: Refactor request_oob function Szymon Janc @ 2014-01-18 13:20 ` Johan Hedberg 1 sibling, 0 replies; 3+ messages in thread From: Johan Hedberg @ 2014-01-18 13:20 UTC (permalink / raw) To: Szymon Janc; +Cc: linux-bluetooth Hi Szymon, On Sat, Jan 18, 2014, Szymon Janc wrote: > Handle UUIDs received in EIR from neard in same way as UUIDs received > on device discovery. > --- > plugins/neard.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) Both patches have been applied. Thanks. Johan ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-01-18 13:20 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2014-01-18 12:42 [PATCH 1/2] neard: Set device UUIDs from EIR Szymon Janc 2014-01-18 12:43 ` [PATCH 2/2] neard: Refactor request_oob function Szymon Janc 2014-01-18 13:20 ` [PATCH 1/2] neard: Set device UUIDs from EIR Johan Hedberg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox