DBusMessage *reply;
DBG("status 0x%02x", status);
-#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
- DBG("status 0x%02x", status);
-#endif
/* Is there are no clients the discovery must have been stopped while
* discovery command was pending.
static void stop_discovery_complete(uint8_t status, uint16_t length,
const void *param, void *user_data)
{
- struct btd_adapter *adapter = user_data;
+ struct watch_client *client = user_data;
+ struct btd_adapter *adapter = client->adapter;
+ DBusMessage *reply;
DBG("status 0x%02x", status);
- if (status == MGMT_STATUS_SUCCESS) {
- adapter->discovery_type &= (~0x01);
- DBG("Discovery Type 0x%02x", adapter->discovery_type);
+ if (status != MGMT_STATUS_SUCCESS) {
+ if (client->msg) {
+ reply = btd_error_busy(client->msg);
+ g_dbus_send_message(dbus_conn, reply);
+ }
- adapter->filtered_discovery = false;
- adapter->no_scan_restart_delay = false;
- adapter->discovering = false;
- g_dbus_emit_property_changed(dbus_conn, adapter->path,
- ADAPTER_INTERFACE, "Discovering");
+ goto done;
+ }
- if (adapter->discovery_list == NULL && adapter->le_discovery_list == NULL) {
- adapter->discovery_enable = 0x00;
- trigger_passive_scanning(adapter);
- }
+ if (client->msg) {
+ reply = g_dbus_create_reply(client->msg, DBUS_TYPE_INVALID);
+ g_dbus_send_message(dbus_conn, reply);
}
+
+ adapter->discovery_type &= (~0x01);
+ DBG("Discovery Type 0x%02x", adapter->discovery_type);
+
+ adapter->filtered_discovery = false;
+ adapter->no_scan_restart_delay = false;
+ adapter->discovering = false;
+ g_dbus_emit_property_changed(dbus_conn, adapter->path,
+ ADAPTER_INTERFACE, "Discovering");
+
+ if (adapter->discovery_list == NULL && adapter->le_discovery_list == NULL) {
+ adapter->discovery_enable = 0x00;
+ trigger_passive_scanning(adapter);
+ }
+
+done:
+ discovery_remove(client);
}
static void stop_le_discovery_complete(uint8_t status, uint16_t length,
mgmt_send(adapter->mgmt, MGMT_OP_STOP_LE_DISCOVERY,
adapter->dev_id, sizeof(cp), &cp,
- stop_discovery_complete, adapter, NULL);
+ stop_discovery_complete, client, NULL);
}
#ifdef TIZEN_FEATURE_PLATFROM_SCAN_FILTER