static void property_set_discoverable_timeout(
				const GDBusPropertyTable *property,
				DBusMessageIter *iter,
				GDBusPendingPropertySet id, void *user_data)
{
	struct btd_adapter *adapter = user_data;
	bool enabled;
	dbus_uint32_t value;

	dbus_message_iter_get_basic(iter, &value);

	adapter->discoverable_timeout = value;

	g_dbus_pending_property_success(id);

	store_adapter_info(adapter);

	g_dbus_emit_property_changed(dbus_conn, adapter->path,
				ADAPTER_INTERFACE, "DiscoverableTimeout");

	if (adapter->pending_settings & MGMT_SETTING_DISCOVERABLE) {
		if (adapter->current_settings & MGMT_SETTING_DISCOVERABLE)
			enabled = false;
		else
			enabled = true;
	} else {
		if (adapter->current_settings & MGMT_SETTING_DISCOVERABLE)
			enabled = true;
		else
			enabled = false;
	}

	if (enabled)
		set_discoverable(adapter, 0x01, adapter->discoverable_timeout);
}
static void property_set_discoverable_timeout(
				const GDBusPropertyTable *property,
				DBusMessageIter *iter,
				GDBusPendingPropertySet id, void *user_data)
{
	struct btd_adapter *adapter = user_data;
	bool enabled;
	dbus_uint32_t value;

	dbus_message_iter_get_basic(iter, &value);

	adapter->discoverable_timeout = value;

	g_dbus_pending_property_success(id);

	store_adapter_info(adapter);

	g_dbus_emit_property_changed(dbus_conn, adapter->path,
				ADAPTER_INTERFACE, "DiscoverableTimeout");

	if (adapter->pending_settings & MGMT_SETTING_DISCOVERABLE) {
		if (adapter->current_settings & MGMT_SETTING_DISCOVERABLE)
			enabled = false;
		else
			enabled = true;
	} else {
		if (adapter->current_settings & MGMT_SETTING_DISCOVERABLE)
			enabled = true;
		else
			enabled = false;
	}

	if (enabled)
		set_discoverable(adapter, 0x01, adapter->discoverable_timeout);
}