Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp909094ybp; Wed, 9 Oct 2019 06:10:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVWsm7b8AN0By+3oGQyhWyWy0ivbz5nM4x9BfA/2brYS967X4xg7t5HG7j4FF52q4FVbWk X-Received: by 2002:a17:906:5388:: with SMTP id g8mr2733444ejo.278.1570626635856; Wed, 09 Oct 2019 06:10:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570626635; cv=none; d=google.com; s=arc-20160816; b=j1MFnGgqMrDZcAE5rVPKwlXehMjziBK61JpHLYlSHPWYAekfBmQ4tr++BMUJaTG4Ze YEGiRqumLkfpMIRIWSHIFLSnPOw2jbDbTt4im+k/IbD4SmeuMrlb6F5JFCf3s93q+xxk 2vYRtCNc9Bz/GT2VHAwmPr1VNDdgoSxFscIWCbjKJjWUuUyhYEDPTYoIrr1VA7wMmtbV XfytR370alKAFv+TiJ0L0YsWq1+RanIl3oBlQ9mnRQGDL+uePo2E56tZ+OJxMZVdaY+H 1qxesSoDfTZm3RMEmCOBk+ScA7iVLP/VwPQT6UADs0Y9SWwj2v6k/5YJhrsRmZUA5Ff6 6znA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:openpgp:from:references:cc:to:subject :dkim-signature; bh=29K6hVJGJZcGkwCl+5RILTdNjgpL+u4jpKVHbD0GYHE=; b=FCpvbfaDLP1neqd522b0KkxgB6vK9fvoe2vhwYLbSuFemk2pNNRt6x6K6Bpefd3iEK NNNCyAXds4dx2DgEJT3dqtAhRBQY6pqeSfpL2I/0sLnXcWJzZMCkR/91j3IUyWceug1V OkaC4Y3kkJm4IEG7Y6NqhBEMnj1ey5GjGC5N0Eu+s12XTkiWkkcCyHqm+uqI48IOtnhp r+aoowUCN69Kx9a/AOkneO5WFfpi0xynIqlX5smuCVyZQVueP3Zkjw7D0xT/l3tPU6rI eLenVte4WUglyt+bl6sYmJ45iap68pfGCKEbDawvtpJzOBkmW/v1mGJyPk1GUMI8AWTp M9hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@einfach.org header.s=mail header.b=WF6cItkb; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=einfach.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si1244413edp.400.2019.10.09.06.09.57; Wed, 09 Oct 2019 06:10:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@einfach.org header.s=mail header.b=WF6cItkb; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=einfach.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731144AbfJINJH (ORCPT + 99 others); Wed, 9 Oct 2019 09:09:07 -0400 Received: from postler.einfach.org ([5.9.2.179]:44649 "EHLO postler.einfach.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731087AbfJINJH (ORCPT ); Wed, 9 Oct 2019 09:09:07 -0400 Received: from [192.168.5.9] (unknown [83.55.204.182]) by postler.einfach.org (Postfix) with ESMTPSA id 3164C24DA; Wed, 9 Oct 2019 13:09:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=einfach.org; s=mail; t=1570626544; bh=rmSg8CA9vtrr50dL/pRP+U+Z8JSd6rtUkaF0NOB4+tk=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=WF6cItkb7hOLnAQDYo625csp8uwtfi9XUrDmz4fccOp1lbFrHh/dH7uMy1vnJBnyG 0qRu7xJr47W0JuHekWAgUuiA/ozNGjCXtGiCU0KahGNk0DANOiSr6mJjVoC3V8lgO1 8rBIhm49j2ztqJrQUiIgR5ivDIe17LTtQ6vS3XsI= Subject: Re: bluetoothd: Please don't filter UUIDs To: Luiz Augusto von Dentz Cc: "linux-bluetooth@vger.kernel.org" References: From: Bruno Randolf Openpgp: preference=signencrypt Autocrypt: addr=br1@einfach.org; prefer-encrypt=mutual; keydata= xsBNBFJpIRIBCACxTu2oWUM4vbNxNSCcjw5ni3MeVFUUDNFukzepEUjbICSt/939ytVm7Z30 skb9SHJe3W6LPNjcjRni97FTumyb0paDSLlj31oyJHISVjm+Ho82/WTxjz2j0hl3xy8Ou21H JEXv+05mAtxfWUIPYfJImJ7N8x9J0fM2IxttGKbK8MAbYaVO4114fBSSIOt78TlXNQvwqHdf 4rLb3eXqnLF2XV1qyBBZPfieEbe3Rf2q/h65o7YFvrkYx1pEFrxSaYAymXzafcZj+zjz+Zb7 XslOCDwwKbI2UdBZEn868mNbgpTOn68NfFDx2jyQKu2u+36+mWfaetyMdBovQuC2d1QJABEB AAHNH0JydW5vIFJhbmRvbGYgPGJyMUBlaW5mYWNoLm9yZz7CwJgEEwECAEICGyMGCwkIBwMC BhUIAgkKCwQWAgMBAh4BAheAAhkBFiEE3A0MZg9YDVxz+wTLTTqe7xBJ1YEFAlvPjYgFCQ8K BvYACgkQTTqe7xBJ1YEF1gf9GhTWp5y6SSm/XdBfdhdjYvmu4jHqd+WZk9oKHHbW/0I22VH4 qyLqvMDGsRGD+nTchmM28CmxuWsHp56cG7eWZPnggTBssQfQNJdzLMkd7GQ8ZGuASVJF8tdP lHAZrTd+fb248Xw4nCyTXIw9t2/wXuXR0UGVwomMVM2PrCkPHVWbe8lak2YpR0NKm91IP2j8 WJGsIElS+bL8F6/ZGAL86izbfk70tZpz23R6ssIy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T0czbCYkKVlS8c9RjbpO+ehdicXRs4C9bF xAfkIcBUP6V2l6E89idXuD0LAJJG/v5CoNkykTDY0S81PcTAOwsZ+sSgcWb+tOUVQ/gnizj8 eSQ2NKJ38LOvT+Fc1EOMNEdHZ4V4xwM5n2XUd75lKKdynwysLFbc52nDZbZLdwBmw92a4kAT kcSK3qeB7qKuAXopxt5uEFNOKZeKF/UQlKrr Message-ID: <12b16466-3633-75ff-bf84-9cef44a2358c@einfach.org> Date: Wed, 9 Oct 2019 14:09:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (postler.einfach.org [0.0.0.0]); Wed, 09 Oct 2019 13:09:04 +0000 (UTC) X-Virus-Scanned: clamav-milter 0.98.7 at bced1da0f74a X-Virus-Status: Clean Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On 03/10/2019 14:04, Luiz Augusto von Dentz wrote: > Well I guess you are forgetting that other users of the GATT may > interfere with plugin which is why we do the claim APIs in the first > place. Okay, I understand your arguments from your perspective, which seems to focus on specific use cases with Desktop Linux. But how do you suppose should application programmers or solution providers access GATT characteristics under Linux in a predictable way then? Not using BlueZ does not seem like a realistic option. Building patched versions of bluetoothd isn't practical either. At the very least there should be a build option to deactivate all plugins, but I think something more flexible would be better. Could it be a user choice? E.g. only claim services which the User has actively connected to and activated that service? In general I don't need to poll the battery status of every device I happened to connect to, even though it might export a Battery service... so I'd consider it more traffic if BAS is polled even though I didn't ask for it. On the other hand on a Bluetooth device I have paired with, something like a Headphone or Keyboard it obviously is the right choice. I hope there is a way to support both use cases. Regards, bruno >> It surely makes sense to provide this more generic API, but I'd argue >> that all services and characteristics should be available via the normal >> GATT-based API using org.bluez.GattCharacteristic1 as well. > > Not if the service has security implication, for instance we don't > want application to be able to access the keys presses coming from a > HoG device, or other things like changing the settings bluetoothd has > configured. > >> One of my clients, for example, uses Linux/bluez as an interface for >> Server-based reading and writing of GATT characteristics of several >> managed devices. So I can read all those UUIDs, but why not the battery >> level? What happens when Bluez learns other GATT services, will their >> characteristics then also disappear? I think there is a strong argument >> for maintaining a generic API for GATT reading/writing characteristics >> independently. > > But there is even a stronger argument if something breaks because the > app access something it shouldn't, even if there are no conflicts > between the plugin the very least it would cause is duplicating the > traffic. > >> I made the following change to the bluetoothd code to get access again >> to all UUIDs, and I would like you to consider to include it upstream to >> enable us to access all characteristics via the normal GATT API: >> >> --- a/src/gatt-client.c >> +++ b/src/gatt-client.c >> @@ -2006,9 +2006,6 @@ static void export_service(struct >> gatt_db_attribute *attr, void *user_data) >> struct btd_gatt_client *client = user_data; >> struct service *service; >> >> - if (gatt_db_service_get_claimed(attr)) >> - return; >> - >> service = service_create(attr, client); >> if (!service) >> return; >> >> Thank you, >> bruno >> >> >> [1] I published parts of that as an open source library: >> https://github.com/infsoft-locaware/blzlib >> >> [2] >> https://stackoverflow.com/questions/49078659/check-battery-level-of-connected-bluetooth-device-on-linux >> >> > >