Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp712162pxb; Thu, 30 Sep 2021 15:46:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqQ2TEcKlEZq+EPS8O/2HDZzY/kUzPvmFon2Bw/feseNoL+f8QuQVDYqWaUm2dvWDlETwX X-Received: by 2002:a17:90b:4d07:: with SMTP id mw7mr15166312pjb.66.1633042003784; Thu, 30 Sep 2021 15:46:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633042003; cv=none; d=google.com; s=arc-20160816; b=ol3hFCJjB/dQoaTus+vwRFmoFhXStczjpsPhU3CWGdO79Bj9kqcsKwkNCUE82wzjV4 hKA5Pp71wsVqZ56Lk0R3SKqX0jdISlfRaV8zd8dUp31y27Fe2ruUJ4qlxnP2e10qT2NQ 0gLHQBNlT/xzeIbSVcoC517jrhjX542boFrkHeGLBtof1SfXwpHJsU3cfPeF6/YfuWgW fRPCwRBAgobz3hskQ/O6x5QyxE7GBJv+zVoa/PScoUrpWmWzFP+l3A0jLx1mnqrbdbFw Opxc1s0r5PaFPRsSoDxmu/qn5gxjwKe8syTAVWBNqls18knhKgVlmzmUzJE2spCnJA0Y 2RXg== ARC-Message-Signature: i=1; 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=IME04lFZfOxs1awTZr4wS+9qI4QpihioBUUhALuFWOc=; b=Mp7V0MtgbNAPseQ00FfLi1SVIPs5Cy8YgHrV/qS3au2T+TZDJgIwO0sYCtk/prT3pA tpKy+Qm878UhZ8aKZknKHMDXVLF7y+l76EuZOt+SEXfRpxP4dv4i5HEx4QjR5j1ICxou IHP20yvzt++HPuG+VMeHlB9HGoZLZBS9/KXSqUGfG58CLob2xeE+97j0V/XweTFd/ItG DbynvAIovkacI3IojqFLV3bSO/PZLirBP2bYrGIJA1oB6x1DTvu3qn1rG9f98dVY0s4q ysZ7x9Q+KJ23kqfgtv3QA97TXm5MDoEeYq5ZJ73bGCctqY7XnFDRroZEX0+eIUIqft7m 44eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=nMcdM8i1; 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 n11si3030481pfj.262.2021.09.30.15.46.11; Thu, 30 Sep 2021 15:46:43 -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=nMcdM8i1; 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 S230118AbhI3WjS (ORCPT + 99 others); Thu, 30 Sep 2021 18:39:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229759AbhI3WjS (ORCPT ); Thu, 30 Sep 2021 18:39:18 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C3DEC06176A for ; Thu, 30 Sep 2021 15:37:35 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id x8so5033476plv.8 for ; Thu, 30 Sep 2021 15:37:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IME04lFZfOxs1awTZr4wS+9qI4QpihioBUUhALuFWOc=; b=nMcdM8i1bvOMolrhUbYWAABBoVYo19VCiq2p06uzN4pojS35ORXXS97RMG0DDFeR14 aNzsIhjkqSULIfT2eQvrpCm+gSfwSiJJBtqnF+BHUyL0rwQIVpr3GB3eo7pOGDKQ0J/E iSimxAEvA0JWlbG3PlSoewjcJkrlKt9z95vU4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=IME04lFZfOxs1awTZr4wS+9qI4QpihioBUUhALuFWOc=; b=oeNA3UeKxpuiL4LNSXCMgrTykvgVcxmEp6sLSflyXrPRxAT32YBsrWdg6AM2ZGE633 XxpMBK460KhukpIqgZSPTWF5ujVrlZEHzZF907I8ct+0TWImsbpRgIGCyeaZYNw/Tk4x FMwZfg/hYlulRxD2z1HH6QJXYrFmiO3zS5mUhIARoBvFi8xGt5ZKGKm309NrMBX6pa2/ WZkjcELPSWEspSH7kYf665CF2o+FT7vPAYovSQIfcM+YcdwcavDp+qOOEzSfCU8FYjcJ z/z2CG4N5rhZsuzV8mel3PSAHHmUxlwCtTJCImJbkeZXzmFrt2QUYqvams1bQBAEedqK /pgQ== X-Gm-Message-State: AOAM5303wbAd9u85LZRHomjoDgi2NwiPcuz32ufI/3lvd0EB9gPbbc5S WXG8d+6EG1M6kpA1D1hc75OoeZjKntto+w== X-Received: by 2002:a17:902:710c:b0:13d:f226:2e3b with SMTP id a12-20020a170902710c00b0013df2262e3bmr7625335pll.83.1633041454230; Thu, 30 Sep 2021 15:37:34 -0700 (PDT) Received: from localhost ([2620:15c:202:201:eb71:bb5c:56a6:693f]) by smtp.gmail.com with UTF8SMTPSA id y80sm3913090pfb.196.2021.09.30.15.37.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Sep 2021 15:37:33 -0700 (PDT) From: Miao-chen Chou To: Bluetooth Kernel Mailing List Cc: Luiz Augusto von Dentz , Howard Chung , Alain Michaud , Marcel Holtmann , Miao-chen Chou Subject: [BlueZ PATCH v7 0/4] Detailed error string Date: Thu, 30 Sep 2021 15:37:22 -0700 Message-Id: <20210930223726.2886139-1-mcchou@chromium.org> X-Mailer: git-send-email 2.33.0.800.g4c38ced690-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Chromium OS has been working closely with Linux Bluetooth community to improve BlueZ stack, and there are increasing needs from applications building their features around Bluetooth. One of the major feedback from these application is the lack of the detailed failure reasons as return for D-Bus method call, and these failure reasons can be used in metrics, optimizing retry mechanism, hinting the reproduce scenario to improve BlueZ stack. The current org.bluez.Error.* are serving the generic errors well. However,g given org.bluez.Error.* errors are used across different interface context which does not serve the detailed failure reasons well. (See https://github.com/bluez/bluez/issues/131) Changes in v7: - Fix nits Changes in v6: - Rephrase error string Changes in v5: - Replace error code with error string Changes in v4: - Address make errors. Changes in v3: - Correct error-codes.txt. Changes in v2: - Add documentation for error codes Miao-chen Chou (4): Add errors.txt to describe errors of D-Bus method returns BR/EDR and LE connection failure reasons Include detailed error string in Connect() return Print error code for connect methods client/main.c | 3 +- doc/errors.txt | 233 +++++++++++++++++++++++++++++++++++++++++++++++++ src/device.c | 46 ++++++---- src/error.c | 100 +++++++++++++++++++++ src/error.h | 57 ++++++++++++ 5 files changed, 422 insertions(+), 17 deletions(-) create mode 100644 doc/errors.txt -- 2.33.0.800.g4c38ced690-goog