Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp756098pxb; Sat, 10 Apr 2021 18:52:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxY2Ul7gVQx4CLBecwP+p4NQ7M3d9fsvkqVmKWsCZimUuqn3yb0NHDNVTCFRFEzj1NwzRf X-Received: by 2002:a17:907:9706:: with SMTP id jg6mr1244678ejc.515.1618105966827; Sat, 10 Apr 2021 18:52:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1618105966; cv=pass; d=google.com; s=arc-20160816; b=PCdoDgQwzjDMlQE8egmBWXRdl+j2BGfAa1AUEI1PFNJxAHpLguWbtwsTCnNRL4pXa1 Zm0Y4iUYxppuVTKkFYCvQXGRLDoBNnthokZH7BUy3CPFUgMup1OvWqwMr2aene25yRb4 N73CdlIp11o4jzn3Gqb/+l7HYb1gwEO3TkUjhvoK9iz6WO252O0TVHJrwP0voFNQ/HYd x3uQ0Eu+wGGjWQJGIzxNxKBioKj94w2qQQmfw4Abr+8foIq2FtnZExLGWhU0nowfA2Tu pBawoiOW0aSPfbznH2NOmjqttSt0AjbIarkmERIse6qVVbfw+OoB5OyThCwesTCg1duF ZNCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=jKmLEp7o5pcOvhFez1HIxlncTaW6WPSxiswq/eBvAR0=; b=Xf+FzZ30JHEtK4ctUta6VznqwEZnEqke0nfsQ9TAu7lhkW5H6fuNZTk0SQFdvdOVo6 mGcgAUE+vPdE8XP38h3BTTMEBs+/nhTHOgol9m7+vNJlMqehUAA9m4qcpdjJiNzveWSG fA/7QOVqViF4PM4Hr2nFJg8VqefU3ty8ylMjKU9hdR70BuGslFKxm+W21wMYmKMeVBW8 /UV6SWYxDSKOrkKA+6nwzUEZ462ytS9d9OpPO4nNBNRMGuqUINrPxLq/O+TwcS3Ofi0I h+tYyR4Zg2IW14MKFSYwNmbVfTRjbPpXqjQY9YisjfQIONCNgDz9nUXMteBMUynZ8gvZ 8W7A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@maves.io header.s=dkim header.b=mz1GKDUq; arc=pass (i=1 spf=pass spfdomain=maves.io dkim=pass dkdomain=maves.io dmarc=pass fromdomain=maves.io>); 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h15si4944534edb.566.2021.04.10.18.52.00; Sat, 10 Apr 2021 18:52:46 -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=@maves.io header.s=dkim header.b=mz1GKDUq; arc=pass (i=1 spf=pass spfdomain=maves.io dkim=pass dkdomain=maves.io dmarc=pass fromdomain=maves.io>); 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234992AbhDKBfT (ORCPT + 99 others); Sat, 10 Apr 2021 21:35:19 -0400 Received: from sender4-op-o13.zoho.com ([136.143.188.13]:17377 "EHLO sender4-op-o13.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234944AbhDKBfT (ORCPT ); Sat, 10 Apr 2021 21:35:19 -0400 X-Greylist: delayed 902 seconds by postgrey-1.27 at vger.kernel.org; Sat, 10 Apr 2021 21:35:19 EDT ARC-Seal: i=1; a=rsa-sha256; t=1618103999; cv=none; d=zohomail.com; s=zohoarc; b=bLJYY90KCidQPvZ9YDMrIw3QLs7zN+jhlijJNOPoo5gAhyUkNxhfqPYpBC1IyqXqnCvct6JDclMqRxhxZFrXrjWiuIov6WqYMxAYPfHq4vr5rtmkFtgaRER1TyV/ndqUhZkyMZv4J/TTiBhxRPcv0P2CwFH/cfnqA0rprTBaaw4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1618103999; h=Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=jKmLEp7o5pcOvhFez1HIxlncTaW6WPSxiswq/eBvAR0=; b=OkMighUAQR2GBBWSdsf3Z/TWQ0ElUEQsOgeZkSBP/PpX2JNiXjFZhQlmRpeuVWC2q9zdgi13H/Cx66HciQ8/nQXybnmDyBw1G0zoSHSdHkNUS0a0DMeuwwr+BLznQrw4NbiaCGJZ6Cw9OQOS8m5X7I74i6Mxr/I/qdQF+Z2vuzA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=maves.io; spf=pass smtp.mailfrom=curtis@maves.io; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1618103999; s=dkim; d=maves.io; i=curtis@maves.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Transfer-Encoding; bh=jKmLEp7o5pcOvhFez1HIxlncTaW6WPSxiswq/eBvAR0=; b=mz1GKDUqiYc21OsLkOZgIUxJPNQLM/2bcnJnzgXi6Nbwbr1lEa2x+YOQo1nH7GzY ESCcSBg0RUqAvC1Yd0ggZaToueFZGU4yB5u8zsZFtIHlTBPQpKOQJ3MQwW9iIh+NkaQ TXCO1MzMTWC2vSNfkwCS/5N/jaySUV+wnttpkIeM= Received: from maves-arch-laptop.attlocal.net (107-216-162-79.lightspeed.iplsin.sbcglobal.net [107.216.162.79]) by mx.zohomail.com with SMTPS id 1618103996038364.29060430545974; Sat, 10 Apr 2021 18:19:56 -0700 (PDT) From: Curtis Maves To: linux-bluetooth@vger.kernel.org Cc: Curtis Maves Subject: [PATCH Bluez] Select either notifications or indications, not both Date: Sat, 10 Apr 2021 21:17:30 -0400 Message-Id: <20210411011730.31780-1-curtis@maves.io> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-ZohoMailClient: External Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org AcquireNotify and StartNotify starts notifications and/or indications by whether the characteristic supports them. Before this patch, if both were supported, Bluez would try to start both simultaneously. This patch changes this behavior so if both are supported, only notifications are started. --- src/shared/gatt-client.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/shared/gatt-client.c b/src/shared/gatt-client.c index 4e10f244d..1ff5e94ee 100644 --- a/src/shared/gatt-client.c +++ b/src/shared/gatt-client.c @@ -1591,14 +1591,13 @@ static bool notify_data_write_ccc(struct notify_data *notify_data, bool enable, put_le16(notify_data->chrc->ccc_handle, pdu); if (enable) { - /* Try to enable notifications and/or indications based on + /* Try to enable notifications or indications based on * whatever the characteristic supports. */ if (notify_data->chrc->properties & BT_GATT_CHRC_PROP_NOTIFY) pdu[2] = 0x01; - - if (notify_data->chrc->properties & BT_GATT_CHRC_PROP_INDICATE) - pdu[2] |= 0x02; + else if (notify_data->chrc->properties & BT_GATT_CHRC_PROP_INDICATE) + pdu[2] = 0x02; if (!pdu[2]) return false; -- 2.31.1