Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgornekich <n.gorbadey@gmail.com>2021-12-21 15:33:17 +0300
committerGitHub <noreply@github.com>2021-12-21 15:33:17 +0300
commitb0f582df9950c2a1a18c4f3b8a9a4fe4da4a3613 (patch)
treebc4e9396140202df0bb8642291532e27ab4bff9e /applications/nfc/nfc_worker.c
parent439fb9c18dde63e3b4420e618978226ab50e75ff (diff)
[FL-1972], [FL-1920] Mifare Ultralight and NTAG separation (#918)
* nfc: rename read mifare ultralight menu * nfc: separate ntag and mifare ultralight * nfc: save Mifare Ultralight type * nfc: add valid ack and nack messages * nfc: add compatible write command implementation * nfc: support f6 target
Diffstat (limited to 'applications/nfc/nfc_worker.c')
-rwxr-xr-x[-rw-r--r--]applications/nfc/nfc_worker.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/applications/nfc/nfc_worker.c b/applications/nfc/nfc_worker.c
index 5f810cf6..ad1aa6e5 100644..100755
--- a/applications/nfc/nfc_worker.c
+++ b/applications/nfc/nfc_worker.c
@@ -503,7 +503,7 @@ void nfc_worker_read_mifare_ul(NfcWorker* nfc_worker) {
FURI_LOG_D(
TAG,
"Mifare Ultralight Type: %d, Pages: %d",
- mf_ul_read.type,
+ mf_ul_read.data.type,
mf_ul_read.pages_to_read);
FURI_LOG_D(TAG, "Reading signature ...");
tx_len = mf_ul_prepare_read_signature(tx_buff);
@@ -629,8 +629,14 @@ void nfc_worker_emulate_mifare_ul(NfcWorker* nfc_worker) {
tx_len = mf_ul_prepare_emulation_response(
rx_buff, *rx_len, tx_buff, &mf_ul_emulate);
if(tx_len > 0) {
- err =
- furi_hal_nfc_data_exchange(tx_buff, tx_len, &rx_buff, &rx_len, false);
+ if(tx_len < 8) {
+ err = furi_hal_nfc_raw_bitstream_exchange(
+ tx_buff, tx_len, &rx_buff, &rx_len, false);
+ *rx_len /= 8;
+ } else {
+ err = furi_hal_nfc_data_exchange(
+ tx_buff, tx_len / 8, &rx_buff, &rx_len, false);
+ }
if(err == ERR_NONE) {
continue;
} else {
@@ -638,7 +644,6 @@ void nfc_worker_emulate_mifare_ul(NfcWorker* nfc_worker) {
break;
}
} else {
- FURI_LOG_D(TAG, "Not valid command: %02X", rx_buff[0]);
furi_hal_nfc_deactivate();
break;
}