diff options
author | Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@codecoup.pl> | 2018-01-19 17:41:27 +0100 |
---|---|---|
committer | Szymon Janc <szymon.janc@codecoup.pl> | 2018-01-23 14:43:29 +0100 |
commit | 648c0abd1fe87317bc6a2a73cab5e3cd47660a66 (patch) | |
tree | c3af286fde19fb36a290cf4b9df74efc07c129a5 /tools/btpclient.c | |
parent | fae2d03c07c112fb1815f4f857f02c9c4452a012 (diff) | |
download | bluez-648c0abd1fe87317bc6a2a73cab5e3cd47660a66.tar.gz |
tools/btpclient: Initial check of ad_proxy presence in stop adv cmd
This patch covers with fail response if no advertising proxy was
registered at command beginning.
Diffstat (limited to 'tools/btpclient.c')
-rw-r--r-- | tools/btpclient.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/tools/btpclient.c b/tools/btpclient.c index 33116ce1b..f2c79b3a3 100644 --- a/tools/btpclient.c +++ b/tools/btpclient.c @@ -1156,19 +1156,15 @@ static void btp_gap_stop_advertising(uint8_t index, const void *param, } if (!l_dbus_proxy_get_property(adapter->proxy, "Powered", "b", &prop) || - !prop || !ad.registered) + !prop || !adapter->ad_proxy || !ad.registered) goto failed; - if (adapter->ad_proxy) { - if (!l_dbus_proxy_method_call(adapter->ad_proxy, + if (!l_dbus_proxy_method_call(adapter->ad_proxy, "UnregisterAdvertisement", unreg_advertising_setup, stop_advertising_reply, - NULL, NULL)) { - status = BTP_ERROR_FAIL; - goto failed; - } - } + NULL, NULL)) + goto failed; return; |