if (resp_state != BLUETOOTH_ATT_ERROR_NONE) {
BT_ERR("resp_state is 0x%X", resp_state);
+ char err_msg[20] = { 0, };
+ g_snprintf(err_msg, sizeof(err_msg), "ATT error: 0x%02x", resp_state);
+ 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:
- g_dbus_method_invocation_return_dbus_error(req_info->context,
- "org.bluez.Error.Failed", "Write Request Rejected");
+ BT_ERR("Write Request Rejected");
break;
case BLUETOOTH_ATT_ERROR_OBJECT_NOT_SELECTED:
- g_dbus_method_invocation_return_dbus_error(req_info->context,
- "org.bluez.Error.Failed", "Object Not Selected");
+ BT_ERR("Object Not Selected");
break;
case BLUETOOTH_ATT_ERROR_CONCURRENCY_LIMIT_EXCEEDED:
- g_dbus_method_invocation_return_dbus_error(req_info->context,
- "org.bluez.Error.Failed", "Concurrency Limit Exceeded");
+ BT_ERR("Concurrency Limit Exceeded");
break;
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");
+ BT_ERR("Object Name Already Exists");
break;
case BLUETOOTH_ATT_ERROR_CCCD_IMPROPERLY_CONFIGURED:
- g_dbus_method_invocation_return_dbus_error(req_info->context,
- "org.bluez.Error.Failed", "CCC Improperly Configured");
+ BT_ERR("CCC Improperly Configured");
break;
default:
- g_dbus_method_invocation_return_dbus_error(req_info->context,
- "org.bluez.Error.Failed", "Application Error");
+ BT_ERR("Application Error");
break;
}