From 3f85bea80dad661f8d47f0715c36a11e5004d839 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Wed, 21 Jan 2026 19:55:15 +0300 Subject: [PATCH 01/11] fix slix unlock color --- applications/main/nfc/scenes/nfc_scene_slix_unlock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/main/nfc/scenes/nfc_scene_slix_unlock.c b/applications/main/nfc/scenes/nfc_scene_slix_unlock.c index f6e5a8f50..21305c58d 100644 --- a/applications/main/nfc/scenes/nfc_scene_slix_unlock.c +++ b/applications/main/nfc/scenes/nfc_scene_slix_unlock.c @@ -35,7 +35,7 @@ void nfc_scene_slix_unlock_on_enter(void* context) { instance->popup, "Hold card next\nto Flipper's back", 94, 27, AlignCenter, AlignTop); view_dispatcher_switch_to_view(instance->view_dispatcher, NfcViewPopup); - notification_message(instance->notifications, &sequence_blink_start_cyan); + notification_message(instance->notifications, &sequence_blink_start_yellow); instance->poller = nfc_poller_alloc(instance->nfc, NfcProtocolSlix); nfc_poller_start(instance->poller, nfc_scene_slix_unlock_worker_callback, instance); From d73d0f7fbd86613c5d2d8e300cecd476118fd6f8 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Wed, 21 Jan 2026 22:49:07 +0300 Subject: [PATCH 02/11] various ui/ux changes text spacing reduced from 4px to 3px some text was replaced --- .../main/nfc/helpers/protocol_support/felica/felica.c | 4 +--- applications/main/subghz/subghz_history.c | 2 +- applications/services/gui/elements.c | 8 ++++---- .../modules/widget_elements/widget_element_text_scroll.c | 2 +- lib/subghz/protocols/bin_raw.c | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/applications/main/nfc/helpers/protocol_support/felica/felica.c b/applications/main/nfc/helpers/protocol_support/felica/felica.c index 26dc86d41..0c98e7ffc 100644 --- a/applications/main/nfc/helpers/protocol_support/felica/felica.c +++ b/applications/main/nfc/helpers/protocol_support/felica/felica.c @@ -105,9 +105,7 @@ static void nfc_scene_read_success_on_enter_felica(NfcApp* instance) { if(data->workflow_type == FelicaLite) { bool all_unlocked = data->blocks_read == data->blocks_total; furi_string_cat_printf( - temp_str, - "\e#%s\n", - all_unlocked ? "All Blocks Are Unlocked" : "Some Blocks Are Locked"); + temp_str, "\e#%s\n", all_unlocked ? "All Blocks Unlocked" : "Some Blocks Locked"); nfc_render_felica_idm(data, NfcProtocolFormatTypeShort, temp_str); uint8_t* ck_data = instance->felica_auth->card_key.data; furi_string_cat_printf(temp_str, "Key:"); diff --git a/applications/main/subghz/subghz_history.c b/applications/main/subghz/subghz_history.c index d5dcee020..20d73feb0 100644 --- a/applications/main/subghz/subghz_history.c +++ b/applications/main/subghz/subghz_history.c @@ -153,7 +153,7 @@ FlipperFormat* subghz_history_get_raw_data(SubGhzHistory* instance, uint16_t idx bool subghz_history_get_text_space_left(SubGhzHistory* instance, FuriString* output) { furi_assert(instance); if(memmgr_get_free_heap() < SUBGHZ_HISTORY_FREE_HEAP) { - if(output != NULL) furi_string_printf(output, " Free heap LOW"); + if(output != NULL) furi_string_printf(output, " RAM almost FULL"); return true; } if(instance->last_index_write == SUBGHZ_HISTORY_MAX) { diff --git a/applications/services/gui/elements.c b/applications/services/gui/elements.c index 763c8b1b0..d32cbc8c9 100644 --- a/applications/services/gui/elements.c +++ b/applications/services/gui/elements.c @@ -339,7 +339,7 @@ void elements_multiline_text_aligned( furi_check(text); size_t lines_count = 0; - size_t font_height = canvas_current_font_height(canvas); + size_t font_height = canvas_current_font_height(canvas) - 1; FuriString* line; /* go through text line by line and count lines */ @@ -384,7 +384,7 @@ void elements_multiline_text(Canvas* canvas, int32_t x, int32_t y, const char* t furi_check(canvas); furi_check(text); - size_t font_height = canvas_current_font_height(canvas); + size_t font_height = canvas_current_font_height(canvas) - 1; FuriString* str; str = furi_string_alloc(); const char* start = text; @@ -407,7 +407,7 @@ void elements_multiline_text_framed(Canvas* canvas, int32_t x, int32_t y, const furi_check(canvas); furi_check(text); - size_t font_height = canvas_current_font_height(canvas); + size_t font_height = canvas_current_font_height(canvas) - 1; size_t str_width = canvas_string_width(canvas, text); // count \n's @@ -778,7 +778,7 @@ void elements_text_box( // Fill line parameters size_t line_leading_min = font_params->leading_min; size_t line_leading_default = font_params->leading_default; - size_t line_height = font_params->height; + size_t line_height = font_params->height - 1; size_t line_descender = font_params->descender; size_t line_num = 0; size_t line_width = 0; diff --git a/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c b/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c index 866aad815..ed4b19654 100644 --- a/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c +++ b/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c @@ -152,7 +152,7 @@ static void widget_element_text_scroll_draw(Canvas* canvas, WidgetElement* eleme } canvas_draw_str_aligned( canvas, x, y, line->horizontal, AlignTop, furi_string_get_cstr(line->text)); - y += params->leading_default; + y += params->leading_default - 1; } // Draw scroll bar if(model->scroll_pos_total > 1) { diff --git a/lib/subghz/protocols/bin_raw.c b/lib/subghz/protocols/bin_raw.c index f060f93bb..ca52cdd49 100644 --- a/lib/subghz/protocols/bin_raw.c +++ b/lib/subghz/protocols/bin_raw.c @@ -430,7 +430,7 @@ static bool } else if( DURATION_DIFF((float)(abs(instance->data_raw[i])), (classes[k].data)) < (classes[k].data / 4)) { //if the test value does not differ by more than 25% - classes[k].data += ((float)(abs(instance->data_raw[i]))-classes[k].data) * + classes[k].data += ((float)(abs(instance->data_raw[i])) - classes[k].data) * 0.05f; //running average k=0.05 classes[k].count++; break; From a1e01bc06d945e3ca045f3f1c526f4613544e2e2 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Thu, 22 Jan 2026 02:03:11 +0300 Subject: [PATCH 03/11] revert 4px to 3px change --- applications/services/gui/elements.c | 8 ++++---- .../modules/widget_elements/widget_element_text_scroll.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/applications/services/gui/elements.c b/applications/services/gui/elements.c index d32cbc8c9..763c8b1b0 100644 --- a/applications/services/gui/elements.c +++ b/applications/services/gui/elements.c @@ -339,7 +339,7 @@ void elements_multiline_text_aligned( furi_check(text); size_t lines_count = 0; - size_t font_height = canvas_current_font_height(canvas) - 1; + size_t font_height = canvas_current_font_height(canvas); FuriString* line; /* go through text line by line and count lines */ @@ -384,7 +384,7 @@ void elements_multiline_text(Canvas* canvas, int32_t x, int32_t y, const char* t furi_check(canvas); furi_check(text); - size_t font_height = canvas_current_font_height(canvas) - 1; + size_t font_height = canvas_current_font_height(canvas); FuriString* str; str = furi_string_alloc(); const char* start = text; @@ -407,7 +407,7 @@ void elements_multiline_text_framed(Canvas* canvas, int32_t x, int32_t y, const furi_check(canvas); furi_check(text); - size_t font_height = canvas_current_font_height(canvas) - 1; + size_t font_height = canvas_current_font_height(canvas); size_t str_width = canvas_string_width(canvas, text); // count \n's @@ -778,7 +778,7 @@ void elements_text_box( // Fill line parameters size_t line_leading_min = font_params->leading_min; size_t line_leading_default = font_params->leading_default; - size_t line_height = font_params->height - 1; + size_t line_height = font_params->height; size_t line_descender = font_params->descender; size_t line_num = 0; size_t line_width = 0; diff --git a/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c b/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c index ed4b19654..866aad815 100644 --- a/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c +++ b/applications/services/gui/modules/widget_elements/widget_element_text_scroll.c @@ -152,7 +152,7 @@ static void widget_element_text_scroll_draw(Canvas* canvas, WidgetElement* eleme } canvas_draw_str_aligned( canvas, x, y, line->horizontal, AlignTop, furi_string_get_cstr(line->text)); - y += params->leading_default - 1; + y += params->leading_default; } // Draw scroll bar if(model->scroll_pos_total > 1) { From e76dedd825aabe2f8822809e7eb6432b844da6ad Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Thu, 22 Jan 2026 02:04:03 +0300 Subject: [PATCH 04/11] upd changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ef922555..8fdd5c190 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,9 @@ * SubGHz: Fixed button mapping for **FAAC RC/XT** * NFC: Handle PPS request in ISO14443-4 layer (by @WillyJL) * Archive: Allow folders to be pinned (by @WillyJL) -* Apps: Build tag (**21jan2026**) - **Check out more Apps updates and fixes by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev) +* Apps: Build tag (**22jan2026**) - **Check out more Apps updates and fixes by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev) ## Other changes +* UI: Various small changes * NFC: Fix LED not blinking at SLIX unlock (closes issue #945) * SubGHz: Replaced Cars ignore option with Revers RB2 protocol ignore option * SubGHz: Moved Starline, ScherKhan, Kia decoders into external app From bb9e6bd3ca929290d19991ecab484154cdf1624f Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Fri, 23 Jan 2026 18:23:09 +0300 Subject: [PATCH 05/11] fix docs [ci skip] --- documentation/SubGHzSupportedSystems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/documentation/SubGHzSupportedSystems.md b/documentation/SubGHzSupportedSystems.md index d9269fbe9..65e96225b 100644 --- a/documentation/SubGHzSupportedSystems.md +++ b/documentation/SubGHzSupportedSystems.md @@ -121,7 +121,7 @@ The following manufacturers have KeeLoq support in Unleashed firmware: - Nice Smilo - `433.92MHz` `AM650` (KeeLoq, 64 bits) (8bit serial part in Hop - simple learning) - Normstahl - `433.92MHz` `AM650` (KeeLoq, 64 bits) - Novoferm - `433.92MHz` `AM650` (KeeLoq, 64 bits) -- Sommer `434.42MHz, 868.80MHz` `FSK12K (or FSK476)` (KeeLoq, 64 bits) (normal learning) (TX03-868-4, Pearl, and maybe other models are supported (SOMloq2)) +- Sommer `434.42MHz, 868.80MHz` `FSK12K (or FSK476)` (KeeLoq, 64 bits) (normal learning) (TX03-868-4, Pearl, and maybe other models are supported (SOMloq)) - Steelmate - `433.92MHz` `AM650` (KeeLoq, 64 bits) (12bit serial part in Hop - normal learning) - Stilmatic - `433.92MHz` `AM650` (KeeLoq, 64 bits) (normal learning) From c2487a3761451c5f03197e3bd6acd0abddd3de64 Mon Sep 17 00:00:00 2001 From: WillyJL Date: Fri, 23 Jan 2026 22:56:15 +0100 Subject: [PATCH 06/11] NFC: Fix sending 32+ byte ISO 15693-3 commands --- targets/f7/furi_hal/furi_hal_nfc_iso15693.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/targets/f7/furi_hal/furi_hal_nfc_iso15693.c b/targets/f7/furi_hal/furi_hal_nfc_iso15693.c index d35b160f4..1fafba6b2 100644 --- a/targets/f7/furi_hal/furi_hal_nfc_iso15693.c +++ b/targets/f7/furi_hal/furi_hal_nfc_iso15693.c @@ -8,6 +8,7 @@ #define FURI_HAL_NFC_ISO15693_MAX_FRAME_SIZE (1024U) #define FURI_HAL_NFC_ISO15693_POLLER_MAX_BUFFER_SIZE (64) +#define FURI_HAL_NFC_ISO15693_BIT_LEN (4) #define FURI_HAL_NFC_ISO15693_RESP_SOF_SIZE (5) #define FURI_HAL_NFC_ISO15693_RESP_EOF_SIZE (5) @@ -34,9 +35,9 @@ typedef struct { typedef struct { // 4 bits per data bit on transmit - uint8_t fifo_buf[FURI_HAL_NFC_ISO15693_POLLER_MAX_BUFFER_SIZE * 4]; + uint8_t fifo_buf[FURI_HAL_NFC_ISO15693_POLLER_MAX_BUFFER_SIZE * FURI_HAL_NFC_ISO15693_BIT_LEN]; size_t fifo_buf_bits; - uint8_t frame_buf[FURI_HAL_NFC_ISO15693_POLLER_MAX_BUFFER_SIZE * 2]; + uint8_t frame_buf[FURI_HAL_NFC_ISO15693_POLLER_MAX_BUFFER_SIZE * FURI_HAL_NFC_ISO15693_BIT_LEN]; size_t frame_buf_bits; } FuriHalNfcIso15693Poller; From 72aa0372bec144792c7bb1d4620f98d197465584 Mon Sep 17 00:00:00 2001 From: WillyJL Date: Sun, 25 Jan 2026 21:41:42 +0100 Subject: [PATCH 07/11] Update changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c50fc825..7668d7167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,9 @@ - UL: Possible Sommer timings fix (by @xMasterX) - UL: Various fixes (by @xMasterX) - UL: Nice Flor S remove extra uint64 variable (by @xMasterX) -- UL: NFC: Fix LED not blinking at SLIX unlock (by @xMasterX) +- NFC: + - Fix sending 32+ byte ISO 15693-3 commands (by @WillyJL) + - UL: Fix LED not blinking at SLIX unlock (by @xMasterX) ### Removed: - Sub-GHz: From 338240447abaab4456807982e748d324a0326470 Mon Sep 17 00:00:00 2001 From: WillyJL Date: Sun, 25 Jan 2026 21:54:52 +0100 Subject: [PATCH 08/11] Update apps --nobuild --- applications/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/external b/applications/external index d52c118c8..7d9d6ada3 160000 --- a/applications/external +++ b/applications/external @@ -1 +1 @@ -Subproject commit d52c118c825dd86c41c02943b34ae4529e4d3605 +Subproject commit 7d9d6ada30d5d1f0fa0cea3242ea25eee1ec851b From 33321e532a4d846cc924edf67d6ed57b03ceee4e Mon Sep 17 00:00:00 2001 From: WillyJL Date: Sun, 25 Jan 2026 23:43:30 +0100 Subject: [PATCH 09/11] Apps: Add ISO 15693-3 NFC Writer (by ch4istO) --- CHANGELOG.md | 1 + applications/external | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c690ebe1..7ad2b4ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ ### Added: - Apps: + - NFC: ISO 15693-3 NFC Writer (by @ch4istO) - Sub-GHz: ProtoPirate (by @RocketGod-git & @xMasterX & @zero-mega et al.) - Sub-GHz: - UL: Cardin S449 protocol full support (64bit keeloq) (with Add manually, and all button codes) (use FSK12K modulation to read the remote) (by @xMasterX & @zero-mega) diff --git a/applications/external b/applications/external index 7d9d6ada3..e9230bc08 160000 --- a/applications/external +++ b/applications/external @@ -1 +1 @@ -Subproject commit 7d9d6ada30d5d1f0fa0cea3242ea25eee1ec851b +Subproject commit e9230bc089ae26094a9cba4614815c36532fc964 From c94b5505b7fff741dcb89b08bc4fad4b3b2aa53a Mon Sep 17 00:00:00 2001 From: Leeroy <135471162+LeeroysHub@users.noreply.github.com> Date: Mon, 26 Jan 2026 09:46:52 +1100 Subject: [PATCH 10/11] Archive: Support opening and pinning ProtoPirate files from Archive (#510) * ProtoPirate added to known apps, can use browser and favorites to Open PSFs now. * Archive: Use protopirate icon for .psf files * Update changelog * Format --------- Co-authored-by: WillyJL --- CHANGELOG.md | 1 + .../main/archive/helpers/archive_browser.h | 1 + applications/main/archive/helpers/archive_files.h | 1 + .../main/archive/scenes/archive_scene_browser.c | 2 ++ .../main/archive/views/archive_browser_view.c | 1 + assets/icons/Archive/protopirate_10px.png | Bin 0 -> 96 bytes targets/f7/api_symbols.csv | 1 + 7 files changed, 7 insertions(+) create mode 100644 assets/icons/Archive/protopirate_10px.png diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ad2b4ac2..cc8ed1259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - UL: Alutech AT-4N & Nice Flor S turbo speedup (by @Dmitry422) - UL: Sommer fm2 in Add manually now uses FM12K modulation (Sommer without fm2 tag uses FM476) (try this if regular option doesn't work for you) (by @xMasterX) - UL: Replaced Cars ignore option with Revers RB2 protocol ignore option (by @xMasterX) +- Archive: Support opening and pinning ProtoPirate files from Archive (#510 by @LeeroysHub) ### Fixed: - Sub-GHz: diff --git a/applications/main/archive/helpers/archive_browser.h b/applications/main/archive/helpers/archive_browser.h index 2378c53b2..14bb8f76d 100644 --- a/applications/main/archive/helpers/archive_browser.h +++ b/applications/main/archive/helpers/archive_browser.h @@ -45,6 +45,7 @@ static const char* const known_ext[] = { [ArchiveFileTypeUpdateManifest] = ".fuf", [ArchiveFileTypeDiskImage] = ".img", [ArchiveFileTypeFolder] = "?", + [ArchiveFileTypeProtoPirate] = ".psf", [ArchiveFileTypeUnknown] = "*", [ArchiveFileTypeAppOrJs] = ".fap|.js", [ArchiveFileTypeSetting] = "?", diff --git a/applications/main/archive/helpers/archive_files.h b/applications/main/archive/helpers/archive_files.h index a33313284..c4837f426 100644 --- a/applications/main/archive/helpers/archive_files.h +++ b/applications/main/archive/helpers/archive_files.h @@ -31,6 +31,7 @@ typedef enum { ArchiveFileTypeDiskImage, ArchiveFileTypeFolder, ArchiveFileTypeSetting, + ArchiveFileTypeProtoPirate, ArchiveFileTypeUnknown, ArchiveFileTypeAppOrJs, ArchiveFileTypeLoading, diff --git a/applications/main/archive/scenes/archive_scene_browser.c b/applications/main/archive/scenes/archive_scene_browser.c index 6042c8f32..777fd471e 100644 --- a/applications/main/archive/scenes/archive_scene_browser.c +++ b/applications/main/archive/scenes/archive_scene_browser.c @@ -29,6 +29,8 @@ const char* archive_get_flipper_app_name(ArchiveFileTypeEnum file_type) { return EXT_PATH("apps/Sub-Ghz/subghz_playlist.fap"); case ArchiveFileTypeSubghzRemote: return EXT_PATH("apps/Sub-Ghz/subghz_remote.fap"); + case ArchiveFileTypeProtoPirate: + return EXT_PATH("apps/Sub-Ghz/proto_pirate.fap"); case ArchiveFileTypeInfraredRemote: return EXT_PATH("apps/Infrared/ir_remote.fap"); case ArchiveFileTypeBadUsb: diff --git a/applications/main/archive/views/archive_browser_view.c b/applications/main/archive/views/archive_browser_view.c index 98462d86a..1882d267a 100644 --- a/applications/main/archive/views/archive_browser_view.c +++ b/applications/main/archive/views/archive_browser_view.c @@ -45,6 +45,7 @@ static const Icon* ArchiveItemIcons[] = { [ArchiveFileTypeSearch] = &I_search_10px, [ArchiveFileTypeUpdateManifest] = &I_update_10px, [ArchiveFileTypeDiskImage] = &I_floppydisk_10px, + [ArchiveFileTypeProtoPirate] = &I_protopirate_10px, [ArchiveFileTypeFolder] = &I_dir_10px, [ArchiveFileTypeUnknown] = &I_unknown_10px, [ArchiveFileTypeLoading] = &I_loading_10px, diff --git a/assets/icons/Archive/protopirate_10px.png b/assets/icons/Archive/protopirate_10px.png new file mode 100644 index 0000000000000000000000000000000000000000..ba5e7ccbcb67934ce403eb929b6d3be67d7a8f72 GIT binary patch literal 96 zcmeAS@N?(olHy`uVBq!ia0vp^AT}2xkYHHq`AGmsse8IOhE&W+w)r@zShG%z@6Xds)yz|gmY-QVkf(GQSTPgg&ebxsLQ017r4V*mgE literal 0 HcmV?d00001 diff --git a/targets/f7/api_symbols.csv b/targets/f7/api_symbols.csv index 61c31facb..e578d5541 100644 --- a/targets/f7/api_symbols.csv +++ b/targets/f7/api_symbols.csv @@ -4319,6 +4319,7 @@ Variable,+,I_power_text_24x5,const Icon, Variable,+,I_prev_19x20,const Icon, Variable,+,I_prev_hover_19x20,const Icon, Variable,+,I_prev_text_19x5,const Icon, +Variable,+,I_protopirate_10px,const Icon, Variable,-,I_qr_benchmark_25x25,const Icon, Variable,+,I_red_19x20,const Icon, Variable,+,I_red_hover_19x20,const Icon, From c176524fca3d8ab3485fd5ef5220b8c7f3cdae2d Mon Sep 17 00:00:00 2001 From: Aaron Tulino Date: Sun, 25 Jan 2026 15:47:12 -0700 Subject: [PATCH 11/11] NFC: ISO 15693-3 emulation READ_MULTI and GET_BLOCK_SECURITY fixes (#501) * Fix ISO15693 crash (hopefully) * NFC: Fix off-by-one block count in ISO 15693-3 READ MULTI command * NFC: Handle 256 long BLOCK SECURITY response and too large READ MULTI response * Move the define so correlation is clearer * Oops * Change to no reply if too many blocks requested than can be handled * Update CHANGELOG.md --------- Co-authored-by: WillyJL --- CHANGELOG.md | 1 + .../presets/nfc/iso15693_signal.c | 6 +++++- .../iso15693_3/iso15693_3_listener.c | 2 -- .../iso15693_3/iso15693_3_listener_i.c | 20 ++++++++++++++++--- .../iso15693_3/iso15693_3_listener_i.h | 12 +++++++++++ 5 files changed, 35 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc8ed1259..5f94135d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ - UL: Nice Flor S remove extra uint64 variable (by @xMasterX) - NFC: - Fix sending 32+ byte ISO 15693-3 commands (by @WillyJL) + - Fixes to `READ_MULTI` and `GET_BLOCK_SECURITY` commands in ISO 15693-3 emulation (#501 by @WillyJL & aaronjamt) - UL: Fix LED not blinking at SLIX unlock (by @xMasterX) - UL: UI: Some small changes (by @xMasterX) diff --git a/lib/digital_signal/presets/nfc/iso15693_signal.c b/lib/digital_signal/presets/nfc/iso15693_signal.c index 43066b5bf..560a393a0 100644 --- a/lib/digital_signal/presets/nfc/iso15693_signal.c +++ b/lib/digital_signal/presets/nfc/iso15693_signal.c @@ -2,8 +2,12 @@ #include +#include + #define BITS_IN_BYTE (8U) +#define ISO15693_SIGNAL_BUFFER_SIZE (ISO15693_3_LISTENER_BUFFER_SIZE * BITS_IN_BYTE + 2) + #define ISO15693_SIGNAL_COEFF_HI (1U) #define ISO15693_SIGNAL_COEFF_LO (4U) @@ -151,7 +155,7 @@ Iso15693Signal* iso15693_signal_alloc(const GpioPin* pin) { Iso15693Signal* instance = malloc(sizeof(Iso15693Signal)); - instance->tx_sequence = digital_sequence_alloc(BITS_IN_BYTE * 255 + 2, pin); + instance->tx_sequence = digital_sequence_alloc(ISO15693_SIGNAL_BUFFER_SIZE, pin); for(uint32_t i = 0; i < Iso15693SignalDataRateNum; ++i) { iso15693_signal_bank_fill(instance, i); diff --git a/lib/nfc/protocols/iso15693_3/iso15693_3_listener.c b/lib/nfc/protocols/iso15693_3/iso15693_3_listener.c index 151e4ae4a..2d1d053c3 100644 --- a/lib/nfc/protocols/iso15693_3/iso15693_3_listener.c +++ b/lib/nfc/protocols/iso15693_3/iso15693_3_listener.c @@ -8,8 +8,6 @@ #define TAG "Iso15693_3Listener" -#define ISO15693_3_LISTENER_BUFFER_SIZE (256U) - Iso15693_3Listener* iso15693_3_listener_alloc(Nfc* nfc, Iso15693_3Data* data) { furi_assert(nfc); diff --git a/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.c b/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.c index 6132fbf47..1e0f65bfd 100644 --- a/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.c +++ b/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.c @@ -263,8 +263,9 @@ static Iso15693_3Error iso15693_3_listener_read_multi_blocks_handler( const uint32_t block_index_start = request->first_block_num; const uint32_t block_index_end = - MIN((block_index_start + request->block_count + 1), + MIN((block_index_start + request->block_count), ((uint32_t)instance->data->system_info.block_count - 1)); + const uint32_t block_count = block_index_end - block_index_start + 1; error = iso15693_3_listener_extension_handler( instance, @@ -273,8 +274,21 @@ static Iso15693_3Error iso15693_3_listener_read_multi_blocks_handler( (uint32_t)block_index_end); if(error != Iso15693_3ErrorNone) break; + const bool include_block_security = (flags & ISO15693_3_REQ_FLAG_T4_OPTION) != 0; + const uint8_t bytes_per_block = + (include_block_security ? 1 : 0) + instance->data->system_info.block_size; + const uint32_t response_data_max = + bit_buffer_get_capacity_bytes(instance->tx_buffer) - 1 - 2; // Flags and CRC + const uint32_t response_blocks_max = response_data_max / bytes_per_block; + if(block_count > response_blocks_max) { + // Tested on SLIX2, if asked for more blocks than supported at once there is no reply + // Let's do the same + error = Iso15693_3ErrorIgnore; + break; + } + for(uint32_t i = block_index_start; i <= block_index_end; ++i) { - if(flags & ISO15693_3_REQ_FLAG_T4_OPTION) { + if(include_block_security) { iso15693_3_append_block_security( instance->data, i, instance->tx_buffer); // Block security (optional) } @@ -341,7 +355,7 @@ static Iso15693_3Error iso15693_3_listener_write_multi_blocks_handler( if(error != Iso15693_3ErrorNone) break; - for(uint32_t i = block_index_start; i < block_count + request->first_block_num; ++i) { + for(uint32_t i = block_index_start; i <= block_index_end; ++i) { const uint8_t* block_data = &request->block_data[block_size * i]; iso15693_3_set_block_data(instance->data, i, block_data, block_size); } diff --git a/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.h b/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.h index a9e0822bf..24a2d1cf0 100644 --- a/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.h +++ b/lib/nfc/protocols/iso15693_3/iso15693_3_listener_i.h @@ -10,6 +10,18 @@ extern "C" { #endif +// Based on GET_BLOCKS_SECURITY, one of the commands with lengthier responses: +// - 1 byte flags +// - 1 byte security status * 256 max block count +// - 2 byte crc +// for a response size of 259 bytes. +// There is also READ_MULTI_BLOCKS which has no explicit limit on requested block count +// and ISO 15693-3 also does not specify a maximum overall response length, so this command could +// theoretically result in a 8195 byte response (1 byte flags + 32 byte block * 256 blocks + 2 byte crc); +// for practicality we use a sufficient buffer for a full GET_BLOCKS_SECURITY and +// limit READ_MULTI_BLOCKS to how many blocks we can fit into that buffer size. +#define ISO15693_3_LISTENER_BUFFER_SIZE (259U) + typedef enum { Iso15693_3ListenerStateReady, Iso15693_3ListenerStateSelected,