Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp78592pxv; Wed, 14 Jul 2021 19:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRfh15I8AKMoznwp/cVIXzfBn2rEP1sbMlAjRaBQKFe72NhfoWivxG7z9Atta21C5UlpXo X-Received: by 2002:a05:6638:d0e:: with SMTP id q14mr1352361jaj.13.1626316339280; Wed, 14 Jul 2021 19:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626316339; cv=none; d=google.com; s=arc-20160816; b=HZtXZh2vjFTtiJfKTi7v9FByWLCio+PCpHwJUn8gZC+JSNbrhZ6uirhr82ATuXVsni tWGmQRT91JdgPBoCwDt2T0GVUyOhl2JNj6ulHMp3nHAN/iY8bNLyOZnv6xrBbr8Vqrx8 nj1AQsfRqo4px76qa762JKK9LaZ4AMyO5TlOiIQ22a4aW6+qJWYxK52f0Q/QJWMntIw5 zKbODcJBJpMHVxdW3O8ef1SABDYampqd3RCAOEmXIfiCu+f1qH9/XmMyg1WVrh2bp+bp m9atYnEcS3BvFR1Zt/GAR6jXBvz5Ts74LsHQxty9iFtloxgxWDX55hOMJP10zL+D+qzQ z2Zw== 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=A37TGVJ0XD7USVq8CqJfCbbq+hDqmM2/3SjGqTi96Xs=; b=h6Ij4GGoHxDqE48Zb63ZNToZ4CFoJx1gJNq8q7OEkSiqZNV99WZQ/IzW/MJ9PSy0UG 8fs6zCfnSr+k0OotQjHTZ4U3IpPx0fqq1XCWNptTDPs6Z+mMMJu0pC96Zpn0EkOOl//y Wbl4jr0DmbWbLxay9l1dshgzCPPii78TO1tY57jLZ6p/OcA9F1Hq5wFX81FcdYi3IuJ3 7wQTbz7bSJXF0qjlfmkKGUdsPa1DuXaytYHHjUCpZVc0/XikBEq4mlxL6y9NHc/945i1 psyVObq9WN+N0k+11N68YrIpdMdxwhFkku4WhOFu4hVVmTRoQsiRPXjkBJ5Ct2KSq0fO 6sSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oWzEoKSp; 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 h22si1046911jal.57.2021.07.14.19.31.26; Wed, 14 Jul 2021 19:32:19 -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=oWzEoKSp; 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 S230310AbhGOBMw (ORCPT + 99 others); Wed, 14 Jul 2021 21:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbhGOBMw (ORCPT ); Wed, 14 Jul 2021 21:12:52 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AF2DC06175F for ; Wed, 14 Jul 2021 18:10:00 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id k20so4326272pgg.7 for ; Wed, 14 Jul 2021 18:10:00 -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=A37TGVJ0XD7USVq8CqJfCbbq+hDqmM2/3SjGqTi96Xs=; b=oWzEoKSp+mtGvcOf8W3+45in8IsyVCcenwiaGy5CvboqCh3BKQkSWXzUw/8dRdiX24 z10jOw0x63mSaUcGUB8CuttkIm8MaHkf15MURemxImOmhDtkFaqjALl724xIDFG3If8W zqhjg2PMdOtCSAoLOBZ7rkVfeDjXH3cTzG9xk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=A37TGVJ0XD7USVq8CqJfCbbq+hDqmM2/3SjGqTi96Xs=; b=RAKcYR/etdfeB4CfSkjrzlJq4swr5PPBMdM1O9cWy3YSecQiYKV6ywzH3VCum+vIJn 1ixchCOkW+rTYx53rgTTvtkoYc+0Yj1FWmlrZOfgHMecV2YAgOOycjROdfbzyFEVCP09 3a6vjAYy1fwB3Cje5XKu14m6veI/cpiLOIw5sXDuuJfZ1tPq1oeR2YroH0LNCLT6Xf00 eF0NocM9ve4kwyPMThKwDYkOeVTVUiR5DxVXZrz6tpl9cRuAsX14zVQwb4s2BaaNicr9 MXuj187eaRwhUvA6NcIr70uaEuHqZucJA3+734fT5mZ0A4UkLqyFDGG9/r5INDSUBbaD 2Npg== X-Gm-Message-State: AOAM531ZAFPkGrdg8dDH3eAL+lxmCnBJnxHkOCMCC3rSlg0IqxAgHGvh b9AW3XCp99xMoqtENsL76PQUknqkMJKbpw== X-Received: by 2002:aa7:8550:0:b029:32b:963f:f53b with SMTP id y16-20020aa785500000b029032b963ff53bmr911476pfn.0.1626311399640; Wed, 14 Jul 2021 18:09:59 -0700 (PDT) Received: from localhost ([2620:15c:202:201:20b7:5dcc:d530:a8df]) by smtp.gmail.com with UTF8SMTPSA id d67sm4013367pfd.81.2021.07.14.18.09.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 18:09:59 -0700 (PDT) From: Miao-chen Chou To: Bluetooth Kernel Mailing List Cc: Luiz Augusto von Dentz , Marcel Holtmann , Alain Michaud , Howard Chung , Miao-chen Chou Subject: [BlueZ PATCH v3 0/4] Detailed error code Date: Wed, 14 Jul 2021 18:09:47 -0700 Message-Id: <20210715010951.963176-1-mcchou@chromium.org> X-Mailer: git-send-email 2.32.0.93.g670b81a890-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 v3: - Separate and correct error-codes.txt. Changes in v2: - Add documentation for error codes Miao-chen Chou (4): Add error-codes.txt to describe error codes of D-Bus method returns BR/EDR and LE connection failure reasons Include BtdError code in Connect() return Print error code for connect methods client/main.c | 3 +- doc/error-code.txt | 266 +++++++++++++++++++++++++++++++++++++++++++++ src/device.c | 52 ++++++--- src/error.c | 111 +++++++++++++++++++ src/error.h | 52 +++++++++ 5 files changed, 465 insertions(+), 19 deletions(-) create mode 100644 doc/error-code.txt -- 2.32.0.93.g670b81a890-goog