Stabilize HF/SAM reads and reduce memory pressure (for running alongside qFlipper) - #39
Merged
Merged
Conversation
👷 Deploy request for seader pending review.Visit the deploys page to approve it
|
bettse
reviewed
Jun 18, 2026
| ], | ||
| ), | ||
| Lib( | ||
| name="loclass", |
Owner
There was a problem hiding this comment.
This reminds me: loclass was copied from the proxmark3 code, which includes emulation and that required time/space tradeoffs, so there are parts that may be written to use more space, but be faster. I think i've taken a pass at it to try to clean some of that up, but it could be a place to look for further memory reduction.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix HF/SAM bridge synchronization so SAM nfcSend traffic is queued instead of dropped before the HF conversation is fully
active.
Surface SAM key probe failures and missing standard PACS key state on the main UI.
Improve read failure handling for SAM timeouts, protocol errors, missing keys, and allocation failures.
Reduce HF read memory pressure with lazy NFC allocation, inactive-view release, buffer reuse, optimized SAM nfcSend parsing,
and reduced poller churn.
Harden UART/CCID/T=1 paths with immutable TX frames, safer RX compaction, aligned length reads, and calloc overflow
protection.
Add host-tested policy/helpers for HF bridge behavior, read lifecycle, UI memory policy, UART TX/RX, CCID, SNMP key probing,
and runtime release ordering.