core reset during nfc init and failure while recovering During NFC init, if reset notification is received then MW enters recovery procedure but NfcAdapter state sticks to STATE_OFF even after recovery
diff --git a/src/nfc/nfc/nfc_ncif.c b/src/nfc/nfc/nfc_ncif.c
index e5b2bd9..d25bc03 100644
--- a/src/nfc/nfc/nfc_ncif.c
+++ b/src/nfc/nfc/nfc_ncif.c
@@ -2101,12 +2101,14 @@
": 0x%x",
status, nfc_cb.nfc_state);
core_reset_init_num_buff = true;
- nfc_ncif_cmd_timeout();
+ if(nfa_dm_is_active())
+ nfc_ncif_cmd_timeout();
} else {
NFC_TRACE_DEBUG1("CORE_RESET_NTF 1 nfc_state :0x%x ", nfc_cb.nfc_state);
NFC_TRACE_DEBUG1("CORE_RESET_NTF 1 status :0x%x ", status);
core_reset_init_num_buff = true;
- nfc_ncif_cmd_timeout();
+ if(nfa_dm_is_active())
+ nfc_ncif_cmd_timeout();
}
}
else {
@@ -2127,7 +2129,8 @@
/* CORE_RESET_NTF received error case , trigger recovery*/
NFC_TRACE_DEBUG2 ("CORE_RESET_NTF Received status nfc_state : 0x%x : 0x%x",
status ,nfc_cb.nfc_state);
- nfc_ncif_cmd_timeout();
+ if(nfa_dm_is_active())
+ nfc_ncif_cmd_timeout();
status = NCI_STATUS_FAILED;
}
}
@@ -2239,6 +2242,11 @@
} else {
if(!core_reset_init_num_buff)
{
+ if(!nfa_dm_is_active())
+ {
+ status = NCI_STATUS_NOT_INITIALIZED;
+ NFC_Disable();
+ }
NFC_TRACE_ERROR0 ("Failed to reset NFCC");
nfc_enabled (status, NULL);
}