From f13b8dc1006b0ca47a0be195c992278ec76f3038 Mon Sep 17 00:00:00 2001 From: Corentin Lecouvey Date: Wed, 9 Jul 2014 14:35:00 +0200 Subject: [PATCH] [Bluetooth] stopDiscovery API fix to be compliant with TCT tests stopDiscovery API is supposed to cancel an active discovery session. If user cancels the discovery while there is no active discovery, we should NOT return an error to pass TCT tests. --- bluetooth/bluetooth_instance_capi.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluetooth/bluetooth_instance_capi.cc b/bluetooth/bluetooth_instance_capi.cc index bb0b820..4c5086a 100644 --- a/bluetooth/bluetooth_instance_capi.cc +++ b/bluetooth/bluetooth_instance_capi.cc @@ -571,7 +571,7 @@ void BluetoothInstance::HandleStopDiscovery(const picojson::value& msg) { CAPI(bt_adapter_is_discovering(&is_discovering)); if (!is_discovering) { picojson::value::object o; - o["error"] = picojson::value(static_cast(1)); + o["error"] = picojson::value(static_cast(0)); o["cmd"] = picojson::value(""); o["reply_id"] = picojson::value(callbacks_id_map_["StopDiscovery"]); callbacks_id_map_.erase("StopDiscovery"); -- 2.7.4