Skip to content

Commit

Permalink
NFC: Add NDEF Parser for MFUL, MFC and SLIX (flipperdevices#3973)
Browse files Browse the repository at this point in the history
* NFC: Add NDEF Parser for MFUL, MFC and SLIX
* Fix inefficiency in MAD checking
* NFC: NDEF parser less RAM waste for contact vcards
* Fix typo
* Make PVS Happy
* NFC: hide TODO in 3rd party plugin

Co-authored-by: あく <alleteam@gmail.com>
  • Loading branch information
2 people authored and RogueMaster committed Nov 2, 2024
1 parent 0d52b98 commit f1ab993
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions applications/main/nfc/plugins/supported_cards/ndef.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ bool ndef_parse_record(
NdefTnf tnf,
const char* type,
uint8_t type_len) {
FURI_LOG_D(TAG, "payload type: %.*s len: %d", type_len, type, len);
FURI_LOG_D(TAG, "payload type: %.*s len: %hu", type_len, type, len);
if(!len) {
furi_string_cat(ndef->output, "Empty\n");
return true;
Expand Down Expand Up @@ -702,9 +702,9 @@ bool ndef_parse_message(Ndef* ndef, size_t pos, size_t len, size_t message_num,
pos += id_len;

if(smart_poster) {
furi_string_cat_printf(ndef->output, "\e*> SP-R%d: ", record_num);
furi_string_cat_printf(ndef->output, "\e*> SP-R%zu: ", record_num);
} else {
furi_string_cat_printf(ndef->output, "\e*> M%d-R%d: ", message_num, record_num);
furi_string_cat_printf(ndef->output, "\e*> M%zu-R%zu: ", message_num, record_num);
}
if(!ndef_parse_record(ndef, pos, payload_len, flags_tnf.type_name_format, type, type_len)) {
if(type_was_allocated) free(type);
Expand All @@ -721,7 +721,7 @@ bool ndef_parse_message(Ndef* ndef, size_t pos, size_t len, size_t message_num,
if(smart_poster) {
furi_string_cat(ndef->output, "\e*> SP: Empty\n\n");
} else {
furi_string_cat_printf(ndef->output, "\e*> M%d: Empty\n\n", message_num);
furi_string_cat_printf(ndef->output, "\e*> M%zu: Empty\n\n", message_num);
}
}

Expand Down Expand Up @@ -949,7 +949,7 @@ static bool ndef_mfc_parse(const NfcDevice* device, FuriString* parsed_data) {
} else {
data_block = 93 + (sector - 32) * 15;
}
FURI_LOG_D(TAG, "data_block: %d", data_block);
FURI_LOG_D(TAG, "data_block: %zu", data_block);
size_t data_start = data_block * MF_CLASSIC_BLOCK_SIZE;
size_t parsed = ndef_parse_tlv(&ndef, data_start, data_size - data_start, total_parsed);

Expand Down Expand Up @@ -982,7 +982,7 @@ static bool ndef_slix_parse(const NfcDevice* device, FuriString* parsed_data) {
const uint16_t block_count = iso15693_3_get_block_count(data);
const uint8_t* blocks = simple_array_cget_data(data->block_data);

// TODO: Find some way to check for other iso15693 NDEF cards and
// TODO(-nofl): Find some way to check for other iso15693 NDEF cards and
// split this to also support non-slix iso15693 NDEF tags
// Rest of the code works on iso15693 too, but uses SLIX layout assumptions
if(block_size != SLIX_BLOCK_SIZE) {
Expand Down

0 comments on commit f1ab993

Please sign in to comment.