Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp78594pxv; Wed, 14 Jul 2021 19:32:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7JKl3SxrQE+n5sIohneCvsY1pUrbcStoIrPniMIwunivECewAcCE+9zTLhXgFzlu5SVp8 X-Received: by 2002:a92:7009:: with SMTP id l9mr819273ilc.24.1626316339286; 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=BRgIwPaUOR5+RUgMlDm9Tpu6u96hyn2GRV1R/kPxcfKzcGM4L2wccbb4hzU5+ldLT7 CSh3wCWXedZr/QhkTxGWL19Au/vEx5MJxrdB7yZOJnlkiR7ryWlsi6QrTuqCYF9pscEf dhRJEydhx2dmV7EJ5ARa3Z2ZNpmj0LxgeZ54O4RsrwA5NzX89ao9tx62S2/9anoaVS5X VWqMlLmO9imlFjgxo7+qcC7+c0gO3KY+KwDQ0uPzPgtJySN84tSrfnPyEsVtTcJwqUY2 Yr8IO3VnSKqUpPaB3R2r5VSrK9H/4PNUxBkGTnM1yq8U3XabvEFp9TWVXesnh5T7gXrQ 3sVQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YoKr/Pqdy8ER5rFYwXCCTJh6avldbNPa1f0IpeH8WGY=; b=yh3Vd9JDFNewg5l+XXeMxAwF+/VbTKjeYihIewzuIbtjrV5mC66gaSq1RkXnFlnIzV KZ0TuRmX3rNvtYR1Ng5gdKw4g1oFHhVUdK9rx83RXeY88DSU+6leBrvZ6jFcQj3dUOMP A2lm5E5P4JzWSZ7PkWrRhXYlHetexqhwqWKUie5EnYQH3X3etONFQt9JCxtfAGt1daIU vc2J8f7WO2YlHYXw7rRnonYEyUErkzOa4Fcd8dXEyGFjWinriZsY5e2wb3A3DUGEyZ0y TuM+VKWvRtn3Ey2RHg5W3BGo//do/mUfff+HRInTuFDuGTIDSWyIAjCaJNE/hh202CC/ nfzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=S2VlYM24; 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 f4si3937380ilu.143.2021.07.14.19.31.28; 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=S2VlYM24; 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 S230418AbhGOBNf (ORCPT + 99 others); Wed, 14 Jul 2021 21:13:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229909AbhGOBNf (ORCPT ); Wed, 14 Jul 2021 21:13:35 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 140BAC06175F for ; Wed, 14 Jul 2021 18:10:42 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 62so4358422pgf.1 for ; Wed, 14 Jul 2021 18:10:42 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=YoKr/Pqdy8ER5rFYwXCCTJh6avldbNPa1f0IpeH8WGY=; b=S2VlYM24nC0DTElbYtLGQN5W97y7cOim6OJmAtVNIDO0ohlk/NbrCHN/IwtPobUZff jAwCwxYgIjSNknzcPdnCTk+ZMT3vFtJpkmJgbBDqBsJnjnAo844jYOAFo/oXPec0J1wf PBlv4i/ml75EZGFw0ILMIUMk2Fo1Y8yXDrq9c= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=YoKr/Pqdy8ER5rFYwXCCTJh6avldbNPa1f0IpeH8WGY=; b=NmtCTbMkC5sn39uwFw0SOKvWiF9tgD91n9co3hijjEb6rP8uAUoqcW3ho1KxAgkrBg L7RnodWgR12LAMrxbORPA2Nmd8E7kfGGr0t148cuJKFEvZbkHMijM9yGtQ5Qo5w1A9mM JbwXvRNxgzrkeqIQwzz5w652QcLuSzEZX0kWv2DSyciE/TTC9acdGT3iN8WmoiOGpGYV PO+i6hgsCNWoeUwMJG/oDPF7/j+jHyrlozkx/yOTABwEtgp85S+bXmW/GbkVH0HHPjfm 8juZUwms6wl7BiEBtTr1aGuzIPFpY77nACxEfKi4jh4xyjR7dzu60BBS/UhvufJJXbO1 HKZg== X-Gm-Message-State: AOAM530bFyxmAyaW/s44LasdSYo1n1n9mdRCr6PUjNyYzTAOBGca60s+ OC2aKa6+aYhIJsEpsDEyy5fOvwrSx/ZvTQ== X-Received: by 2002:a63:f44e:: with SMTP id p14mr907444pgk.143.1626311441292; Wed, 14 Jul 2021 18:10:41 -0700 (PDT) Received: from localhost ([2620:15c:202:201:20b7:5dcc:d530:a8df]) by smtp.gmail.com with UTF8SMTPSA id q21sm4124229pff.55.2021.07.14.18.10.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jul 2021 18:10:40 -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 1/4] doc: Add error-codes.txt to describe error codes of D-Bus method returns Date: Wed, 14 Jul 2021 18:09:49 -0700 Message-Id: <20210714180917.BlueZ.v3.1.Ide6362da19898d001b053656ee8bf76e183633d8@changeid> X-Mailer: git-send-email 2.32.0.93.g670b81a890-goog In-Reply-To: <20210715010951.963176-1-mcchou@chromium.org> References: <20210715010951.963176-1-mcchou@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org (no changes since v1) doc/error-code.txt | 266 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 266 insertions(+) create mode 100644 doc/error-code.txt diff --git a/doc/error-code.txt b/doc/error-code.txt new file mode 100644 index 000000000..af8300467 --- /dev/null +++ b/doc/error-code.txt @@ -0,0 +1,266 @@ +D-Bus Method Return Error Codes +=============================== + +The motivation of having detailed error codes is to provide context-based +failure reasons along with D-Bus method return so that D-Bus clients can +build metrics and optimize their application based on these failure reasons. +For instance, a client can build retry mechanism for a connection failure or +improve the bottleneck of use scenario based on actionable metrics. + +These error codes are context-based but not necessarily tied to interface or +method calls. For instance, if a pairing request failed due to connection +failure, connection error would be attached to the method return of Pair(). + +BR/EDR connection already connected +=================================== + code: 0x0001 + errno: EALREADY, EISCONN + +Either the profile is already connected or ACL connection is in place. + +BR/EDR connection page timeout +============================== + code: 0x0002 + errno: EHOSTDOWN + +Failed due to page timeout. + +BR/EDR connection profile unavailable +===================================== + code: 0x0003 + errno: ENOPROTOOPT + +Failed to find connectable services or the target service. + +BR/EDR connection SDP search +============================ + code: 0x0004 + errno: none + +Failed to complete the SDP search. + +BR/EDR connection create socket +=============================== + code: 0x0005 + errno: EIO + +Failed to create or connect to BT IO socket. This can also indicate hardware +failure in the controller. + +BR/EDR connection invalid arguments +=================================== + code: 0x0006 + errno: EHOSTUNREACH + +Failed due to invalid arguments. + +BR/EDR connection not powered +============================= + code: 0x0007 + errno: EHOSTUNREACH + +Failed due to adapter not powered. + +BR/EDR connection not supported +=============================== + code: 0x0008 + errno: EOPNOTSUPP, EPROTONOSUPPORT + +Failed due to unsupported state transition of L2CAP channel or other features +either by the local host or the remote. + +BR/EDR connection bad socket +============================ + code: 0x0009 + errno: EBADFD + +Failed due to the socket is in bad state. + +BR/EDR connection memory allocation +=================================== + code: 0x000A + errno: ENOMEM + +Failed to allocate memory in either host stack or controller. + +BR/EDR connection busy +====================== + code: 0x000B + errno: EBUSY + +Failed due to other ongoing operations, such as pairing, busy L2CAP channel or +the operation disallowed by the controller. + +BR/EDR connection concurrent connection limit +============================================= + code: 0x000C + errno: EMLINK + +Failed due to reaching the concurrent connection limit to a device. + +BR/EDR connection timeout +========================= + code: 0x000D + errno: ETIMEDOUT + +Failed due to connection timeout + +BR/EDR connection refused +========================= + code: 0x000E + errno: ECONNREFUSED + +Refused by the remote device due to limited resource, security reason or +unacceptable address type. + +BR/EDR connection aborted by remote +=================================== + code: 0x000F + errno: ECONNRESET + +Terminated by the remote device due to limited resource or power off. + +BR/EDR connection aborted by local +================================== + code: 0x0010 + errno: ECONNABORTED + +Aborted by the local host. + +BR/EDR connection protocol error +================================ + code: 0x0011 + errno: EPROTO + +Failed due to LMP protocol error. + +BR/EDR connection canceled +========================== + code: 0x0012 + errno: none + +Failed due to cancellation caused by adapter drop, unexpected device drop, or +incoming disconnection request before connection request is completed. + +BR/EDR connection unknown error +=============================== + code: 0x0013 + errno: ENOSYS + +Failed due to unknown reason. + +LE connection invalid arguments +=============================== + code: 0x0101 + errno: EINVAL + +Failed due to invalid arguments. + +LE connection not powered +========================= + code: 0x0102 + errno: EHOSTUNREACH + +Failed due to adapter not powered. + +LE connection not supported +=========================== + code: 0x0103 + errno: EOPNOTSUPP, EPROTONOSUPPORT + +Failed due to unsupported state transition of L2CAP channel or other features +(e.g. LE features) either by the local host or the remote. + +LE connection already connected +=============================== + code: 0x0104 + errno: EALREADY, EISCONN + +Either the BT IO is already connected or LE link connection in place. + +LE connection bad socket +======================== + code: 0x0105 + errno: EBADFD + +Failed due to the socket is in bad state. + +LE connection memory allocation +=============================== + code: 0x0106 + errno: ENOMEM + +Failed to allocate memory in either host stack or controller. + +LE connection busy +================== + code: 0x0107 + errno: EBUSY + +Failed due to other ongoing operations, such as pairing, connecting, busy +L2CAP channel or the operation disallowed by the controller. + +LE connection refused +===================== + code: 0x0108 + errno: ECONNREFUSED + +Failed due to that LE is not enabled or the attempt is refused by the remote +device due to limited resource, security reason or unacceptable address type. + +LE connection create socket +=========================== + code: 0x0109 + errno: EIO + +Failed to create or connect to BT IO socket. This can also indicate hardware +failure in the controller. + +LE connection timeout +===================== + code: 0x010A + errno: ETIMEDOUT + +Failed due to connection timeout + +LE connection concurrent connection limit +========================================= + code: 0x010B + errno: EMLINK + +Failed due to reaching the synchronous connection limit to a device. + +LE connection abort by remote +============================= + code: 0x010C + errno: ECONNRESET + +Aborted by the remote device due to limited resource or power off. + +LE connection abort by local +============================ + code: 0x010D + errno: ECONNABORTED + +Aborted by the local host. + +LE connection link layer protocol error +======================================= + code: 0x010E + errno: EPROTO + +Failed due to link layer protocol error. + +LE connection GATT browsing +=========================== + code: 0x010F + errno: none + +Failed to complete the GATT browsing. + +LE connection unknown error +=========================== + code: 0x0110 + errno: ENOSYS + + Failed due to unknown reason. -- 2.32.0.93.g670b81a890-goog