Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1735929pxv; Fri, 25 Jun 2021 22:23:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ1Uk5g5jESYBVKhysF6j7Pu9uzszXDhMubwPLBhvdt5IPN0ve73Ekaer4E9GOYFLkW5nw X-Received: by 2002:a05:6638:3594:: with SMTP id v20mr12375336jal.25.1624685038498; Fri, 25 Jun 2021 22:23:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624685038; cv=none; d=google.com; s=arc-20160816; b=N+uJ88/98fIG3U5jagaYgQhoSnh0IXfIx5MRBbJhH8yKAwH1aFDjWHH5HmoHl4GV9n vFNHe3bobdPHvVcdmpadh77PsefFT5gyLoywuJhMztQtlSRWiYSt/SmjU+LGqC4LgZPp ONeUNzOsz4i+vomV+5hx5fbWSYOhADuptXp6wGhfWt5arQMHbQOjg351p4xnQLFoSPm/ nI+TkRsjJOiRAT9inltnMnbjgWImK6QopTxtLmSzmiqzf7gwaf29F/BsamDF4wGX4j4q 0GOgJrBLdRtDWc8HJaM6bBWXbUTan4aNn44bK9ACrWlU2I1BowdyB+EdsayafGRNMuk0 UuVg== 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=ZWpBwTAKAhPC/pjWpx/k4UKP7rHEEXjrUX67mDBVe0M=; b=0D2PH71GbPr4DM+4ErLobFp1xp3QPuRYYHdj2btEpPvsP2UdmQXg778JlWmMG2vkrm PVD70++ILIREhvx7K9V+6O0Sdhv7rUaB/+Ab3cojBdeQJow/LMrAvh2F2U7uEoGqhB/X LJ1D4pX9A5YdFDxqpN8juXhrRZAMaFsIybfDktabCpoERirfaVVdolWWtezhtl6akAvX OuKAgpNjgGizZXCUQE9Q4qVZgNypaU4CEAg9lKDf4dIXz7CpN2vB5Y2SPndNuLa9/bEK XgZtyzzTd8NFwyi642OSlMof58oj1wzQNIsmTM98HS/Q9mBtFsvMNJ6kBw4oVmI1dx5Z mQhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="L3rd0OZ/"; 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 j20si7578782jak.8.2021.06.25.22.23.27; Fri, 25 Jun 2021 22:23:58 -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="L3rd0OZ/"; 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 S229462AbhFZFYY (ORCPT + 99 others); Sat, 26 Jun 2021 01:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbhFZFYX (ORCPT ); Sat, 26 Jun 2021 01:24:23 -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 0EBBCC061574 for ; Fri, 25 Jun 2021 22:22:01 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id u14so3548376pga.11 for ; Fri, 25 Jun 2021 22:22: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=ZWpBwTAKAhPC/pjWpx/k4UKP7rHEEXjrUX67mDBVe0M=; b=L3rd0OZ/Vw9XZliriYRTKop+eCv88k+8XqUdYlGy4wB4MIVThKHJfxpediNMzHqovI kxbTqYtuQV9hmqWXiKEcqffR12vDmoNRQowHT5Uq6MRK4/nv668Ai7fk2T4kS1LYUwp0 jFOTl0OlOmq+BWZvAWtJ3deVEVplGr+SRYh0c= 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=ZWpBwTAKAhPC/pjWpx/k4UKP7rHEEXjrUX67mDBVe0M=; b=QyLlrjopVpmmvFlFT3VCbqm8s1a7CUyeRTHNN7fwr2rqvK3f6ZIxH3saPf/nbO3qFh 0H6yZdgLwrV+iM6fZaQTxdQ3Qnk9LFQ7LVeYaqeC1Wz6o8eRI4l0ORppwa4TGQ9azFMf B8hfTAGAh2Iy5jbekxiYPyasCv/csf2v8fnPzGP42aJczcksQsObJDou4L/1jEtS+De5 2notXFFCbklMuReG4RXn4/XM3/5kw2Ewf9POGNuAENwGIFs14VNNI0TN8o4YaPR4rtqI FbbIniGLeo8kjxlG3K2ZUtVp5krkFiLxd6lKLOYVL5TAH340i9DQcb4JzQ1oE/9hfbwD BrYw== X-Gm-Message-State: AOAM532b8yn1emYOrwN5DyEZXJ5OP75hlKivKnwFIfoEL69CXjrZ+HGW NwO9UhZL/K/kwRNMB2rtPpUg18rSCcWbfg== X-Received: by 2002:a63:2dc6:: with SMTP id t189mr3678806pgt.442.1624684920115; Fri, 25 Jun 2021 22:22:00 -0700 (PDT) Received: from localhost ([2620:15c:202:201:be2:cfe5:893:108f]) by smtp.gmail.com with UTF8SMTPSA id s1sm6906963pgg.49.2021.06.25.22.21.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Jun 2021 22:21:59 -0700 (PDT) From: Miao-chen Chou To: Bluetooth Kernel Mailing List Cc: Luiz Augusto von Dentz , Alain Michaud , Marcel Holtmann , Howard Chung , Miao-chen Chou Subject: [BlueZ PATCH v2 0/3] Detailed error code Date: Fri, 25 Jun 2021 22:21:49 -0700 Message-Id: <20210626052152.2543526-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 Hi BlueZ maintainers, 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 v2: - Add documentation for error codes Miao-chen Chou (3): 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