1
mirror of https://github.com/flipperdevices/flipperzero-firmware.git synced 2025-12-12 04:41:26 +04:00
Files
flipperzero-firmware/lib
dogtopus dfd753703a FeliCa Emulation: Handle certain Polling commands in firmware (#4204)
* 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>
2025-09-24 14:08:40 +04:00
..
2024-07-05 18:27:21 +01:00
2024-12-19 05:38:43 +09:00
2024-08-04 10:54:02 +01:00
2025-03-31 08:24:27 +04:00
2024-02-16 14:20:45 +07:00

Structure

  • app-scened-template - C++ app library
  • bit_lib - library for working with bits/bytes directly
  • ble_profile - BLE Profiles source code
  • cmsis_core - CMSIS Core package, contain cortex-m core headers
  • cxxheaderparser - C++ headers parser, used by SDK bundler
  • datetime - DateTime library
  • digital_signal - Digital signal library: used by NFC for software implemented protocols
  • drivers - Various flipper drivers
  • fatfs - FatFS file system driver
  • flipper_application - Flipper application library, used for FAPs
  • flipper_format - Flipper File Format library
  • FreeRTOS-glue - Extra glue to hold together FreeRTOS kernel and flipper firmware
  • FreeRTOS-Kernel - FreeRTOS kernel source code
  • heatshrink - Heatshrink compression library
  • ibutton - ibutton library, used by iButton application
  • infrared - Infrared library, used by Infrared application
  • lfrfid - LF-RFID library, used by LF RFID application
  • libusb_stm32 - LibUSB for STM32 series MCU
  • mbedtls - MbedTLS cryptography library
  • microtar - MicroTAR library
  • mjs - MJs, javascript engine library
  • mlib - M-Lib C containers library
  • music_worker - MusicWorker library for playing midi and RTTTL files
  • nanopb - NanoPB library, protobuf implementation for MCU
  • nfc - NFC library, used by NFC application
  • one_wire - OneWire library, used by iButton application
  • print - Tiny printf implementation
  • digital_signal - Digital Signal library used by NFC for software implemented protocols
  • pulse_reader - Pulse Reader library used by NFC for software implemented protocols
  • stm32wb_cmsis - STM32WB series CMSIS headers, extends CMSIS Core
  • stm32wb_copro - STM32WB Copro library: contains WPAN and radio co-processor firmware
  • stm32wb_hal - STM32WB HAL library, extends STM32WB CMSIS and provides HAL
  • subghz - Subghz library, used by SubGhz application
  • toolbox - Toolbox library, contains various things that is used by Flipper firmware
  • u8g2 - u8g2 graphics library, used by GUI subsystem
  • update_util - update utilities library, used by updater