Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1800330pxv; Fri, 23 Jul 2021 18:28:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx74d8HBZC54xDffASr1OPk74YRO9kkBe1NeTJMle2tf7W3fRVThEwKHDc82HnLlG9Vs1u2 X-Received: by 2002:a17:906:5e4c:: with SMTP id b12mr6900183eju.230.1627090080022; Fri, 23 Jul 2021 18:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627090080; cv=none; d=google.com; s=arc-20160816; b=Rdf5raVYWIEyQJWXLuCh8pgaD2C5PZkdNFLbS5924dsMf/1mzsqMyTmUNHW31ou+Me hxf2xQPJ8LMUWh100FPE8aSDvn2rq9RV/cKagRhfiCWjwCkizubs/LtyqPamMI29yHXq m2G69/EpniTMysMSBIVAYtGcl94O3jbqS3m4z5vlSO2pcBo0UR/GrU7NAkfErjNUaqJE a8wtx0hvWypIqEza1rNcmVFnjqW3kT4NHEZAqAxFNqBnt9Jwpz1enqNnxfPmh8SI3tKY 0OMcuCMumqPWt/+6kx43H+fMkJIHwpseWeuC5biOwWJkruUBESyv4Q/2UDev2YF01YCX muVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yFLKqCQMs4QJ4wkuMKLn39s+IHrWzISoltHLZE6/2V4=; b=NTjPjqxJ6t3w1i3jxpn6tmksrBEY44YM6hVzyiUwBTFhponqNuj1orzkqKiyayAyU7 xaSg6Xxfm2ZcexNVczgll88QCPwKMvzmcxn5xgfo0WP3zS66gDvb6vy3yJfFSyH4u9lt eSAjwtOls4fowc1o0T36e8gA6FNxhsAD0v5gesTm8UcGl4svF1MqBPszZlSZdGm3mN/c 9I8w0Pavnp4Wi2h1cON6evCHrASTXrnqr6d3zrCPI6tI9nKznFtAHn268qTXQ5wk05n6 TtecmIwHop8zLvabNslSqBkF0EbzmAjF7CVfWMkVGZ3eeQhSIiONfNaR05BI0qSqQbpU rKeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XNqWMNSs; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t23si34974689eji.705.2021.07.23.18.27.16; Fri, 23 Jul 2021 18:28:00 -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=@chromium.org header.s=google header.b=XNqWMNSs; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233366AbhGXAn7 (ORCPT + 99 others); Fri, 23 Jul 2021 20:43:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233298AbhGXAn4 (ORCPT ); Fri, 23 Jul 2021 20:43:56 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0CDBC061575 for ; Fri, 23 Jul 2021 18:24:27 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id bp1so4945945lfb.3 for ; Fri, 23 Jul 2021 18:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yFLKqCQMs4QJ4wkuMKLn39s+IHrWzISoltHLZE6/2V4=; b=XNqWMNSsGhcxi426XftVASsFLTqaG79Guc7kHP2Ml5oLtivIdkFH/t/V0DU+MavucT vlLRhAxyaN0YtQu+Q+cnexe4hG/yzzGhW2K9JovLaPBt95bp0dD1nBFayu/4HuR5sKb6 o6St+77jfQjM+Gm3mbycwm65tq4S8JLYo5aDw= 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=yFLKqCQMs4QJ4wkuMKLn39s+IHrWzISoltHLZE6/2V4=; b=kxXvKhMTVwPRw6uiGjKYwtC7R+IjdrfCaSVMi7fwh+TDogBu9qkw58im1ISwUrCswS mQd4vWz9bMNYRJmDAhhMo+BlDvukmOwe7EdcO+luemCi78ZaS/UKVjcVVti8aYNkft1+ Dwvf3ITMIzFMFdseMPcDvikf/NzDCITrmy2TH/2Tcw3Pzla3U9Kp2IaYi7otHmgg+AHx H68P/IbvAZhVsUI81hqHmMqnCmi6TJJtfXeOe5lzfUC4qNWAXRw9PTunJhgBYETCf3UN PUFOLumgbJT3hnRSJBLBAWWjgrzH8xs2MFPsWUxxEKNwAqcQzbjd6NgVzrnIFiJibygo MfEg== X-Gm-Message-State: AOAM531idsajtS59vgJ+ZVMIAk+/NqdSnXPgDcbXcRjO+/uz6gweORmg 7M10+eHGKIhFfmZyYeGcqn4lnIcvLme/N1I7GhR6pw== X-Received: by 2002:a05:6512:3456:: with SMTP id j22mr1067789lfr.538.1627089866266; Fri, 23 Jul 2021 18:24:26 -0700 (PDT) MIME-Version: 1.0 References: <20210626052152.2543526-1-mcchou@chromium.org> <5350EBBD-7F81-448E-B96A-A1C09F8EC676@holtmann.org> <2206189.ElGaqSPkdT@ix> In-Reply-To: From: Miao-chen Chou Date: Fri, 23 Jul 2021 18:24:15 -0700 Message-ID: Subject: Re: [BlueZ PATCH v2 1/3] error: BR/EDR and LE connection failure reasons To: Alain Michaud Cc: Szymon Janc , Marcel Holtmann , Bluetooth Kernel Mailing List , Luiz Augusto von Dentz , Alain Michaud , Howard Chung Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi All, Thanks Alain and Szymon for chiming in. Doing a through-out API revamp is definitely worth considering. However, I'd like to point out the fact that these error messages will likely be applicable even after API revamp, since the majority of the error codes are based on errno returned by the kernel. Another comment was on the format of error return. I'd like to hear your feedback on how we present errors in D-Bus return. The two options that we have on the table is (1) string form of error description (2) string form of uint16 error code. (1) is more extendable while (2) is easier to be processed by the client. Regards, Miao On Fri, Jul 23, 2021 at 6:20 AM Alain Michaud wrote: > > On Fri, Jul 23, 2021 at 4:20 AM Szymon Janc wrote: > > > > Hi, > > > > On Friday, 23 July 2021 09:38:40 CEST Marcel Holtmann wrote: > > > > > >>>>> What is the intention to split BR/EDR and LE here. You do know > > > >>>>> up-front what connection type you are. Trying to figure out from the > > > >>>>> error code what connection you have been trying to establish is plain > > > >>>>> wrong.>>>> > > > >>>> In fact the up-front connection type is not necessarily known. In the > > > >>>> case of dual-mode devices, such as Bose QC35, a D-Bus client can issue > > > >>>> Connect(), and it depends on the timing of connection request (adv > > > >>>> usually arrive first compared to inquiry result), it can be either > > > >>>> BR/EDR or LE link being established. Another aspect of this is the > > > >>>> metrics collection, where knowing transport can be handy. For > > > >>>> instance, we can associate the certain error to particular use cases > > > >>>> at application layer, and that can help targeting the bottleneck to > > > >>>> tackle. > > > >>> > > > >>> Then we need to find a different way to convey the transport chosen. > > > >>> Doing this by error message is a bad idea.>>> > > > >>>>> The description is that you want to know exactly where the connection > > > >>>>> failed. And I think that can be established independent from the > > > >>>>> transport.>>>> > > > >>>> Indeed the intention is to know where it failed exactly. However, as > > > >>>> mentioned above, transport information is also an important piece of > > > >>>> information to know. > > > >>> > > > >>> We need to find a different way to inform about which transport failed > > > >>> (or better which was chosen in the first place).> > > > > I would love to hear your thoughts on an alternative. Many of the > > > > Apis are transport agnostic (Connect/Pair may end up connecting to > > > > either available transports for dual mode devices), but yet the error > > > > that results from them are not. Errors from one transport doesn't > > > > make sense for one and vice versa. A platform wanting to leverage > > > > telemetry and metrics to drive ecosystem improvements would ultimately > > > > need to know the difference even if the applications may not need to > > > > care. > > > > > > and we might have made a mistake in the API design and should have given the > > > caller more control. We need to review the API design and see if things > > > have to change. Just glueing things on at the end makes me suspicious. > > > > Some (5, wow!) years back I've loosely proposed split for org.bluez.Device API > > that was meant to handle some of the dual mode devices issues we've been > > seeing [1] [2]. > > > > We never got time to fully implement it (mostly due to hacking around device.c > > instead of properly splitting internal implementation into device_le.c and > > device_bredr.c) but got some very initial PoC running. > > > > With new interfaces old Device1 could be simply super-set of two for legacy > > applications purposes. > > > > Maybe such approach is worth re-considering? > > > > > > [1] https://marc.info/?l=linux-bluetooth&m=145710680912268&w=2 > > [2] https://marc.info/?l=linux-bluetooth&m=145973293118003&w=2 > Definitely worth reconsidering. We've recently introduced a ConnectLE > Api as a stop gap measure for something very similar. I'd love to see > the equivalent of a ConnectClassic / ConnectLE distinction. > > However, I still believe the "Generic" Connect serves its purpose as > you alluded to above. Even if it could be built using layers, I still > believe there is value from a telemetry POV to understand the errors > from the field better and there, the distinction between the specific > transport matter. Just like today, I suspect many applications will > continue to use the generic "Connect" as to not replicate the logic it > ultimately implements for dealing with dual mode devices, yet > results/metrics would be important. > > The team strives to improve interoperability at a large scale in the > ecosystem, I believe these data point distinctions are a critical > enabler to get better insights into the specific errors customers are > seeing. A counter proposal that would be acceptable to you, achieves > the objectives and that the team can implement would be a nice next > step. > > Thanks! > Alain > > > > > > -- > > pozdrawiam > > Szymon Janc > > > >