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
The source of Connect() failures can be divided into the following
three.
- bluetoothd's device interface state transition and profile state
transition
- Kernel's L2CAP layer state transition
- Potential HCI error codes returned by the remote device
Reviewed-by: Alain Michaud <[email protected]>
Reviewed-by: Howard Chung <[email protected]>
---
Changes in v5:
- Replace uint16_t error code with string
Changes in v4:
- Address make errors
Changes in v3:
- Separate error-code.txt into its own commit
Changes in v2:
- Add error-code.txt
- Remove BtdError from return string
src/error.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++
src/error.h | 59 +++++++++++++++++++++++++++++++
2 files changed, 159 insertions(+)
diff --git a/src/error.c b/src/error.c
index 89517075e..411f36fcb 100644
--- a/src/error.c
+++ b/src/error.c
@@ -27,6 +27,8 @@
#include <config.h>
#endif
+#include <error.h>
+#include <stdio.h>
#include "gdbus/gdbus.h"
#include "error.h"
@@ -79,12 +81,24 @@ DBusMessage *btd_error_in_progress(DBusMessage *msg)
"In Progress");
}
+DBusMessage *btd_error_in_progress_str(DBusMessage *msg, const char *str)
+{
+ return g_dbus_create_error(msg, ERROR_INTERFACE ".InProgress",
+ "%s", str);
+}
+
DBusMessage *btd_error_not_available(DBusMessage *msg)
{
return g_dbus_create_error(msg, ERROR_INTERFACE ".NotAvailable",
"Operation currently not available");
}
+DBusMessage *btd_error_not_available_str(DBusMessage *msg, const char *str)
+{
+ return g_dbus_create_error(msg, ERROR_INTERFACE ".NotAvailable",
+ "%s", str);
+}
+
DBusMessage *btd_error_does_not_exist(DBusMessage *msg)
{
return g_dbus_create_error(msg, ERROR_INTERFACE ".DoesNotExist",
@@ -121,8 +135,94 @@ DBusMessage *btd_error_not_ready(DBusMessage *msg)
"Resource Not Ready");
}
+DBusMessage *btd_error_not_ready_str(DBusMessage *msg, const char *str)
+{
+ return g_dbus_create_error(msg, ERROR_INTERFACE ".NotReady",
+ "%s", str);
+}
+
DBusMessage *btd_error_failed(DBusMessage *msg, const char *str)
{
return g_dbus_create_error(msg, ERROR_INTERFACE
".Failed", "%s", str);
}
+
+const char* btd_error_bredr_conn_from_errno(int errno_code)
+{
+ switch (-errno_code) {
+ case EALREADY:
+ case EISCONN:
+ return ERR_BREDR_CONN_ALREADY_CONNECTED;
+ case EHOSTDOWN:
+ return ERR_BREDR_CONN_PAGE_TIMEOUT;
+ case ENOPROTOOPT:
+ return ERR_BREDR_CONN_PROFILE_UNAVAILABLE;
+ case EIO:
+ return ERR_BREDR_CONN_CREATE_SOCKET;
+ case EINVAL:
+ return ERR_BREDR_CONN_INVALID_ARGUMENTS;
+ case EHOSTUNREACH:
+ return ERR_BREDR_CONN_ADAPTER_NOT_POWERED;
+ case EOPNOTSUPP:
+ case EPROTONOSUPPORT:
+ return ERR_BREDR_CONN_NOT_SUPPORTED;
+ case EBADFD:
+ return ERR_BREDR_CONN_BAD_SOCKET;
+ case ENOMEM:
+ return ERR_BREDR_CONN_MEMORY_ALLOC;
+ case EBUSY:
+ return ERR_BREDR_CONN_BUSY;
+ case EMLINK:
+ return ERR_BREDR_CONN_CNCR_CONNECT_LIMIT;
+ case ETIMEDOUT:
+ return ERR_BREDR_CONN_TIMEOUT;
+ case ECONNREFUSED:
+ return ERR_BREDR_CONN_REFUSED;
+ case ECONNRESET:
+ return ERR_BREDR_CONN_ABORT_BY_REMOTE;
+ case ECONNABORTED:
+ return ERR_BREDR_CONN_ABORT_BY_LOCAL;
+ case EPROTO:
+ return ERR_BREDR_CONN_LMP_PROTO_ERROR;
+ default:
+ return ERR_BREDR_CONN_UNKNOWN;
+ }
+}
+
+const char* btd_error_le_conn_from_errno(int errno_code)
+{
+ switch (-errno_code) {
+ case EINVAL:
+ return ERR_LE_CONN_INVALID_ARGUMENTS;
+ case EHOSTUNREACH:
+ return ERR_LE_CONN_ADAPTER_NOT_POWERED;
+ case EOPNOTSUPP:
+ case EPROTONOSUPPORT:
+ return ERR_LE_CONN_NOT_SUPPORTED;
+ case EALREADY:
+ case EISCONN:
+ return ERR_LE_CONN_ALREADY_CONNECTED;
+ case EBADFD:
+ return ERR_LE_CONN_BAD_SOCKET;
+ case ENOMEM:
+ return ERR_LE_CONN_MEMORY_ALLOC;
+ case EBUSY:
+ return ERR_LE_CONN_BUSY;
+ case ECONNREFUSED:
+ return ERR_LE_CONN_REFUSED;
+ case EIO:
+ return ERR_LE_CONN_CREATE_SOCKET;
+ case ETIMEDOUT:
+ return ERR_LE_CONN_TIMEOUT;
+ case EMLINK:
+ return ERR_LE_CONN_SYNC_CONNECT_LIMIT;
+ case ECONNRESET:
+ return ERR_LE_CONN_ABORT_BY_REMOTE;
+ case ECONNABORTED:
+ return ERR_LE_CONN_ABORT_BY_LOCAL;
+ case EPROTO:
+ return ERR_LE_CONN_LL_PROTO_ERROR;
+ default:
+ return ERR_LE_CONN_UNKNOWN;
+ }
+}
diff --git a/src/error.h b/src/error.h
index 7c8cad066..91a02654a 100644
--- a/src/error.h
+++ b/src/error.h
@@ -24,9 +24,62 @@
*/
#include <dbus/dbus.h>
+#include <stdint.h>
#define ERROR_INTERFACE "org.bluez.Error"
+/* BR/EDR connection failure reasons */
+#define ERR_BREDR_CONN_ALREADY_CONNECTED "BR/EDR connection already "\
+ "connected"
+#define ERR_BREDR_CONN_PAGE_TIMEOUT "BR/EDR connection page timeout"
+#define ERR_BREDR_CONN_PROFILE_UNAVAILABLE "BR/EDR connection profile "\
+ "unavailable"
+#define ERR_BREDR_CONN_SDP_SEARCH "BR/EDR connection SDP search"
+#define ERR_BREDR_CONN_CREATE_SOCKET "BR/EDR connection create "\
+ "socket"
+#define ERR_BREDR_CONN_INVALID_ARGUMENTS "BR/EDR connection invalid "\
+ "argument"
+#define ERR_BREDR_CONN_ADAPTER_NOT_POWERED "BR/EDR connection adapter "\
+ "not powered"
+#define ERR_BREDR_CONN_NOT_SUPPORTED "BR/EDR connection not "\
+ "suuported"
+#define ERR_BREDR_CONN_BAD_SOCKET "BR/EDR connection bad socket"
+#define ERR_BREDR_CONN_MEMORY_ALLOC "BR/EDR connection memory "\
+ "allocation"
+#define ERR_BREDR_CONN_BUSY "BR/EDR connection busy"
+#define ERR_BREDR_CONN_CNCR_CONNECT_LIMIT "BR/EDR connection concurrent "\
+ "connection limit"
+#define ERR_BREDR_CONN_TIMEOUT "BR/EDR connection timeout"
+#define ERR_BREDR_CONN_REFUSED "BR/EDR connection refused"
+#define ERR_BREDR_CONN_ABORT_BY_REMOTE "BR/EDR connection aborted by "\
+ "remote"
+#define ERR_BREDR_CONN_ABORT_BY_LOCAL "BR/EDR connection aborted by "\
+ "local"
+#define ERR_BREDR_CONN_LMP_PROTO_ERROR "BR/EDR connection LMP "\
+ "protocol error"
+#define ERR_BREDR_CONN_CANCELED "BR/EDR connection canceled"
+#define ERR_BREDR_CONN_UNKNOWN "BR/EDR connection unknown"
+
+/* LE connection failure reasons */
+#define ERR_LE_CONN_INVALID_ARGUMENTS "LE connection invalid arguments"
+#define ERR_LE_CONN_ADAPTER_NOT_POWERED "LE connection adapter not powered"
+#define ERR_LE_CONN_NOT_SUPPORTED "LE connection not supported"
+#define ERR_LE_CONN_ALREADY_CONNECTED "LE connection already connected"
+#define ERR_LE_CONN_BAD_SOCKET "LE connection bad socket"
+#define ERR_LE_CONN_MEMORY_ALLOC "LE connection memory allocation"
+#define ERR_LE_CONN_BUSY "LE connection busy"
+#define ERR_LE_CONN_REFUSED "LE connection refused"
+#define ERR_LE_CONN_CREATE_SOCKET "LE connection create socket"
+#define ERR_LE_CONN_TIMEOUT "LE connection timeout"
+#define ERR_LE_CONN_SYNC_CONNECT_LIMIT "LE connection concurrent connection "\
+ "limit"
+#define ERR_LE_CONN_ABORT_BY_REMOTE "LE connection abort by remote"
+#define ERR_LE_CONN_ABORT_BY_LOCAL "LE connection abort by local"
+#define ERR_LE_CONN_LL_PROTO_ERROR "LE connection link layer protocol "\
+ "error"
+#define ERR_LE_CONN_GATT_BROWSE "LE connection GATT browsing"
+#define ERR_LE_CONN_UNKNOWN "LE connection unknown"
+
DBusMessage *btd_error_invalid_args(DBusMessage *msg);
DBusMessage *btd_error_invalid_args_str(DBusMessage *msg, const char *str);
DBusMessage *btd_error_busy(DBusMessage *msg);
@@ -35,11 +88,17 @@ DBusMessage *btd_error_not_supported(DBusMessage *msg);
DBusMessage *btd_error_not_connected(DBusMessage *msg);
DBusMessage *btd_error_already_connected(DBusMessage *msg);
DBusMessage *btd_error_not_available(DBusMessage *msg);
+DBusMessage *btd_error_not_available_str(DBusMessage *msg, const char *str);
DBusMessage *btd_error_in_progress(DBusMessage *msg);
+DBusMessage *btd_error_in_progress_str(DBusMessage *msg, const char *str);
DBusMessage *btd_error_does_not_exist(DBusMessage *msg);
DBusMessage *btd_error_not_authorized(DBusMessage *msg);
DBusMessage *btd_error_not_permitted(DBusMessage *msg, const char *str);
DBusMessage *btd_error_no_such_adapter(DBusMessage *msg);
DBusMessage *btd_error_agent_not_available(DBusMessage *msg);
DBusMessage *btd_error_not_ready(DBusMessage *msg);
+DBusMessage *btd_error_not_ready_str(DBusMessage *msg, const char *str);
DBusMessage *btd_error_failed(DBusMessage *msg, const char *str);
+
+const char* btd_error_bredr_conn_from_errno(int errno_code);
+const char* btd_error_le_conn_from_errno(int errno_code);
--
2.32.0.605.g8dce9f2422-goog
This replaces generic strerror message with context detailed error
string to better indicate the detailed failure reason so that the D-Bus
clients can optimize their application to work better with BlueZ, e.g.
introducing retry mechanism or building metrics.
Reviewed-by: Alain Michaud <[email protected]>
Reviewed-by: Howard Chung <[email protected]>
---
Changes in v5:
- Address the changes from error code to string
src/device.c | 46 ++++++++++++++++++++++++++++++----------------
1 file changed, 30 insertions(+), 16 deletions(-)
diff --git a/src/device.c b/src/device.c
index df440ce09..d4795dd6a 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1608,7 +1608,7 @@ void device_request_disconnect(struct btd_device *device, DBusMessage *msg)
if (device->connect) {
DBusMessage *reply = btd_error_failed(device->connect,
- "Cancelled");
+ ERR_BREDR_CONN_CANCELED);
g_dbus_send_message(dbus_conn, reply);
dbus_message_unref(device->connect);
device->connect = NULL;
@@ -1802,7 +1802,8 @@ done:
}
g_dbus_send_message(dbus_conn,
- btd_error_failed(dev->connect, strerror(-err)));
+ btd_error_failed(dev->connect,
+ btd_error_bredr_conn_from_errno(err)));
} else {
/* Start passive SDP discovery to update known services */
if (dev->bredr && !dev->svc_refreshed && dev->refresh_discovery)
@@ -2003,10 +2004,12 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
dbus_message_get_sender(msg));
if (dev->pending || dev->connect || dev->browse)
- return btd_error_in_progress(msg);
+ return btd_error_in_progress_str(msg, ERR_BREDR_CONN_BUSY);
- if (!btd_adapter_get_powered(dev->adapter))
- return btd_error_not_ready(msg);
+ if (!btd_adapter_get_powered(dev->adapter)) {
+ return btd_error_not_ready_str(msg,
+ ERR_BREDR_CONN_ADAPTER_NOT_POWERED);
+ }
btd_device_set_temporary(dev, false);
@@ -2019,10 +2022,12 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
if (dbus_message_is_method_call(msg, DEVICE_INTERFACE,
"Connect") &&
find_service_with_state(dev->services,
- BTD_SERVICE_STATE_CONNECTED))
+ BTD_SERVICE_STATE_CONNECTED)) {
return dbus_message_new_method_return(msg);
- else
- return btd_error_not_available(msg);
+ } else {
+ return btd_error_not_available_str(msg,
+ ERR_BREDR_CONN_PROFILE_UNAVAILABLE);
+ }
}
goto resolve_services;
@@ -2032,7 +2037,8 @@ static DBusMessage *connect_profiles(struct btd_device *dev, uint8_t bdaddr_type
if (err < 0) {
if (err == -EALREADY)
return dbus_message_new_method_return(msg);
- return btd_error_failed(msg, strerror(-err));
+ return btd_error_failed(msg,
+ btd_error_bredr_conn_from_errno(err));
}
dev->connect = dbus_message_ref(msg);
@@ -2046,8 +2052,10 @@ resolve_services:
err = device_browse_sdp(dev, msg);
else
err = device_browse_gatt(dev, msg);
- if (err < 0)
- return btd_error_failed(msg, strerror(-err));
+ if (err < 0) {
+ return btd_error_failed(msg, bdaddr_type == BDADDR_BREDR ?
+ ERR_BREDR_CONN_SDP_SEARCH : ERR_LE_CONN_GATT_BROWSE);
+ }
return NULL;
}
@@ -2157,8 +2165,10 @@ static DBusMessage *connect_profile(DBusConnection *conn, DBusMessage *msg,
DBusMessage *reply;
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &pattern,
- DBUS_TYPE_INVALID))
- return btd_error_invalid_args(msg);
+ DBUS_TYPE_INVALID)) {
+ return btd_error_invalid_args_str(msg,
+ ERR_BREDR_CONN_INVALID_ARGUMENTS);
+ }
uuid = bt_name2string(pattern);
reply = connect_profiles(dev, BDADDR_BREDR, msg, uuid);
@@ -2541,7 +2551,10 @@ static void browse_request_complete(struct browse_req *req, uint8_t type,
if (err == 0)
goto done;
}
- reply = btd_error_failed(req->msg, strerror(-err));
+ reply = btd_error_failed(req->msg,
+ bdaddr_type == BDADDR_BREDR ?
+ btd_error_bredr_conn_from_errno(err) :
+ btd_error_le_conn_from_errno(err));
goto done;
}
@@ -3027,7 +3040,8 @@ void device_remove_connection(struct btd_device *device, uint8_t bdaddr_type)
*/
if (device->connect) {
DBG("connection removed while Connect() is waiting reply");
- reply = btd_error_failed(device->connect, "Disconnected early");
+ reply = btd_error_failed(device->connect,
+ ERR_BREDR_CONN_CANCELED);
g_dbus_send_message(dbus_conn, reply);
dbus_message_unref(device->connect);
device->connect = NULL;
@@ -5414,7 +5428,7 @@ done:
if (device->connect) {
if (err < 0)
reply = btd_error_failed(device->connect,
- strerror(-err));
+ btd_error_le_conn_from_errno(err));
else
reply = dbus_message_new_method_return(device->connect);
--
2.32.0.605.g8dce9f2422-goog
Hi Miao-chen,
> The source of Connect() failures can be divided into the following
> three.
> - bluetoothd's device interface state transition and profile state
> transition
> - Kernel's L2CAP layer state transition
> - Potential HCI error codes returned by the remote device
>
> Reviewed-by: Alain Michaud <[email protected]>
> Reviewed-by: Howard Chung <[email protected]>
> ---
>
> Changes in v5:
> - Replace uint16_t error code with string
>
> Changes in v4:
> - Address make errors
>
> Changes in v3:
> - Separate error-code.txt into its own commit
>
> Changes in v2:
> - Add error-code.txt
> - Remove BtdError from return string
>
> src/error.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> src/error.h | 59 +++++++++++++++++++++++++++++++
> 2 files changed, 159 insertions(+)
>
> diff --git a/src/error.c b/src/error.c
> index 89517075e..411f36fcb 100644
> --- a/src/error.c
> +++ b/src/error.c
> @@ -27,6 +27,8 @@
> #include <config.h>
> #endif
>
> +#include <error.h>
> +#include <stdio.h>
> #include "gdbus/gdbus.h"
>
> #include "error.h"
> @@ -79,12 +81,24 @@ DBusMessage *btd_error_in_progress(DBusMessage *msg)
> "In Progress");
> }
>
> +DBusMessage *btd_error_in_progress_str(DBusMessage *msg, const char *str)
> +{
> + return g_dbus_create_error(msg, ERROR_INTERFACE ".InProgress",
> + "%s", str);
> +}
> +
> DBusMessage *btd_error_not_available(DBusMessage *msg)
> {
> return g_dbus_create_error(msg, ERROR_INTERFACE ".NotAvailable",
> "Operation currently not available");
> }
>
> +DBusMessage *btd_error_not_available_str(DBusMessage *msg, const char *str)
> +{
> + return g_dbus_create_error(msg, ERROR_INTERFACE ".NotAvailable",
> + "%s", str);
> +}
> +
> DBusMessage *btd_error_does_not_exist(DBusMessage *msg)
> {
> return g_dbus_create_error(msg, ERROR_INTERFACE ".DoesNotExist",
> @@ -121,8 +135,94 @@ DBusMessage *btd_error_not_ready(DBusMessage *msg)
> "Resource Not Ready");
> }
>
> +DBusMessage *btd_error_not_ready_str(DBusMessage *msg, const char *str)
> +{
> + return g_dbus_create_error(msg, ERROR_INTERFACE ".NotReady",
> + "%s", str);
> +}
> +
> DBusMessage *btd_error_failed(DBusMessage *msg, const char *str)
> {
> return g_dbus_create_error(msg, ERROR_INTERFACE
> ".Failed", "%s", str);
> }
> +
> +const char* btd_error_bredr_conn_from_errno(int errno_code)
> +{
> + switch (-errno_code) {
> + case EALREADY:
> + case EISCONN:
> + return ERR_BREDR_CONN_ALREADY_CONNECTED;
> + case EHOSTDOWN:
> + return ERR_BREDR_CONN_PAGE_TIMEOUT;
> + case ENOPROTOOPT:
> + return ERR_BREDR_CONN_PROFILE_UNAVAILABLE;
> + case EIO:
> + return ERR_BREDR_CONN_CREATE_SOCKET;
> + case EINVAL:
> + return ERR_BREDR_CONN_INVALID_ARGUMENTS;
> + case EHOSTUNREACH:
> + return ERR_BREDR_CONN_ADAPTER_NOT_POWERED;
> + case EOPNOTSUPP:
> + case EPROTONOSUPPORT:
> + return ERR_BREDR_CONN_NOT_SUPPORTED;
> + case EBADFD:
> + return ERR_BREDR_CONN_BAD_SOCKET;
> + case ENOMEM:
> + return ERR_BREDR_CONN_MEMORY_ALLOC;
> + case EBUSY:
> + return ERR_BREDR_CONN_BUSY;
> + case EMLINK:
> + return ERR_BREDR_CONN_CNCR_CONNECT_LIMIT;
> + case ETIMEDOUT:
> + return ERR_BREDR_CONN_TIMEOUT;
> + case ECONNREFUSED:
> + return ERR_BREDR_CONN_REFUSED;
> + case ECONNRESET:
> + return ERR_BREDR_CONN_ABORT_BY_REMOTE;
> + case ECONNABORTED:
> + return ERR_BREDR_CONN_ABORT_BY_LOCAL;
> + case EPROTO:
> + return ERR_BREDR_CONN_LMP_PROTO_ERROR;
> + default:
> + return ERR_BREDR_CONN_UNKNOWN;
> + }
> +}
> +
> +const char* btd_error_le_conn_from_errno(int errno_code)
> +{
> + switch (-errno_code) {
> + case EINVAL:
> + return ERR_LE_CONN_INVALID_ARGUMENTS;
> + case EHOSTUNREACH:
> + return ERR_LE_CONN_ADAPTER_NOT_POWERED;
> + case EOPNOTSUPP:
> + case EPROTONOSUPPORT:
> + return ERR_LE_CONN_NOT_SUPPORTED;
> + case EALREADY:
> + case EISCONN:
> + return ERR_LE_CONN_ALREADY_CONNECTED;
> + case EBADFD:
> + return ERR_LE_CONN_BAD_SOCKET;
> + case ENOMEM:
> + return ERR_LE_CONN_MEMORY_ALLOC;
> + case EBUSY:
> + return ERR_LE_CONN_BUSY;
> + case ECONNREFUSED:
> + return ERR_LE_CONN_REFUSED;
> + case EIO:
> + return ERR_LE_CONN_CREATE_SOCKET;
> + case ETIMEDOUT:
> + return ERR_LE_CONN_TIMEOUT;
> + case EMLINK:
> + return ERR_LE_CONN_SYNC_CONNECT_LIMIT;
> + case ECONNRESET:
> + return ERR_LE_CONN_ABORT_BY_REMOTE;
> + case ECONNABORTED:
> + return ERR_LE_CONN_ABORT_BY_LOCAL;
> + case EPROTO:
> + return ERR_LE_CONN_LL_PROTO_ERROR;
> + default:
> + return ERR_LE_CONN_UNKNOWN;
> + }
> +}
> diff --git a/src/error.h b/src/error.h
> index 7c8cad066..91a02654a 100644
> --- a/src/error.h
> +++ b/src/error.h
> @@ -24,9 +24,62 @@
> */
>
> #include <dbus/dbus.h>
> +#include <stdint.h>
>
> #define ERROR_INTERFACE "org.bluez.Error"
>
> +/* BR/EDR connection failure reasons */
> +#define ERR_BREDR_CONN_ALREADY_CONNECTED "BR/EDR connection already "\
> + "connected"
> +#define ERR_BREDR_CONN_PAGE_TIMEOUT "BR/EDR connection page timeout"
> +#define ERR_BREDR_CONN_PROFILE_UNAVAILABLE "BR/EDR connection profile "\
> + "unavailable"
> +#define ERR_BREDR_CONN_SDP_SEARCH "BR/EDR connection SDP search"
> +#define ERR_BREDR_CONN_CREATE_SOCKET "BR/EDR connection create "\
> + "socket"
> +#define ERR_BREDR_CONN_INVALID_ARGUMENTS "BR/EDR connection invalid "\
> + "argument"
> +#define ERR_BREDR_CONN_ADAPTER_NOT_POWERED "BR/EDR connection adapter "\
> + "not powered"
> +#define ERR_BREDR_CONN_NOT_SUPPORTED "BR/EDR connection not "\
> + "suuported"
> +#define ERR_BREDR_CONN_BAD_SOCKET "BR/EDR connection bad socket"
> +#define ERR_BREDR_CONN_MEMORY_ALLOC "BR/EDR connection memory "\
> + "allocation"
> +#define ERR_BREDR_CONN_BUSY "BR/EDR connection busy"
> +#define ERR_BREDR_CONN_CNCR_CONNECT_LIMIT "BR/EDR connection concurrent "\
> + "connection limit"
> +#define ERR_BREDR_CONN_TIMEOUT "BR/EDR connection timeout"
> +#define ERR_BREDR_CONN_REFUSED "BR/EDR connection refused"
> +#define ERR_BREDR_CONN_ABORT_BY_REMOTE "BR/EDR connection aborted by "\
> + "remote"
> +#define ERR_BREDR_CONN_ABORT_BY_LOCAL "BR/EDR connection aborted by "\
> + "local"
> +#define ERR_BREDR_CONN_LMP_PROTO_ERROR "BR/EDR connection LMP "\
> + "protocol error"
> +#define ERR_BREDR_CONN_CANCELED "BR/EDR connection canceled"
> +#define ERR_BREDR_CONN_UNKNOWN "BR/EDR connection unknown"
> +
> +/* LE connection failure reasons */
> +#define ERR_LE_CONN_INVALID_ARGUMENTS "LE connection invalid arguments"
> +#define ERR_LE_CONN_ADAPTER_NOT_POWERED "LE connection adapter not powered"
> +#define ERR_LE_CONN_NOT_SUPPORTED "LE connection not supported"
> +#define ERR_LE_CONN_ALREADY_CONNECTED "LE connection already connected"
> +#define ERR_LE_CONN_BAD_SOCKET "LE connection bad socket"
> +#define ERR_LE_CONN_MEMORY_ALLOC "LE connection memory allocation"
> +#define ERR_LE_CONN_BUSY "LE connection busy"
> +#define ERR_LE_CONN_REFUSED "LE connection refused"
> +#define ERR_LE_CONN_CREATE_SOCKET "LE connection create socket"
> +#define ERR_LE_CONN_TIMEOUT "LE connection timeout"
> +#define ERR_LE_CONN_SYNC_CONNECT_LIMIT "LE connection concurrent connection "\
> + "limit"
> +#define ERR_LE_CONN_ABORT_BY_REMOTE "LE connection abort by remote"
> +#define ERR_LE_CONN_ABORT_BY_LOCAL "LE connection abort by local"
> +#define ERR_LE_CONN_LL_PROTO_ERROR "LE connection link layer protocol "\
> + "error"
> +#define ERR_LE_CONN_GATT_BROWSE "LE connection GATT browsing"
> +#define ERR_LE_CONN_UNKNOWN "LE connection unknown"
I rather have you use strings like “le-connection-not-supported” to make this similar to what we are using for other strings in the API.
And I am always torn between using “bredr-“ and just using “br-“.
Regards
Marcel