[FL-1526] Mifare Ultralight emulation (#645)

* rfal: add discovery parameter for passing listen activation
* nfc: add discovery parameter to furi_hal_nfc_listen
* mifare_ul: add emulation parsing commands
* nfc: add mifare ul emulation
* nfc: switch to mifare ultralight emulation form menu
* furi-hal-nfc: add first frame reception in emulation mode
* nfc: change argument check
* nfc: rework nfc worker and mifare ul lib
* mifare_ul: add write and cnt increment commands
* nfc: add card modification check
* mifare_ul: add data changed flag
* nfc: add shodow files
* nfc: add restore original file

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
gornekich
2021-08-17 00:45:04 +03:00
committed by GitHub
parent e1d80d5402
commit c122317468
16 changed files with 354 additions and 69 deletions

View File

@@ -575,6 +575,7 @@ ReturnCode rfalNfcDataExchangeStart( uint8_t *txData, uint16_t txDataLen, uint8_
*rvdLen = (uint16_t*)&gNfcDev.rxLen;
*rxData = (uint8_t*)( (gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_ISODEP) ? gNfcDev.rxBuf.isoDepBuf.apdu :
((gNfcDev.activeDev->rfInterface == RFAL_NFC_INTERFACE_NFCDEP) ? gNfcDev.rxBuf.nfcDepBuf.pdu : gNfcDev.rxBuf.rfBuf));
gNfcDev.state = RFAL_NFC_STATE_DATAEXCHANGE_DONE;
return ERR_NONE;
}
@@ -1579,6 +1580,7 @@ static ReturnCode rfalNfcListenActivation( void )
lmSt = rfalListenGetState( &isDataRcvd, &bitRate );
switch(lmSt)
{
@@ -1595,6 +1597,12 @@ static ReturnCode rfalNfcListenActivation( void )
/* Set the Listen Mode in Sleep state */
EXIT_ON_ERR( ret, rfalListenSleepStart( RFAL_LM_STATE_SLEEP_A, gNfcDev.rxBuf.rfBuf, sizeof(gNfcDev.rxBuf.rfBuf), &gNfcDev.rxLen ) );
}
else if(gNfcDev.disc.activate_after_sak) {
gNfcDev.devList->type = RFAL_NFC_POLL_TYPE_NFCA;
rfalListenSetState(RFAL_LM_STATE_ACTIVE_A);
return ERR_NONE;
}
#if RFAL_FEATURE_ISO_DEP && RFAL_FEATURE_ISO_DEP_LISTEN
/* Check if received data is a valid RATS */