Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3172799ybz; Mon, 27 Apr 2020 11:15:31 -0700 (PDT) X-Google-Smtp-Source: APiQypIT2isUG5x4CaenGfyo65s73wNZX1jw4CrTAWKbCndCYV7FEOTMYpJwRo5XO2YyNniQOEY6 X-Received: by 2002:a05:6402:1684:: with SMTP id a4mr18817799edv.99.1588011331391; Mon, 27 Apr 2020 11:15:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588011331; cv=none; d=google.com; s=arc-20160816; b=Ql45DiBzWj9fSL73HpefuMn5t2JH92Wn8Whs5QBlLY5lHiLfrfKu+KT6WIOvzBkk32 Wsmga/UkCJzKyIPJf/IeWpKG7Rw5eOm0uLNa/IzmHmBMOawEteOhSJntcQJsDCS5t+B9 bjzJMad6woDAnYZYuzFo8naYcgfKNR7/mLSqpsW2tfgUpg4O5DHXR00bKp/p/lviM/5l 1A30HFcFAzPtxyBJaiKg8DAUFAeza5hB5ZVTh8Tw1s0YRsqDvfKqaQ6jT7RZH1xkYq+E YmrpJmMlKiOFZTNbAtoJURYqDE+qBuhAYms7uEXuVxeZM62sB21WYM7kB8IIJ+v4/nZ6 adoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=32QpforQFz5Jc3OPl/eOzfDH71r479in3uHmkumSGso=; b=kj9RKHanDiFQ63W48ZjQi/omBKsZ4q20kXWTXenyEUxGZdVtZ0MUg2KfWLlzb5rogF mz9wtlaWZ8CTk4Kq1I+CF7Y0C9hvrtZZy45CZD3YhxHDoCyhfSUF15yZZvmCSMHrz3/m aLb8ZMwAy35ZDjrxN2wXTwiZuoB1lxhvzTP8UAyrZF3DrhT/5gV1RGnIApL6lck4YZRd 8ZJRYEHyL7BbptjbHOiZJcL+RAIjgRY2ZdKUBtMttO+k3/LlKKidM/cvx31XkD02sW7Y LGRmFGyobBz+0DkiiqZD3xXHUT1eUUHI48EHi9MWiS4fcGze13xfaVaXspCb/1oKP9Hv 7Bsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E7AqD8Cu; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v21si190135eja.226.2020.04.27.11.15.05; Mon, 27 Apr 2020 11:15:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=E7AqD8Cu; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726456AbgD0SOx (ORCPT + 99 others); Mon, 27 Apr 2020 14:14:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:36788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbgD0SOw (ORCPT ); Mon, 27 Apr 2020 14:14:52 -0400 Received: from pali.im (pali.im [31.31.79.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1706D214AF; Mon, 27 Apr 2020 18:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588011292; bh=0LOW8UHxK43n+uKonJZnS7anP2ETCfbtmi1hwNBs6Ww=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=E7AqD8CusYLMuzL8gvT5Hv1Psgkf9KkEP+CuJVIISVRLrjlJALi+91GyI1dKpwbXf HqHsTvEDc+Er5QmGZoMBcTVBO6a8brLLKrrsE+n4F6RwWHLWT5dSD+Uq1Uofu7uZuE zbDQ/oAmMIx0rwGITSMX8KhyfHiaaGCUJKr/Sua4= Received: by pali.im (Postfix) id 37EA28A8; Mon, 27 Apr 2020 20:14:50 +0200 (CEST) Date: Mon, 27 Apr 2020 20:14:50 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Luiz Augusto von Dentz Cc: "linux-bluetooth@vger.kernel.org" Subject: Re: [PATCH] device: Return error when ConnectProfile DBus method fails (second fix) Message-ID: <20200427181450.6gpq6sy24wzr2cfc@pali> References: <20200426210247.757-1-pali@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Monday 27 April 2020 09:44:50 Luiz Augusto von Dentz wrote: > Hi Pali, > > On Sun, Apr 26, 2020 at 2:05 PM Pali Rohár wrote: > > > > This is fixup of commit 3aa815a31017e8793b030b04ef704ce85455b9aa. There is > > another place which needs to distinguish between Connect and ConnectProfile > > DBus method. > > --- > > src/device.c | 4 +++- > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > diff --git a/src/device.c b/src/device.c > > index 229579378..7b0eb256e 100644 > > --- a/src/device.c > > +++ b/src/device.c > > @@ -1861,7 +1861,9 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type > > dev->pending = create_pending_list(dev, uuid); > > if (!dev->pending) { > > if (dev->svc_refreshed) { > > - if (find_service_with_state(dev->services, > > + if (dbus_message_is_method_call(msg, DEVICE_INTERFACE, > > + "Connect") && > > + find_service_with_state(dev->services, > > BTD_SERVICE_STATE_CONNECTED)) > > Perhaps it would be better to have a helper function that checks this for us. I do not know if it helps, but I think this is the last problem which I observed with connect/disconnect profile method. > > return dbus_message_new_method_return(msg); > > else > > -- > > 2.20.1 > > > > > -- > Luiz Augusto von Dentz