* FeliCa: Handle non-hardware Polling commands
NFC TagInfo and possibly other readers rely on Polling commands with Request Code of 1 (default System Code request) or non-FFFF System Code to detect card type. Since the NFC controller doesn't seem to handle them in hardware and simply bubbles them up, and then the Flipper firmware will just ignore them and refuse to respond afterwards, this causes the reading operation to fail.
This commit adds a simple handler for such Polling commands so that readers behaving like NFC TagInfo could read the emulated card without failing.
* Only handle cases when System Code is not FFFF
The NFC controller should handle Polling commands with the System Code set to FFFF, so it's not necessary for the firmware to handle it.
* Remove system code logging
* More cleanups
* Remove the claim that we need a poller change
We already have enough information to determine whether or not the card supports NDEF since SYS_OP register value is included in all current Lite-S card dumps.
* Respond to 12FC polling command when needed
* Handle Polling with NDEF and Lite-S Service Code
This allows the reader to specifically select the service by naming the Service Code.
* Introduce API for manual handling of Polling commands
Introduce nfc_felica_listener_timer_anticol_start() and nfc_felica_listener_timer_anticol_stop(). These are for now just wrappers around the block_tx timer that can be used to delay the response until the desired Time Slot. Thanks to the loose timing constraints of FeliCa collision resolution protocol, no compensation seems to be necessary. Also enabled the block_tx timer for FeliCa listener, but with both compensation and fdt set to 0 to keep the original behavior of not using the timer during normal data exchange.
This API is now being used for handling Polling commands that are not handled by the NFC controller on the hardware side.
* Document target_time_slot
* Implement changes suggested by @RebornedBrain
* api: f18 version sync
* nfc: added stubs for `nfc_felica_listener_timer_anticol` for unit tests
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
* System code added to felica hal config functions
* Felica sensf_res setup logic adjusted with new struct
* Set api symbols version to 73.0
* Felica unit tests fix
* Furi: prevent use after free on xEventGroupSetBits call
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* Api Symbols: replace asserts with checks
* Api Symbols: replace asserts with checks part 2
* Update no args function signatures with void, to help compiler to track incorrect usage
* More unavoidable void
* Update PVS config and code to make it happy
* Format sources
* nfc: fix checks
* dead code cleanup & include fixes
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
* Added basic template of Felica listener
* Raw nfc felica listener functions
* Added functions to setup chip for felica listener
* Cleanup function templates from unnecessary parts
* Removed todo comment
* Updated api versions
* Adjusted chip config for felica
* Set proper chip passive target mode for felica
* Added felica function to unit tests
* Update furi_hal_nfc_felica.c
* Removed duplication
Co-authored-by: gornekich <n.gorbadey@gmail.com>
"A long time ago in a galaxy far, far away...." we started NFC subsystem refactoring.
Starring:
- @gornekich - NFC refactoring project lead, architect, senior developer
- @gsurkov - architect, senior developer
- @RebornedBrain - senior developer
Supporting roles:
- @skotopes, @DrZlo13, @hedger - general architecture advisors, code review
- @Astrrra, @doomwastaken, @Hellitron, @ImagineVagon333 - quality assurance
Special thanks:
@bettse, @pcunning, @nxv, @noproto, @AloneLiberty and everyone else who has been helping us all this time and contributing valuable knowledges, ideas and source code.