[Problem] ATT error code is not passed to application.
[Cause & Measure] GATT application need to know ATT
error code to handling error case. Specially application
error code defined by a higher layer specification.
[Checking Method] GATT error handling
Change-Id: I37747073962baa2b1098eb801ce033fb0b0c4c85
Signed-off-by: Gowtham Anandha Babu <gowtham.ab@samsung.com>
return BLUETOOTH_ERROR_NONE;
}
+static int __bluetooth_get_att_error_code(GError *error)
+{
+ int att_ecode = 0;
+ int len;
+ char *str = NULL;
+
+ BT_ERR("Error : %s", error->message);
+ str = g_strrstr(error->message, "ATT error: 0x");
+ if (str) {
+ len = strlen(str);
+ att_ecode = g_ascii_xdigit_value(str[len-2]) << 4;
+ att_ecode += g_ascii_xdigit_value(str[len-1]);
+ } else
+ return BLUETOOTH_ATT_ERROR_INTERNAL;
+
+ switch (att_ecode) {
+ case BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED:
+ BT_ERR("Read not permitted");
+ break;
+ case BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED:
+ BT_ERR("Write not permitted");
+ break;
+ case BLUETOOTH_ATT_ERROR_AUTHENTICATION:
+ break;
+ case BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION:
+ case BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE:
+ BT_ERR("Not paired");
+ break;
+ case BLUETOOTH_ATT_ERROR_INVALID_OFFSET:
+ BT_ERR("Invalid offset");
+ break;
+ case BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN:
+ BT_ERR("Invalid Length");
+ break;
+ case BLUETOOTH_ATT_ERROR_AUTHORIZATION:
+ BT_ERR("Operation not Authorized");
+ break;
+ }
+
+ if (att_ecode >= 0x80 && att_ecode <= 0x9F)
+ BT_ERR("Application error");
+
+ return att_ecode;
+}
+
static void __bluetooth_internal_read_cb(GObject *source_object,
GAsyncResult *res,
gpointer user_data)
GByteArray *gp_byte_array = NULL;
GVariantIter *iter;
guint8 g_byte;
- gint att_error_code;
- int ret = BLUETOOTH_ERROR_NONE;
+ int att_ecode = 0;
BT_DBG("+");
user_info = _bt_get_user_data(BT_COMMON);
system_gconn = _bt_gdbus_get_system_gconn();
value = g_dbus_connection_call_finish(system_gconn, res, &error);
+ char_value.char_handle = user_data;
if (error) {
- BT_ERR("Error : %s \n", error->message);
- if (g_strrstr(error->message, "Not paired"))
- ret = BLUETOOTH_ERROR_NOT_PAIRED;
- else
- ret = BLUETOOTH_ERROR_INTERNAL;
-
+ att_ecode = __bluetooth_get_att_error_code(error);
g_clear_error(&error);
if (user_info) {
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_READ_CHAR,
- ret, NULL,
- user_info->cb, user_info->user_data);
- }
- g_free(user_data);
- return;
- }
-
- char_value.char_handle = user_data;
-
- g_variant_get(value, "(yay)", &att_error_code, &iter);
-
- if (att_error_code != 0) {
- if (user_info) {
- _bt_common_event_cb(BLUETOOTH_EVENT_GATT_READ_CHAR,
- att_error_code, NULL,
+ att_ecode, NULL,
user_info->cb, user_info->user_data);
}
g_free(char_value.char_handle);
g_variant_unref(value);
- g_variant_iter_free(iter);
return;
}
+ g_variant_get(value, "(ay)", &iter);
+
gp_byte_array = g_byte_array_new();
while (g_variant_iter_loop(iter, "y", &g_byte))
g_byte_array_append(gp_byte_array, &g_byte, 1);
if (user_info) {
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_READ_CHAR,
- BLUETOOTH_ERROR_NONE, &char_value,
+ BLUETOOTH_ATT_ERROR_NONE, &char_value,
user_info->cb, user_info->user_data);
}
GATT_CHAR_INTERFACE,
"ReadValue",
g_variant_new("(a{sv})", builder),
- G_VARIANT_TYPE("(yay)"),
+ G_VARIANT_TYPE("(ay)"),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
bt_user_info_t *user_info;
GDBusConnection *system_gconn = NULL;
GVariant *value;
- int result = BLUETOOTH_ERROR_NONE;
- guint8 att_ecode = 0;
+ int att_ecode = BLUETOOTH_ATT_ERROR_NONE;
user_info = _bt_get_user_data(BT_COMMON);
value = g_dbus_connection_call_finish(system_gconn, res, &error);
if (error) {
- BT_ERR("Error : %s \n", error->message);
+ att_ecode = __bluetooth_get_att_error_code(error);
g_clear_error(&error);
- result = BLUETOOTH_ERROR_INTERNAL;
- } else {
- g_variant_get(value, "(y)", &att_ecode);
- if (att_ecode) {
- result = att_ecode;
- BT_ERR("ATT Error code: %d \n", att_ecode);
- }
}
if (user_info) {
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_WRITE_CHAR,
- result, NULL,
+ att_ecode, NULL,
user_info->cb, user_info->user_data);
} else {
BT_ERR("user info is null");
"WriteValue",
g_variant_new("(@ay@a{sv})",
val, options),
- G_VARIANT_TYPE("(y)"),
+ NULL,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL,
(GAsyncReadyCallback)__bluetooth_internal_write_cb,
"WriteValuebyType",
g_variant_new("(y@ay@a{sv})",
write_type, val, options),
- G_VARIANT_TYPE("(y)"),
+ NULL,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL,
(GAsyncReadyCallback)__bluetooth_internal_write_cb,
"WriteValue",
g_variant_new("(@ay@a{sv})",
val, options),
- G_VARIANT_TYPE("(y)"),
+ NULL,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL,
(GAsyncReadyCallback)__bluetooth_internal_write_cb,
user_info = _bt_get_user_data(BT_COMMON);
value = g_dbus_proxy_call_finish(proxy, res, &error);
+ characteristic.handle = user_data;
if (value == NULL) {
if (error != NULL) {
BLUETOOTH_ERROR_INTERNAL, NULL,
user_info->cb, user_info->user_data);
}
- g_free(user_data);
+ g_free(characteristic.handle);
g_object_unref(proxy);
return;
}
}
}
- characteristic.handle = user_data;
if (user_info) {
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_SVC_CHAR_DESC_DISCOVERED,
ret, &characteristic, user_info->cb, user_info->user_data);
}
bluetooth_gatt_free_char_property(&characteristic);
+ g_free(characteristic.handle);
g_variant_iter_free(char_iter);
g_variant_unref(value);
BT_DBG("-");
GByteArray *gp_byte_array = NULL;
GVariantIter *iter;
guint8 g_byte;
- gint att_error_code;
+ int att_ecode = 0;
BT_DBG("+");
user_info = _bt_get_user_data(BT_COMMON);
value = g_dbus_connection_call_finish(system_gconn, res, &error);
if (error) {
- BT_ERR("Error : %s \n", error->message);
+ att_ecode = __bluetooth_get_att_error_code(error);
g_clear_error(&error);
if (user_info) {
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_READ_DESC,
- BLUETOOTH_ERROR_INTERNAL, NULL,
+ att_ecode, NULL,
user_info->cb, user_info->user_data);
}
g_free(char_value.handle);
- return;
- }
-
- g_variant_get(value, "(yay)", &att_error_code, &iter);
-
- if (att_error_code != 0) {
- if (user_info) {
- _bt_common_event_cb(BLUETOOTH_EVENT_GATT_READ_DESC,
- att_error_code, NULL,
- user_info->cb, user_info->user_data);
- }
- g_free(char_value.handle);
g_variant_unref(value);
- g_variant_iter_free(iter);
return;
}
+ g_variant_get(value, "(ay)", &iter);
+
gp_byte_array = g_byte_array_new();
while (g_variant_iter_loop(iter, "y", &g_byte))
g_byte_array_append(gp_byte_array, &g_byte, 1);
if (user_info) {
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_READ_DESC,
- BLUETOOTH_ERROR_NONE, &char_value,
+ BLUETOOTH_ATT_ERROR_NONE, &char_value,
user_info->cb, user_info->user_data);
}
GATT_DESC_INTERFACE,
"ReadValue",
g_variant_new("(a{sv})", builder),
- G_VARIANT_TYPE("(yay)"),
+ G_VARIANT_TYPE("(ay)"),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
bt_user_info_t *user_info;
GDBusConnection *system_gconn = NULL;
GVariant *value;
- int result = BLUETOOTH_ERROR_NONE;
- guint8 att_ecode = 0;
+ int att_ecode = BLUETOOTH_ATT_ERROR_NONE;
BT_DBG("+");
user_info = _bt_get_user_data(BT_COMMON);
value = g_dbus_connection_call_finish(system_gconn, res, &error);
if (error) {
- BT_ERR("Error : %s \n", error->message);
+ att_ecode = __bluetooth_get_att_error_code(error);
g_clear_error(&error);
- result = BLUETOOTH_ERROR_INTERNAL;
- } else {
- g_variant_get(value, "(y)", &att_ecode);
- if (att_ecode) {
- result = att_ecode;
- BT_ERR("ATT Error code: %d \n", att_ecode);
- }
}
if (user_info) {
_bt_common_event_cb(BLUETOOTH_EVENT_GATT_WRITE_DESC,
- result, NULL,
+ att_ecode, NULL,
user_info->cb, user_info->user_data);
}
"WriteValue",
g_variant_new("(@ay@a{sv})",
val, options),
- G_VARIANT_TYPE("(y)"),
+ NULL,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL,
(GAsyncReadyCallback)__bluetooth_internal_write_desc_cb,
return BLUETOOTH_ERROR_INTERNAL;
}
- if (resp_state != BLUETOOTH_ERROR_NONE) {
+ if (resp_state != BLUETOOTH_ATT_ERROR_NONE) {
BT_ERR("resp_state is 0x%X", resp_state);
switch (resp_state) {
- case BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED:
+ case BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED:
g_dbus_method_invocation_return_dbus_error(req_info->context,
"org.bluez.Error.Failed", "Write Request Rejected");
break;
- case BLUETOOTH_ERROR_OBJECT_NOT_SELECTED:
+ case BLUETOOTH_ATT_ERROR_OBJECT_NOT_SELECTED:
g_dbus_method_invocation_return_dbus_error(req_info->context,
"org.bluez.Error.Failed", "Object Not Selected");
break;
- case BLUETOOTH_ERROR_CONCURRENCY_LIMIT_EXCEEDED:
+ case BLUETOOTH_ATT_ERROR_CONCURRENCY_LIMIT_EXCEEDED:
g_dbus_method_invocation_return_dbus_error(req_info->context,
"org.bluez.Error.Failed", "Concurrency Limit Exceeded");
break;
- case BLUETOOTH_ERROR_OBJECT_NAME_EXISITS:
+ case BLUETOOTH_ATT_ERROR_OBJECT_NAME_EXISTS:
g_dbus_method_invocation_return_dbus_error(req_info->context,
"org.bluez.Error.Failed", "Object Name Already Exists");
break;
- case BLUETOOTH_ERROR_CCC_IMPROPERLY_CONFIGURED:
+ case BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED:
g_dbus_method_invocation_return_dbus_error(req_info->context,
"org.bluez.Error.Failed", "CCC Improperly Configured");
break;
(GSourceFunc)__bt_oacp_create_timeout_cb, NULL);
break;
case OACP_DELETE:
- if (opcode == OACP_DELETE &&
- ~(selected_object->props & OBJECT_DELETE)) {
+ if (!(selected_object->props & OBJECT_DELETE)) {
ret = OACP_PROCEDURE_NOT_SUPPORTED;
goto fail;
}
ret = OACP_OPCODE_NOT_SUPPORTED;
break;
case OACP_EXECUTE:
- if (opcode == OACP_EXECUTE &&
- ~(selected_object->props & OBJECT_EXECUTE)) {
+ if (!(selected_object->props & OBJECT_EXECUTE)) {
ret = OACP_PROCEDURE_NOT_SUPPORTED;
goto fail;
}
case OACP_READ:
case OACP_WRITE:
if (opcode == OACP_WRITE &&
- ~(selected_object->props & OBJECT_WRITE)) {
+ !(selected_object->props & OBJECT_WRITE)) {
ret = OACP_PROCEDURE_NOT_SUPPORTED;
goto fail;
}
if (opcode == OACP_READ &&
- ~(selected_object->props & OBJECT_READ)) {
+ !(selected_object->props & OBJECT_READ)) {
ret = OACP_PROCEDURE_NOT_SUPPORTED;
goto fail;
}
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED ;
filename = g_strndup(value, len);
snprintf(new_abs_filepath, strlen(new_abs_filepath), "%s%s",
directory, object->name);
if (rename(old_abs_filepath, new_abs_filepath)) {
- ret = OBJECT_NAME_ALREADY_EXISTS;
+ ret = BLUETOOTH_ATT_ERROR_OBJECT_NAME_EXISTS;
goto fail;
}
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
year = (uint16_t)(value[1] & 0xFF) << 8 |
(uint16_t)(value[0] & 0xFF);
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
year = (uint16_t)(value[1] & 0xFF) << 8 |
(uint16_t)(value[0] & 0xFF);
/* Any attempt to write RFU bits is error */
if (value[1] || value[2] || value[3])
- return BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
props = (uint32_t)(value[3] & 0xFF) << 24 |
(uint32_t)(value[2] & 0xFF) << 16 |
if (g_strcmp0(obj_path, otp_feature_obj_path)) {
if (!selected_object) {
- return BLUETOOTH_ERROR_OBJECT_NOT_SELECTED;
+ return BLUETOOTH_ATT_ERROR_OBJECT_NOT_SELECTED;
}
}
value[1] = info->req_opcode & 0xFF;
value[2] = info->result_code & 0xFF;
if (info->resp_param) {
- value[6] = (info->resp_param[3] >> 24) & 0xFF;
- value[5] = (info->resp_param[4] >> 16) & 0xFF;
- value[4] = (info->resp_param[5] >> 8) & 0xFF;
+ value[6] = info->resp_param[3] & 0xFF;
+ value[5] = info->resp_param[4] & 0xFF;
+ value[4] = info->resp_param[5] & 0xFF;
value[3] = info->resp_param[6] & 0xFF;
length = OTP_INDICATION_LEN_WITH_RESP;
}
if (len != 0) {
if (!g_strcmp0(char_path, otp_oacp_obj_path)) {
if (!OACP_indicate)
- result = BLUETOOTH_ERROR_CCC_IMPROPERLY_CONFIGURED;
+ result = BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED;
else
result = _bt_otp_oacp_write_cb(value, len, offset, addr, &info);
} else if (!g_strcmp0(char_path, otp_olcp_obj_path)) {
if (!OLCP_indicate)
- result = BLUETOOTH_ERROR_CCC_IMPROPERLY_CONFIGURED;
+ result = BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED;
else
result = _bt_otp_olcp_write_cb(value, len, offset, &info);
} else if (!g_strcmp0(char_path, otp_object_name_obj_path)) {
#define OTP_CP_CCC_DESC_UUID "2902"
-/* OTP Error codes */
-#define WRITE_REQUEST_REJECTED 0X80
-#define OBJECT_NOT_SELECTED 0X81
-#define CONCURRENCY_LIMIT_EXCEEDED 0X82
-#define OBJECT_NAME_ALREADY_EXISTS 0X83
-
/* OTP Object Type Custom UUIDs */
/* In SIG Assigned numbers not available */
#define UNSUPPORTED_OBJECT_TYPE_UUID "000019aa-0000-1001-8000-00805f9b34fb"
g_free(info);
}
+static int __bluetooth_get_att_error_code(GError *error)
+{
+ int att_ecode = 0;
+ int len;
+ char *str = NULL;
+
+ BT_ERR("Error : %s", error->message);
+ str = g_strrstr(error->message, "ATT error: 0x");
+ if (str) {
+ len = strlen(str);
+ att_ecode = g_ascii_xdigit_value(str[len-2]) << 4;
+ att_ecode += g_ascii_xdigit_value(str[len-1]);
+ } else
+ return BLUETOOTH_ATT_ERROR_INTERNAL;
+
+ return att_ecode;
+}
+
static void __bt_otp_read_char_cb(GObject *source_object,
GAsyncResult *res, gpointer user_data)
{
bt_gatt_char_descriptor_property_t att_value = { 0, };
GDBusConnection *system_gconn = NULL;
GVariant *var_data, *param = NULL;
- int result = BLUETOOTH_ERROR_NONE;
+ int result = BLUETOOTH_ATT_ERROR_NONE;
bt_otp_read_req_info *info = NULL;
GByteArray *gp_byte_array = NULL;
request_info_t *req_info = NULL;
char *otp_data = NULL;
GVariant *out_param1;
GError *error = NULL;
- guint8 g_byte, att_error_code;
+ guint8 g_byte;
char *handle;
BT_DBG("+");
value = g_dbus_connection_call_finish(system_gconn, res, &error);
if (error) {
- BT_ERR("Error : %s \n", error->message);
+ result = __bluetooth_get_att_error_code(error);
att_value.val_len = 0;
- result = BLUETOOTH_ERROR_INTERNAL;
goto dbus_return;
}
- g_variant_get(value, "(yay)", &att_error_code, &iter);
-
- if (att_error_code != 0) {
- BT_ERR("ATT err code : [%d]", att_error_code);
- att_value.val_len = 0;
- result = att_error_code;
- goto dbus_return;
- }
+ g_variant_get(value, "(ay)", &iter);
gp_byte_array = g_byte_array_new();
GATT_CHAR_INTERFACE,
"ReadValue",
g_variant_new("(a{sv})", builder),
- G_VARIANT_TYPE("(yay)"),
+ G_VARIANT_TYPE("(ay)"),
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
GVariant *value = NULL;
GVariant *param = NULL;
GVariant *out_param1 = NULL;
- int result = BLUETOOTH_ERROR_NONE;
+ int result = BLUETOOTH_ATT_ERROR_NONE;
char *handle = NULL;
bt_otp_notification_info *info = NULL;
request_info_t *req_info = NULL;
- guint8 att_ecode = 0;
BT_DBG("+");
system_gconn = _bt_gdbus_get_system_gconn();
value = g_dbus_connection_call_finish(system_gconn, res, &error);
- if (error) {
- BT_ERR("Error : %s \n", error->message);
- /* Process error->message to narrow down the att_ecode */
- result = BLUETOOTH_ERROR_INTERNAL;
- } else {
- g_variant_get(value, "(y)", &att_ecode);
- if (att_ecode) {
- result = att_ecode;
- BT_ERR("ATT Error code: %d \n", att_ecode);
- }
- }
+ if (error)
+ result = __bluetooth_get_att_error_code(error);
handle = (char *)user_data;
info = __bt_otp_get_notification_info(handle);
req_info = _bt_get_request_info(info->req_id);
/* Is Activation request failed for any reason, reset timer */
- if (result != BLUETOOTH_ERROR_NONE && info != NULL) {
+ if (result != BLUETOOTH_ATT_ERROR_NONE && info != NULL) {
BT_ERR("Activation Request failed");
/* Remove Indication Info */
__bt_otp_remove_notification_info(info);
#define BLUETOOTH_ERROR_DEVICE_POLICY_RESTRICTION ((int)BLUETOOTH_ERROR_BASE - 0x28)
/**< Device Policy Restricted */
+/**
+* Error codes for ATT Error response *
+*/
+#define BLUETOOTH_ATT_ERROR_INTERNAL -1
+#define BLUETOOTH_ATT_ERROR_NONE 0x00
+#define BLUETOOTH_ATT_ERROR_INVALID_HANDLE 0x01
+#define BLUETOOTH_ATT_ERROR_READ_NOT_PERMITTED 0x02
+#define BLUETOOTH_ATT_ERROR_WRITE_NOT_PERMITTED 0x03
+#define BLUETOOTH_ATT_ERROR_INVALID_PDU 0x04
+#define BLUETOOTH_ATT_ERROR_AUTHENTICATION 0x05
+#define BLUETOOTH_ATT_ERROR_REQUEST_NOT_SUPPORTED 0x06
+#define BLUETOOTH_ATT_ERROR_INVALID_OFFSET 0x07
+#define BLUETOOTH_ATT_ERROR_AUTHORIZATION 0x08
+#define BLUETOOTH_ATT_ERROR_PREPARE_QUEUE_FULL 0x09
+#define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_FOUND 0x0A
+#define BLUETOOTH_ATT_ERROR_ATTRIBUTE_NOT_LONG 0x0B
+#define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 0x0C
+#define BLUETOOTH_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN 0x0D
+#define BLUETOOTH_ATT_ERROR_UNLIKELY 0x0E
+#define BLUETOOTH_ATT_ERROR_INSUFFICIENT_ENCRYPTION 0x0F
+#define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
+#define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
+/* Common profile error codes */
+#define BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED 0x80
+#define BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 0xFD
+#define BLUETOOTH_ATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 0xFE
+#define BLUETOOTH_ATT_ERROR_OUT_OF_RANGE 0xFF
+
+/*
+ * Bluetooth ATT error codes specific to OTP
+ */
+#define BLUETOOTH_ATT_ERROR_OBJECT_NOT_SELECTED 0x81
+#define BLUETOOTH_ATT_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
+#define BLUETOOTH_ATT_ERROR_OBJECT_NAME_EXISTS 0x83
+
+/*
+ * Bluetooth OTP error codes
+ * TODO: Check error code conflict
+ */
+#define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
+#define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
/**
* Device disconnection reasons; received from stack
#define BLUETOOTH_ERROR_CONNECTION_TERMINATED_DUE_TO_MIC_FAILURE 0x3d
#define BLUETOOTH_ERROR_CONNECTION_FAILED_TO_BE_ESTABLISHED 0x3e
-/*
- * Bluetooth OTP error codes
- */
-#define BLUETOOTH_ERROR_INVALID_DIRECTORY 0x01
-#define BLUETOOTH_ERROR_NO_OBJECTS_FOUND 0x02
-#define BLUETOOTH_ERROR_WRITE_REQUEST_REJECTED 0x80
-#define BLUETOOTH_ERROR_OBJECT_NOT_SELECTED 0x81
-#define BLUETOOTH_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
-#define BLUETOOTH_ERROR_OBJECT_NAME_EXISITS 0x83
-#define BLUETOOTH_ERROR_CCC_IMPROPERLY_CONFIGURED 0xfd
-
/**
* Device disconnect reason
*/