diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-29 03:17:43 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-12-29 03:17:43 +0000 |
commit | 362aa7ca721d8603434aad701f6de47c3e05da91 (patch) | |
tree | 6f7fa5f1647a607aae6d2104f5b9c27594eeb9fc | |
parent | 8df7509a8c37416cc5d712d124f17327fad650a4 (diff) | |
parent | 216d4f6a2c105bba7cd5f99b3d16c88adbfba16f (diff) | |
download | nfc-android14-qpr2-s3-release.tar.gz |
Merge cherrypicks of ['android-review.googlesource.com/2873374'] into 24Q1-release.android-14.0.0_r37android-14.0.0_r36android-14.0.0_r35android-14.0.0_r34android-14.0.0_r33android-14.0.0_r32android-14.0.0_r31android-14.0.0_r30android-14.0.0_r29android14-qpr2-s5-releaseandroid14-qpr2-s4-releaseandroid14-qpr2-s3-releaseandroid14-qpr2-s2-releaseandroid14-qpr2-s1-releaseandroid14-qpr2-release
Change-Id: I90e7c0fdb3e836472908be31abf3bce8cfb93b83
-rw-r--r-- | st21nfc/hal_wrapper.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/st21nfc/hal_wrapper.cc b/st21nfc/hal_wrapper.cc index 14a2469..d41abcf 100644 --- a/st21nfc/hal_wrapper.cc +++ b/st21nfc/hal_wrapper.cc @@ -134,7 +134,7 @@ int hal_wrapper_close(int call_cb, int nfc_mode) { mHalWrapperState = HAL_WRAPPER_STATE_CLOSING; // Send PROP_NFC_MODE_SET_CMD if (!HalSendDownstreamTimer(mHalHandle, propNfcModeSetCmdQb, - sizeof(propNfcModeSetCmdQb), 40)) { + sizeof(propNfcModeSetCmdQb), 100)) { STLOG_HAL_E("NFC-NCI HAL: %s HalSendDownstreamTimer failed", __func__); return -1; } @@ -161,10 +161,10 @@ void hal_wrapper_send_core_config_prop() { STLOG_HAL_V("%s - Enter", __func__); set_ready(0); + mHalWrapperState = HAL_WRAPPER_STATE_PROP_CONFIG; if (!HalSendDownstreamTimer(mHalHandle, ConfigBuffer, retlen, 1000)) { STLOG_HAL_E("NFC-NCI HAL: %s SendDownstream failed", __func__); } - mHalWrapperState = HAL_WRAPPER_STATE_PROP_CONFIG; wait_ready(); } free(ConfigBuffer); @@ -176,11 +176,11 @@ void hal_wrapper_send_vs_config() { STLOG_HAL_V("%s - Enter", __func__); set_ready(0); + mReadFwConfigDone = true; if (!HalSendDownstreamTimer(mHalHandle, nciPropGetFwDbgTracesConfig, sizeof(nciPropGetFwDbgTracesConfig), 1000)) { STLOG_HAL_E("%s - SendDownstream failed", __func__); } - mReadFwConfigDone = true; wait_ready(); } @@ -246,6 +246,7 @@ void halWrapperDataCallback(uint16_t data_len, uint8_t* p_data) { mHalWrapperCallback(HAL_NFC_OPEN_CPLT_EVT, HAL_NFC_STATUS_FAILED); I2cCloseLayer(); } else { + mHalWrapperState = HAL_WRAPPER_STATE_UPDATE; if (((p_data[3] == 0x01) && (p_data[8] == HW_ST54L)) || ((p_data[2] == 0x41) && (p_data[3] == 0xA2))) { // ST54L FwUpdateHandler(mHalHandle, data_len, p_data); @@ -258,7 +259,6 @@ void halWrapperDataCallback(uint16_t data_len, uint8_t* p_data) { STLOG_HAL_E("%s - SendDownstream failed", __func__); } } - mHalWrapperState = HAL_WRAPPER_STATE_UPDATE; } } else if (mFwUpdateTaskMask == 0 || mRetryFwDwl == 0) { STLOG_HAL_V("%s - Proceeding with normal startup", __func__); @@ -312,12 +312,12 @@ void halWrapperDataCallback(uint16_t data_len, uint8_t* p_data) { } else if ((p_data[0] == 0x60) && (p_data[1] == 0x06)) { STLOG_HAL_V("%s - Sending PROP_NFC_MODE_SET_CMD", __func__); // Send PROP_NFC_MODE_SET_CMD(ON) + mHalWrapperState = HAL_WRAPPER_STATE_NFC_ENABLE_ON; if (!HalSendDownstreamTimer(mHalHandle, propNfcModeSetCmdOn, - sizeof(propNfcModeSetCmdOn), 100)) { + sizeof(propNfcModeSetCmdOn), 500)) { STLOG_HAL_E("NFC-NCI HAL: %s HalSendDownstreamTimer failed", __func__); } - mHalWrapperState = HAL_WRAPPER_STATE_NFC_ENABLE_ON; } else { mHalWrapperDataCallback(data_len, p_data); } @@ -521,8 +521,8 @@ void halWrapperDataCallback(uint16_t data_len, uint8_t* p_data) { (void)pthread_mutex_lock(&mutex_activerw); // start timer mTimerStarted = true; - HalSendDownstreamTimer(mHalHandle, 5000); mIsActiveRW = true; + HalSendDownstreamTimer(mHalHandle, 5000); (void)pthread_mutex_unlock(&mutex_activerw); } else if ((p_data[0] == 0x6f) && (p_data[1] == 0x06)) { (void)pthread_mutex_lock(&mutex_activerw); |