Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp36781ybz; Tue, 28 Apr 2020 17:38:45 -0700 (PDT) X-Google-Smtp-Source: APiQypKmfZymKoBDkiOkEvdt1o2quQCrCX6LCBjqgWrTXTaO9cqnHzEMNk1AaI+EbIBuu6CpbnWW X-Received: by 2002:a17:906:82d2:: with SMTP id a18mr334446ejy.373.1588120725679; Tue, 28 Apr 2020 17:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588120725; cv=none; d=google.com; s=arc-20160816; b=NahaAZQQTvtvZxj9YCUv3eJhQP5dHeymIln1WFGDA1txzK7XqQ08p6tnFXoogPGdJw 8axQIdJztxf4CFEXLLRpL4eUX66kNzhLEMLiUsMNVEsyfQE90/JRqcQv7E9FBEtqWPsd lBYYg5LUnizX1MjNdXT9LkOKp/KvyyFrYuDs9fY4ZEycm7VCTJ8YIeNcKYEiWmNpxq/w uSrhx9jl+Y2j9SMrOGHzxHyTfEL1c+1eK+zzMgdhWJ7fXTHmMGtXy00KwdQTYjTOKMbh NdQWCl6N8ANoP8TlGMrQxfcfefTddcwcF0snSgDj9iU6Us1hH+J34ZcA53OA+fyPPumC K3mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AXbjiSGR70Rs7XnaC6XEPPYDg/3o7H6rfC5H6HvRnD8=; b=W4lc89oKcjdlyJCLV8BumNe/A7sPKcELRKkLOGs0x898spC2EKJtTXX/KKMijGcATy 5cudtpUsfHtEuU/FwV1ui/W5A0NSOBnRSLaUaxdPmp30HAOLxNOyzJxU6odKjFsXbn0v oTxFF+pjqoAzHZXmJklEGn2SF0i5JtekJd9gXgO5v2+f8B8lYbn/+bJYzX4c8IqEszoO Q+//5t6OEla7fTfq9HWIfWEs5/lw28fNVLaw5BYqJFZ9ZGk+yF+goJ+cLeuMbs68JJFt XiTaed4UDoWOQa9UdtOBgoAdApoOFhgT9mKdKB2oe34qqXtyhjS5gzeE0T64bvHPa86i OK4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="hH/Gj0p/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n18si2674237edq.472.2020.04.28.17.38.04; Tue, 28 Apr 2020 17:38:45 -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=@gmail.com header.s=20161025 header.b="hH/Gj0p/"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726345AbgD2Ah6 (ORCPT + 99 others); Tue, 28 Apr 2020 20:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726274AbgD2Ah5 (ORCPT ); Tue, 28 Apr 2020 20:37:57 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59C9DC03C1AC for ; Tue, 28 Apr 2020 17:37:56 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id t199so265497oif.7 for ; Tue, 28 Apr 2020 17:37:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AXbjiSGR70Rs7XnaC6XEPPYDg/3o7H6rfC5H6HvRnD8=; b=hH/Gj0p/WQVF76WcR21W+7hJsABBWH/oubVBV2w02Ev8N5wA6ocMIXDsUfE8J7VtI2 Cn0MH1jeiif8eio9sm03YP/3d3P5rAJgG/jFVpZmj3IEJvi68WQy/2ju/WiKvkNjUmtn 2OHsesjDxw5jmW9Cw9qUCxRNvaX5xycaPbj4ZdW7/PS1b0lk50BsIq94Xar5S07ZI9wV /ZgU0JkDBXZ7SCU/IlV1o5uAHKSnU4Iu73vexP3FxHQXh43qwL4rQ/L8OZuu2Q5MY5qr J7UUQ3AowrzmR25V74OnlKSVAgbqLBafS9UM9IKqwl/SC96Yi0ii/bo/JKTCduuBp7tc wOdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AXbjiSGR70Rs7XnaC6XEPPYDg/3o7H6rfC5H6HvRnD8=; b=Oil72rtp9qualhNCTk9yTCjyA7yohp7EqSDGtTYPVU70iv60ggRTVK6A1Y5VgGbNMp tuRRmz5Xi4PvNvEHcuWY4z5WN0u1tBDVCS+2R1nRry/OMWXYpXGtQHwmTWfeFCwrwTa5 x2jW4sPx/fsBPEiiYWDx7LZ0WAraztUvEIWa8QVhfOh4g5gPiR07OPGII1cNJS0v/Xag BEgvYXxZMbeD49VcDGJMblmEimfHDYVfelMd4JNYPY9xeTBh5lDEmJxcxVqT7dTYsG+8 X51nlwDfwBuKi92jM3RaaRf8JfEoQ07Y+DFwCULfpG/5Y9IXpreChWuzFY8rvUj345sK G0PQ== X-Gm-Message-State: AGi0PuahwAQbS4XgvdOjZ9dkbcsCP+ML4zi6gtSm9Y53UjYihlwi9JV1 9EcQlSpicexxp2bR+8QEJ51Q5iuQ2tttEMu1N19iX3je X-Received: by 2002:aca:b5d5:: with SMTP id e204mr66264oif.108.1588120675667; Tue, 28 Apr 2020 17:37:55 -0700 (PDT) MIME-Version: 1.0 References: <20200428175149.1784-1-david@lechnology.com> In-Reply-To: <20200428175149.1784-1-david@lechnology.com> From: Luiz Augusto von Dentz Date: Tue, 28 Apr 2020 17:37:43 -0700 Message-ID: Subject: Re: [PATCH BlueZ] src/gatt-client: allow "command" even when property not set To: David Lechner Cc: "linux-bluetooth@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi David, On Tue, Apr 28, 2020 at 10:59 AM David Lechner wrote: > > This modifies the GATT client characteristic WriteValue D-Bus method to > not check that the characteristic supports the requested type of > write when the "type" option is set to "command". > > Before this change, if the "type" option was used and it was set to > "reliable" or "request", then BlueZ would attempt the write even if the > characteristic does not support that write type. On the other hand, if > "type" was set to "command" or was not specified, the method would > return a org.bluez.Error.NotSupported error without attempting to write. > > After this change, the WriteValue method will consistently always > ignore the characteristic properties and attempt to write when the > "type" option is used instead of having a different behavior for the > "command" type. > --- > > Related discussion: > https://lore.kernel.org/linux-bluetooth/685ddf1b-c824-9c45-298f-97b70cbf975f@lechnology.com > > > src/gatt-client.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/src/gatt-client.c b/src/gatt-client.c > index a9bfc2802..20c3fbec2 100644 > --- a/src/gatt-client.c > +++ b/src/gatt-client.c > @@ -1050,8 +1050,8 @@ static DBusMessage *characteristic_write_value(DBusConnection *conn, > return NULL; > } > > - if ((type && strcasecmp(type, "command")) || offset || > - !(chrc->props & BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP)) > + if ((type && strcasecmp(type, "command")) || offset || (!type && > + !(chrc->props & BT_GATT_CHRC_PROP_WRITE_WITHOUT_RESP))) > goto fail; > > supported = true; > -- > 2.17.1 Applied, thanks. -- Luiz Augusto von Dentz