Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp900467pxt; Fri, 6 Aug 2021 17:25:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu50tzVeND9gPx+pcC6MBdggRA7VmDNriBvHkJWfhvbDUVivdJZbkab3WFebcpKLwBcGBN X-Received: by 2002:a6b:14c6:: with SMTP id 189mr1448955iou.165.1628295931130; Fri, 06 Aug 2021 17:25:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628295931; cv=none; d=google.com; s=arc-20160816; b=xpe08zYT4FjMnhol4tqPFOsn1usdv5UiiwTgzY3PIBqeU3Un1QQEueQRlvibza3Iqm CnreRyFbfIP8Wx1DWRcfSSbslqG7Drhf6Pt7UMclLorGmULso/vnaGoDVjz9GexiwMPF Fguo+5V4SYKfmyHhPbpsGYvj7SywxWRQTBflC0WZEAfjo4hzvrS5BZf0Ej50UPhWh8zw Zh6K0Ke7ioYS9edgBNBDrH5xF50Ly/5e4ug9UqV13oZHKT9apO95VAOC72BSHc3pAz6x bIemiF5v5s4deKPwN3JekesvE7L80II5ui/fvCkjY/2rfDCh2GvxRHacvgAtMrFVca+c XdZw== 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=fZIGWuiCoc1camvi535r1KhRo6f/+bi2yF9HecPkL1M=; b=dog7SKE/MkUoQQY8iLIOFfMAw+mnhTLtub8l4K7QKqzcRtbPpm/8DJ7x5z4YF8oxnD bcrLTDATMoWeTlBl5b7DI195kqptnbPL/93KKjTLgfNNqYikvoJGaApiCGjG0n4DPdKD oKIKD3fbY3KzBhDwrasl7i7vOasXkjaL1dNnuqKYolZJMPE3JZ1x12+kx6RwDz28ThKC oIkSkmJuxEm4LZ5zXPLC6FS6pasy98u91UaRVO7TizY4avBzpIz9+Jdo4DCIQjKV1mS2 l87L0xNSsbxi2Ey6b8PYQD4eKKRCSiZaeSII5cxVWTVt38FED97qfz6pjNmoM487LWsM V0jQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=UDJxAARg; 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 f22si10928752jam.121.2021.08.06.17.25.19; Fri, 06 Aug 2021 17:25:31 -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=UDJxAARg; 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 S232168AbhHFXrw (ORCPT + 99 others); Fri, 6 Aug 2021 19:47:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232099AbhHFXrw (ORCPT ); Fri, 6 Aug 2021 19:47:52 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0675EC0613CF for ; Fri, 6 Aug 2021 16:47:36 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id j3so9186853plx.4 for ; Fri, 06 Aug 2021 16:47:36 -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=fZIGWuiCoc1camvi535r1KhRo6f/+bi2yF9HecPkL1M=; b=UDJxAARgf9/2EtvCfYOa0UcP8WSyyTK+UAqoJiQ2b+P7UYw2+w1jxKT9Ecc9cZagn9 fm5RkQNzehWLOEEUCwdgN+SAIQTe1fNRN0FqznHKHBng/bbbzgf0Gctk1acPyDk96gBo vj7b9aAA5MclRT8ztbKdjphrKOx5CmJz5Zww0= 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=fZIGWuiCoc1camvi535r1KhRo6f/+bi2yF9HecPkL1M=; b=hPbcR8O2GqxAfbWRj93146Qn5MHuGMvN3zVrBTWw5pp4+K/wxfUlb0rGmgadHDiEi4 1ylNse8tYWRga20UCbxYNyzHrYQvngUezK78wFqlIioc5w0wTAL/Mit8XX2iAR6GUibt LKun7HPFWzDn9CEWGLsFaCtOixClKklFLbTJVFR9Rxe1Kt7KHd127kO5ijovyzvk7hEH Emsh9Wo9BrYs2zyhfUk+0T2KoYRckoT1EmMTwDZW3upS5rOABhsKILkOdDS2WEOVfqjd S98Qc2b7a2CHAhtb9mvz/WnNMqYtvM7XNchdIQs8KsiYUrnQ2EclukXXeEasUMA3UfHh 8BtQ== X-Gm-Message-State: AOAM530aDrzA0hc3b9poEHnceqmxpodeKzVtfDqiP9UWdEm5/XeJLW/c bB1Wz7IaBW3fbsa4w63GxRW6OGTN3kRf6Q== X-Received: by 2002:a17:902:9f88:b029:12c:c06:2645 with SMTP id g8-20020a1709029f88b029012c0c062645mr10596013plq.21.1628293655300; Fri, 06 Aug 2021 16:47:35 -0700 (PDT) Received: from localhost ([2620:15c:202:201:48a2:9887:4da1:32a4]) by smtp.gmail.com with UTF8SMTPSA id m17sm11655150pfh.133.2021.08.06.16.47.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Aug 2021 16:47:34 -0700 (PDT) From: Miao-chen Chou To: Bluetooth Kernel Mailing List Cc: Marcel Holtmann , Howard Chung , Luiz Augusto von Dentz , Alain Michaud , Miao-chen Chou Subject: [BlueZ PATCH v5 0/4] Detailed error string Date: Fri, 6 Aug 2021 16:47:17 -0700 Message-Id: <20210806234720.286157-1-mcchou@chromium.org> X-Mailer: git-send-email 2.32.0.605.g8dce9f2422-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 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 | 59 +++++++++++++ 5 files changed, 424 insertions(+), 17 deletions(-) create mode 100644 doc/errors.txt -- 2.32.0.605.g8dce9f2422-goog