fix: replace blocking NFC calls with proper coroutine/suspend APIs across all platforms#238
Merged
codebutler merged 1 commit intomasterfrom Feb 17, 2026
Merged
fix: replace blocking NFC calls with proper coroutine/suspend APIs across all platforms#238codebutler merged 1 commit intomasterfrom
codebutler merged 1 commit intomasterfrom
Conversation
…ross all platforms iOS: - Replace dispatch_semaphore bridging with suspendCancellableCoroutine in IosCardTransceiver, IosUltralightTechnology, IosVicinityTechnology, and IosFeliCaTagAdapter - Replace runBlocking in IosNfcScanner with CoroutineScope(Dispatchers.IO) + GCD semaphore to avoid blocking GCD's worker queue thread - Use DESFire native protocol directly instead of ISO 7816 SELECT, which requires AIDs registered in Info.plist (unregistered AIDs kill the session) - Add NFCPollingISO15693 to NFC session polling options for NFC-V support - Fix Xcode project paths from stale farebot-app/ to app/ Desktop: - Make NfcReaderBackend.scanLoop() a suspend function, removing runBlocking from PN53xReaderBackend and PcscReaderBackend - Wrap scan coroutine in try/finally to ensure _isScanning resets on cancel - Share a single libusb context in PN533Device instead of per-call init/exit WebUSB: - Remove flush-on-open which left dangling transferIn promises that consumed subsequent device responses - Increase transferIn buffer from 64 to 265 bytes for full PN533 frames - Pass atrRetries to setMaxRetries so InListPassiveTarget self-resolves instead of relying on client-side abort (which WebUSB can't do) DESFire: - Handle COMMAND_ABORTED (0xCA) status code as access control exception
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.
iOS:
IosCardTransceiver, IosUltralightTechnology, IosVicinityTechnology, and
IosFeliCaTagAdapter
requires AIDs registered in Info.plist (unregistered AIDs kill the session)
Desktop:
from PN53xReaderBackend and PcscReaderBackend
WebUSB:
subsequent device responses
instead of relying on client-side abort (which WebUSB can't do)
DESFire: