In Common Profile and Service Error Code descriptions (Supplement
to Bluetooth Core Specification, sections 1.2 and 2), it is
mentioned that following error codes are sent over the Attribute
Protocol.
1)Client Characteristic Configuration Descriptor Improperly Configured(0xFD)
2)Procedure Already in Progress(0xFE)
3)Out of Range(0xFF)
It should be treated as ATT Error codes. So, moved those to att-types.h
and handled org.bluez.Error.InProgress.
git repo link:
https://git.kernel.org/cgit/bluetooth/bluez.git/commit/?id=
70489204d769568707d9a7607981c197e935391e
Change-Id: I17707fa3a6d5ed52ef6634cbe725ac0322a8292f
static uint8_t dbus_error_to_att_ecode(const char *error_name)
{
- /* TODO: Parse error ATT ecode from error_message */
if (strcmp(error_name, "org.bluez.Error.Failed") == 0)
return 0x80; /* For now return this "application error" */
if (strcmp(error_name, "org.bluez.Error.InvalidValueLength") == 0)
return BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN;
+ if (strcmp(error_name, "org.bluez.Error.InProgress") == 0)
+ return BT_ERROR_ALREADY_IN_PROGRESS;
+
return 0;
}
#define BT_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
/*
+ * Common Profile and Service Error Code descriptions (see Supplement to the
+ * Bluetooth Core Specification, sections 1.2 and 2). The error codes within
+ * 0xE0-0xFC are reserved for future use. The remaining 3 are defined as the
+ * following:
+ */
+#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED 0xfd
+#define BT_ERROR_ALREADY_IN_PROGRESS 0xfe
+#define BT_ERROR_OUT_OF_RANGE 0xff
+
+/*
* ATT attribute permission bitfield values. Permissions are grouped as
* "Access", "Encryption", "Authentication", and "Authorization". A bitmask of
* permissions is a byte that encodes a combination of these.
#define ATT_OP_SIGNED_MASK 0x80
#define ATT_TIMEOUT_INTERVAL 30000 /* 30000 ms */
-/*
- * Common Profile and Service Error Code descriptions (see Supplement to the
- * Bluetooth Core Specification, sections 1.2 and 2). The error codes within
- * 0xE0-0xFC are reserved for future use. The remaining 3 are defined as the
- * following:
- */
-#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED 0xfd
-#define BT_ERROR_ALREADY_IN_PROGRESS 0xfe
-#define BT_ERROR_OUT_OF_RANGE 0xff
-
/* Length of signature in write signed packet */
#define BT_ATT_SIGNATURE_LEN 12