g_dbus_error_strip_remote_error(err);
ERR("@@@Error occured in CreateBonding [%s]", err->message);
if (g_strrstr(err->message, "Already Exists")) {
- ERR("Still bond existing even after remove");
- result = BT_STATUS_AUTH_FAILURE;
+ ERR("Bond Already exists");
+ result = BT_STATUS_ALREADY_CONNECT;
} else if (g_strrstr(err->message, "Authentication Rejected")) {
INFO("REJECTED");
result = BT_STATUS_AUTH_REJECTED;
}
}
- if (result == BT_STATUS_AUTH_FAILURE ||
- result == BT_STATUS_RMT_DEV_DOWN ||
- result == BT_STATUS_AUTH_REJECTED ||
- result == BT_STATUS_FAIL) {
+ if (result != BT_STATUS_SUCCESS) {
DBG("Bonding Failed!!");
/* Prepare to send event to HAL bluetooth */
break;
case BT_STATUS_CONN_TOUT:
ret = OAL_STATUS_LINK_LOSS;
+ case BT_STATUS_ALREADY_CONNECT:
+ ret = OAL_STATUS_ALREADY_CONNECT;
break;
#ifdef TIZEN_BT_HAL
case BT_STATUS_CONN_TERM_LOCAL_HOST:
BT_STATUS_CONN_TOUT, /* disconnection due to supervision timeout */
BT_STATUS_AUTH_REJECTED,
BT_STATUS_CONN_TERM_LOCAL_HOST,
- BT_STATUS_CONN_TERM_RMT_HOST
+ BT_STATUS_CONN_TERM_RMT_HOST,
+ BT_STATUS_ALREADY_CONNECT,
#endif
} bt_status_t;
#else
OAL_STATUS_LINK_LOSS,
OAL_STATUS_CONN_TERM_LOCAL_HOST,
- OAL_STATUS_CONN_TERM_RMT_HOST
+ OAL_STATUS_CONN_TERM_RMT_HOST,
+ OAL_STATUS_ALREADY_CONNECT,
#endif
} oal_status_t;
__bt_free_pairing_info(&trigger_pairing_info);
break;
}
+ case OAL_STATUS_ALREADY_CONNECT:
+ {
+ int result = BLUETOOTH_ERROR_ALREADY_CONNECT;
+ BT_INFO("OAL_STATUS_ALREADY_CONNECT");
+
+ if (trigger_bond_info) {
+ __bt_device_handle_pending_requests(result, BT_BOND_DEVICE,
+ trigger_bond_info->addr, BT_ADDRESS_STRING_SIZE);
+ __bt_free_bond_info(BT_DEVICE_BOND_INFO);
+ }
+ break;
+ }
case OAL_STATUS_INTERNAL_ERROR:
{
BT_INFO("OAL_STATUS_INTERNAL_ERROR");