* polling system code done
* select service done
* select system fixes. works fine now
* clean up select sys by idx
* reading, saving, loading done. render wrong
* render first layer works
* render fixed
* fix Lite Render triage
* regression Lite rendering
* sync API with 1.40 release
* clean up and lint
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
* make infrared db unit tests
* fix the tests, no assets are in asset folder oh no
* fix formate
* ship ir app along with unit_test pkg
* libify ir signal and bruteforce parts
* small cleanup
* api: removed infrared methods (you can link with the lib if needed), unit_tests, infrared: adjusted to link with ir lib; api: added `__aeabi_f2d`
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
* SimpleArray attached to FelicaData
* tx rx done. response parsing done (in log)
* dynamic vector as buffer. rendering begin
* On screen render for directory tree
* flags in render to indicate is_public_readable
* beautify render flags
* format
* offload dynamic vector into individual files
* saving. exposed dir tree writing for double use
* save: additional formatting
* save: clean up and some additional notes
* load done
* delete unnecessary debug log
* Load: safer way to handle backward compatibility
`parsed` being true is only contingent on whether the header (device type, UID, etc) are correctly read. The detailed data can be absent if saved from previous versions.
Side effects:
1. The data format version number must not increment.
2. Newer sections of dumps must be appended in the end of the file.
* format
* handle block reading according to IC type
Old version was aimed for FeliCa Lite dumping, which doesn't apply to FeliCa standard. Thus they need to be diverged in the poller run workflow.
* read block content works. rendering begin
* Render Refactor: dir & dump view from submenu
* Render: show IC type name
* IC parsing function cleanup
* Revert "IC parsing function cleanup"
This reverts commit ee3f7bf125.
* Load: Standard dump. Fully backward compatible
* format
* sync API version
* format saved file
* delete unused variable
* clean ups
* IC type addition
* correction
* beautify attribute parsing
* correction
* Lite save: delete extra line
* correction: FeliCa link in Lite-S mode
* format
* Save: simplify printing
* update IC type parsing
* conform to api standard: const resp ptr to ptr
also slightly faster and more readable block dump loop
* disambiguate workflow type vs ic type
It was too confusing to have the ic name string telling you one thing and ic_type enum saying the other. Might as well use better naming to indicate the use case for the two things
* beautify on device render
* reject dynamic_vector, embrace m-array
* lint
* use full variable name
* partial fix: poller context's data proper init
* edit unit test dump IC code
and a small bug fix for the Lite auth workflow
* unit test felica dump PMm correction
* Fixes for static analysis warnings
---------
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
* Add args_read_float_and_trim function
* Add args_read_duration function
* Add notes_frequency_from_name function
* Add cli_sleep function and sleep CLI command
* Update CLI top command to use cli_sleep
* Add buzzer CLI command
* toolbox: make args_read_duration less convoluted
* notification: make notification_messages_notes_frequency_from_name less convoluted
* unit_tests: better float checking
* fix formatting and f18
---------
Co-authored-by: Anna Antonenko <portasynthinca3@gmail.com>
Co-authored-by: hedger <hedger@nanode.su>
* feat: FuriThread stdin
* ci: fix f18
* feat: stdio callback context
* feat: FuriPipe
* POTENTIALLY EXPLOSIVE pipe welding
* fix: non-explosive welding
* Revert welding
* docs: furi_pipe
* feat: pipe event loop integration
* update f18 sdk
* f18
* docs: make doxygen happy
* fix: event loop not triggering when pipe attached to stdio
* fix: partial stdout in pipe
* allow simultaneous in and out subscription in event loop
* feat: vcp i/o
* feat: cli ansi stuffs and history
* feat: more line editing
* working but slow cli rewrite
* restore previous speed after 4 days of debugging 🥲
* fix: cli_app_should_stop
* fix: cli and event_loop memory leaks
* style: remove commented out code
* ci: fix pvs warnings
* fix: unit tests, event_loop crash
* ci: fix build
* ci: silence pvs warning
* feat: cli gpio
* ci: fix formatting
* Fix memory leak during event loop unsubscription
* Event better memory leak fix
* feat: cli completions
* Merge remote-tracking branch 'origin/dev' into portasynthinca3/3928-cli-threads
* merge fixups
* temporarily exclude speaker_debug app
* pvs and unit tests fixups
* feat: commands in fals
* move commands out of flash, code cleanup
* ci: fix errors
* fix: run commands in buffer when stopping session
* speedup cli file transfer
* fix f18
* separate cli_shell into modules
* fix pvs warning
* fix qflipper refusing to connect
* remove temp debug logs
* remove erroneous conclusion
* Fix memory leak during event loop unsubscription
* Event better memory leak fix
* unit test for the fix
* improve thread stdio callback signatures
* pipe stdout timeout
* update api symbols
* fix f18, formatting
* fix pvs warnings
* increase stack size, hope to fix unit tests
* cli completions
* more key combos
* commands in fals
* move commands out of flash
* ci: fix errors
* speedup cli file transfer
* merge fixups
* fix f18
* cli: revert flag changes
* cli: fix formatting
* cli, fbt: loopback perf benchmark
* thread, event_loop: subscribing to thread flags
* cli: signal internal events using thread flags, improve performance
* fix f18, formatting
* event_loop: fix crash
* storage_cli: increase write_chunk buffer size again
* cli: explanation for order=0
* thread, event_loop: thread flags callback refactor
* cli: increase stack size
* cli: rename cli_app_should_stop -> cli_is_pipe_broken_or_is_etx_next_char
* cli: use plain array instead of mlib for history
* cli: prepend file name to static fns
* cli: fix formatting
* cli_shell: increase stack size
* Now cli_shell can be customized with another motd and another command set
* Added custom motd callback definition
* Now user can alloc and free his own cli command set
* cli_vcp can now restart shell with another command set
* Help command modified to show available commands from different command sets
* Api adjustement
* Reworked nfc_cli to start new shell with another command set
* Revert custom shell changes from vcp
* Custom motd callback moved to cli_shell
* Cli Shell now can be started from ongoing cli command
* Help command moved to a separate function so it can be used for custom shell
* Now nfc command spawns separate shell for further nfc commands
* cli_shell: give up pipe to command thread
* fix formatting
* cli_shell: separate into toolbox
* speaker_debug: fix
* fix: format
* Merge branch 'portasynthinca3/3928-3929-cli-fals-threads' into portasynthinca3/3965-cli_shell-toolbox
* fix merge
* fix. merge.
* fix formatting
* fix: cmd flags
* fix: formatting
* Added basic command descriptor structs and macros
* Basic nfc commands definitions added
* Nfc cli commands collection and functions added
* Raw skeleton of nfc cli processor added
* cli: increase default stack depth
* New callbacks for ctx alloc / free added
* nfc_cli moved to cli folder
* Some more logic for command processor
* Scanner command no works via command_processor
* plugin manifest adj
* Argument descriptors were removed, now only keys left
* Some helper command function implemented
* Command processor logic now mostly works
* Added all parsers and dummy implementation of raw cmd
* Now processor checks duplicated keys and treat them as errors
* Some renamings
* Arguments processing moved to separate function
* Now command processor can reuse context of previuos command for the next one if it's allowed
* can_reuse callback added for checking if context can be reused
* command processor is now freed on nfc cli exit
* Some cleanups
* First working version of raw command
* Now input data are placed directly to bit buffer
* Added tag
* Introduced request/response structs
* Moved raw command to a separate folder
* Moved some common types to header
* Added protocol specific handlers for iso14a and felica
* Opened felica crc header for referencing
* Added handler for iso14443_3b
* Opened iso15693_3_poller for referencing
* Added iso15693_3 handler for raw command
* NfcCliRawError enum introduced for response result
* Refactored handlers implementation
* Formatting functions now added as helpers
* New printing result logic
* Not present error value added to enum
* Timeout added to raw command
* Command processor now supports multivalue keys
* Apdu command implementation added
* NfcScanner moved to helpers and command now uses it
* Helper now can format protocol names
* Dump command added
* Added some more functions to scanner helper
* Dump main logic simplified
* Dump handlers moved to protocols folder
* Protocol parser added to simplify searching protocol by name
* Protocol and key arguments added to dump command
* Cleanups
* Apdu now parses protocol using helper parser
* Raw now parses protocol using helper parser
* Wrong naming fix
* Emulate command added to cli
* Description added to action descriptor and command macros
* Description field added to all commands
* Removed unnecessary enum for commands
* Added functions for formatting command and action info
* Proper error messages and help added
* Fix for unsupported single action command
* Function renamed to more appropriate
* Field command moved to all other commands
* Cleanups
* Nfc commands modified with new cli shell
* Removed previous nfc_cli.c after merge
* Removed nfc_cli.h header
* Some renamings and cleanups
* Some comments and instructions added
* Some comments and instructions added
* TODOs removed
* Fix for missing parse callback
* Added not implemented dummy for mfu actions, for now
* Fix name mismatch
* Remove unneeded header
* Mfu command moved to separate folder, also raw info action logic added
* Dictionary with id/vendors added to assets. It is used by nfc_cli_mfu_info_get_vendor function
* One more unneeded header removed
* Moved mfu info action to a separate file
* Info action now uses sync mfu poller
* mfu rdbl action added
* wrbl action added for mfu command
* Some formatting for rdbl command
* Function for formatting mfu errors added
* All mfu actions now show errors in the same way
* Fix error with sync poller. Previously when read failed function returned ErrorNone, now it processes iso14a error to get proper value
* Make PVS happy
* Nfc cli now doesn't start if desktop app is running
* Make action description look more common
* Scanner now has -t key and can show detected protocol hierarchies
* Apdu now checks max input payload data
* Proper format
* Proper error handling added to dump command
* Timeout key added dump command
* Fix merge issue
* formatting
* Pragma pack replaced with FURI_PACKED
* Fix felica memory leak
---------
Co-authored-by: Anna Antonenko <portasynthinca3@gmail.com>
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
* Expansion: Wake thread on UART error flag
* Expansion: Stop UART async rx early
* FuriHalSerial: Fix RXFNE interrupt hang
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
* 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>
* feat: pinning settings in favorites
* include archive in unit tests fw
* change settings icon
* update text with suggestions from the ui team
* Small touch of constness
---------
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
* Support longer advertised BLE UUID
* BLE: support manufacturer data
* Don't pair when GapPairingNone
* Add PR feedback
---------
Co-authored-by: hedger <hedger@users.noreply.github.com>
* libs: stricter constness for saving RAM with .rodata section; fbt: sdk: fixed signature generation for nested const params
* hal: additional fixes for constness in USB subsystem
* debug apps: additional usb-related fixes
* mjs: more consts for token parser
* fatfs: const driver struct
* hal: more consts for ble & nfc vars
* hal: made FuriHalSpiBusHandle static
* hal: made FuriHalI2cBusHandle static
* usb: restored previous api
* linter fixes
* API fixes
* Fill option for widget frame
* Add widget circle element
* Add widget line element
* Fix missing include for InputType
* Fix missing comment
* Update api symbols
* Load .fxbm from file
* Fix copy pasta
* Add fill param to example
* Fix some comments
* Bump JS SDK 0.3
* Fix free
* Rename widget frame to rect
* Gui: add widget_add_frame_element backward compatibility macros
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* furi: update heap4 to latest
* debug: heap under/overflow testing app
* fix formatting
* silence pvs warnings
* Linker: symbols without type
* Infrared: fix crash in universal remotes on long back press
* Infrared: properly fix incorrect input handling behavior and crash in universal remote. Fix same issue in hid_app.
* FreeRTOSConfig: explicit cast to uint in configTOTAL_HEAP_SIZE
* Format sources
* C and C++ compatible version of stm32wb55_linker.h
Co-authored-by: あく <alleteam@gmail.com>
* Move OTG controls to the power service
* Accessor: add missing power service import
* Power: add is_otg_enabled to info and properly handle OTG enable with VBUS voltage present
* Power: method naming
* Power: add backward compatibility with old-style use of furi_hal_power
* Scripts: lower MIN_GAP_PAGES to 1
* SubGhz: fix incorrect logging tag
* SubGhz: delegate OTG management to power service
* Power: fix condition race, various improvements
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* feat: universal ir signal selection
* fix: f18, format specifiers
* update labels with suggestions from the ui team
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* Furi, USB, BLE: extra stack space for some threads, small code cleanup.
* Furi: thread watermark check on exit, explicitly crash if built with LIB_DEBUG=1
* Debug: color logging in apps/furi gdb helper, check and show crash message in gdb console.
* WIP: fix lost BadBLE keystrokes
* Switch to semaphores for synchronization
* Move checking to the gap level
* Remove leftovers from hid_service
* Remove more leftovers from hid_service
* De-allocate the semaphore after use
* Change the timeout to account for unforeseen situation
* Update F18 API
* Fix naming and unbump api version
* Move away from semaphores
* Remove the left over include
* Ble: cleanup error handling in ble_gatt_characteristic_update
* Fix PVS warning
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* Core: event_flag, removing duplicate code
* event_loop: add support furi_event_flags
* Examples: add missing free in event loop examples
* Furi: fix event flag
* Sync api symbols
* Unit_test: evet_loop_event_flags
* Fix multiple waiting list elements handling
* Unit_test: add event_loop_event_flag test
* FURI: event_loop add restrictions
* Fix multiple waiting lists items for good
* Improve FuriEventLoop unit tests
* Abolish callback return value
* Remove return value from callback signature
* Use bool level value instead of int32_t
* Add unit tests for FuriStreamBuffer
* Add unit tests for FuriSemaphore
* Speed up test execution
* Improve docs
* Add a stub for furi os-level primitives
* Add more checks for edge cases
* Allow event loop notification from ISR
* Bump api version
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
* Initial structure for nonce collection
* Nonce logging
* Dictionary attack structure
* Fix compilation
* Identified method to reduce candidate states
* Use EXT_PATH instead of ANY_PATH
* Use median calibrated distance, collect parity bits
* Modify parity collection
* Fixed parity bit collection
* Add note to fix nonce logging
* Fix nonce logging
* Clean redundant code
* Fix valid_nonce
* First attempt disambiguous nonce implementation
* FM11RF08S backdoor detection
* Initial accelerated dictionary attack for weak PRNGs
* Refactor to nested dictionary attack
* Renaming some variables
* Hard PRNG support for accelerated dictionary attack
* Update found keys, initial attempt
* Update found keys, second attempt
* Code cleanup
* Misc bugfixes
* Only use dicts in search_dicts_for_nonce_key if we have them
* Collect nonces again
* Should be detecting both backdoors now
* Relocate backdoor detection
* Hardnested support
* Fix regression for regular nested attack
* Backdoor read
* Backdoor working up to calibration
* Backdoor nested calibration
* Don't recalibrate hard PRNG tags
* Static encrypted nonce collection
* Update TODO
* NFC app UI updates, MVP
* Bump f18 API version (all functions are NFC related)
* Add new backdoor key, fix UI status update carrying over from previous read
* Clear TODO line
* Fix v1/v2 backdoor nonce collection
* Speed up backdoor detection, alert on new backdoor
* Add additional condition to backdoor check
* I'll try freeing memory, that's a good trick!
* Do not enter nested attack if card is already finished
* Do not reset the poller between collected nonces
* Clean up various issues
* Fix Hardnested sector/key type logging
* Add nested_target_key 64 to TODO
* Implement progress bar for upgraded attacks in NFC app
* Typo
* Zero nested_target_key and msb_count on exit
* Note TODO (malloc)
* Dismiss duplicate nonces
* Fix calibration (ensure values are within 3 standard deviations)
* Log static
* No nested dictionary attack re-entry
* Note minor inefficiency
* Uniformly use crypto1_ prefix for symbols in Crypto1 API
* Fix include paths
* Fix include paths cont
* Support CUID dictionary
* Fix log levels
* Avoid storage errors, clean up temporary files
* Handle invalid key candidates
* Fix memory leak in static encrypted attack
* Fix memory leak, use COUNT_OF macro
* Use single call to free FuriString
* Refactor enums to avoid redefinition
* Fix multiple crashes and state machine logic
* Fix inconsistent assignment of known key and known key type/sector
* Backdoor known key logic still needs the current key
* Larger data type for 4K support
* Fix typo
* Fix issue with resume logic
* Mark TODOs for next PR
* Remove redundant assignment
* Fix size_t format specifier
* Simplify auth_passed condition
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
* reduced reserved memory size for system stack; added temporary markup to monitor usage
* fbt: relink elf file on linker script change; removed debug memory fill
* Make PVS Happy
* Make doxygen happy
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
* Now 4a listener invokes upper level callback on Halt and FieldOff
* Added new method for drawing mirrored XBM bitmaps
* iso14443_4a poller logic enhanced
* Function renamed accroding to review suggestions
* Rename #2
* Api adjustements
* Correct API bump
Co-authored-by: あく <alleteam@gmail.com>
- BT Service: cleanup code
- Dialog: correct release order in file browser
- Rpc: rollback to pre #3881 state
- Kernel: fix inverted behavior in furi_kernel_is_running
- Log: properly take mutex when kernel is not running
- Thread: rework tread control block scrubbing procedure, ensure that we don't do stupid things in idle task, add new priority for init task
- Timer: add control queue flush method, force flush on stop
- Furi: system init task now performs thread scrubbing
- BleGlue: add some extra checks
- FreeRTOSConfig: fix bunch of issues that were preventing configuration from being properly applied and cleanup
State callbacks assumed they were invoked from the thread that changed
its state, but this wasn't true for FuriThreadStateStarting in the past,
and now it's not true for FuriThreadStateStopped either.
Now it is safe to release the thread memory form the state callback
once it switches to FuriThreadStateStopped. Therefore, pending deletion
calls can be removed.
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>