Return NFCSTATUS_BUSY in case of invalid state transition.
This allows the caller to recovery by trying again.
Bug: 8552749
Change-Id: Iff979c097d33f9adda06654de9e588595daf89a3
diff --git a/src/phHciNfc_Sequence.c b/src/phHciNfc_Sequence.c
index 1ef7265..6d0bf13 100644
--- a/src/phHciNfc_Sequence.c
+++ b/src/phHciNfc_Sequence.c
@@ -456,7 +456,7 @@
} /* End of State Validation Switch */
if( NFC_FSM_IN_PROGRESS == psHciContext->hci_state.transition )
{
- status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_STATE);
+ status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_BUSY);
}
break;
}
diff --git a/src/phLibNfc_discovery.c b/src/phLibNfc_discovery.c
index 1fe4d8f..c512f73 100644
--- a/src/phLibNfc_discovery.c
+++ b/src/phLibNfc_discovery.c
@@ -194,7 +194,14 @@
}
else
{
- RetVal=NFCSTATUS_FAILED;
+ if (PHNFCSTATUS(RetVal) == NFCSTATUS_BUSY)
+ {
+ RetVal = NFCSTATUS_BUSY;
+ }
+ else
+ {
+ RetVal=NFCSTATUS_FAILED;
+ }
}
}