1) Add error codes defined in Common Profile and
Service Error Code descriptions (see Supplement to the
Bluetooth Core Specification, sections 1.2 and 2).
2) Seperate out OTP specific application ecode.
Change-Id: I666707b76f5252a7662ff8ffc295660678d964e3
Signed-off-by: Gowtham Anandha Babu <gowtham.ab@samsung.com>
g_dbus_method_invocation_return_dbus_error(req_info->context,
"org.bluez.Error.Failed", err_msg);
g_dbus_method_invocation_return_dbus_error(req_info->context,
"org.bluez.Error.Failed", err_msg);
- switch (resp_state) {
- case BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED:
- BT_ERR("Write Request Rejected");
- break;
- case BLUETOOTH_ATT_ERROR_OBJECT_NOT_SELECTED:
- BT_ERR("Object Not Selected");
- break;
- case BLUETOOTH_ATT_ERROR_CONCURRENCY_LIMIT_EXCEEDED:
- BT_ERR("Concurrency Limit Exceeded");
- break;
- case BLUETOOTH_ATT_ERROR_OBJECT_NAME_EXISTS:
- BT_ERR("Object Name Already Exists");
- break;
- case BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED:
- BT_ERR("CCC Improperly Configured");
- break;
- default:
- BT_ERR("Application Error");
- break;
- }
-
gatt_requests = g_slist_remove(gatt_requests, req_info);
req_info->context = NULL;
gatt_requests = g_slist_remove(gatt_requests, req_info);
req_info->context = NULL;
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED ;
+ return BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED;
filename = g_strndup(value, len);
snprintf(new_abs_filepath, strlen(new_abs_filepath), "%s%s",
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)) {
directory, object->name);
if (rename(old_abs_filepath, new_abs_filepath)) {
- ret = BLUETOOTH_ATT_ERROR_OBJECT_NAME_EXISTS;
+ ret = BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS;
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED;
year = (uint16_t)(value[1] & 0xFF) << 8 |
(uint16_t)(value[0] & 0xFF);
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)
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED;
year = (uint16_t)(value[1] & 0xFF) << 8 |
(uint16_t)(value[0] & 0xFF);
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])
/* Any attempt to write RFU bits is error */
if (value[1] || value[2] || value[3])
- return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED;
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
object = (struct object_metadata *) g_slist_nth_data(otp_object_list, curr_obj_index);
if (!object)
- return BLUETOOTH_ATT_ERROR_WRITE_REQUEST_REJECTED;
+ return BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED;
props = (uint32_t)(value[3] & 0xFF) << 24 |
(uint32_t)(value[2] & 0xFF) << 16 |
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) {
if (g_strcmp0(obj_path, otp_feature_obj_path)) {
if (!selected_object) {
- return BLUETOOTH_ATT_ERROR_OBJECT_NOT_SELECTED;
+ return BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED;
#define BLUETOOTH_ATT_ERROR_UNSUPPORTED_GROUP_TYPE 0x10
#define BLUETOOTH_ATT_ERROR_INSUFFICIENT_RESOURCES 0x11
/* Common profile error codes */
#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_WRITE_REQUEST_REJECTED 0xFC
#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
#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
*/
/*
* 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
+#define BLUETOOTH_OTP_ERROR_WRITE_REQUEST_REJECTED 0x80
+#define BLUETOOTH_OTP_ERROR_OBJECT_NOT_SELECTED 0x81
+#define BLUETOOTH_OTP_ERROR_CONCURRENCY_LIMIT_EXCEEDED 0x82
+#define BLUETOOTH_OTP_ERROR_OBJECT_NAME_EXISTS 0x83
/*
* Bluetooth OTP error codes
/*
* Bluetooth OTP error codes