1
mirror of https://github.com/DarkFlippers/unleashed-firmware.git synced 2025-12-13 05:06:30 +04:00

Compare commits

...

268 Commits

Author SHA1 Message Date
Methodius
3afee368de electra non-initialized encoded epilogue on render fix 2024-05-24 20:33:34 +03:00
MX
e8cbce6e1d Merge remote-tracking branch 'OFW/dev' into dev [ci skip] 2024-05-24 20:25:40 +03:00
gornekich
ab2fcaf4ab [FL-3829] NFC App: fix changing UID (#3663)
* nfc app: fix changing uid on each byte change
* nfc app: remove unused code
2024-05-23 13:46:00 +01:00
MX
8a58fc1ca7 Merge remote-tracking branch 'OFW/dev' into dev 2024-05-23 00:33:57 +03:00
hedger
807bec14b1 Replaced obsolete-format delay (#3660) 2024-05-22 19:13:28 +01:00
あく
8ba938cec1 [FL-3775] Archive: fix condition race on exit (#3659)
* Archive: fix condition race on exit

* Format sources and remove debug logging

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-05-22 21:35:59 +04:00
gornekich
11070c9e5e Text Box: fix displaying text with end text focus (#3658)
* text box: fix reset text offset state after initial text iteration
* debug: add tests for text box view debug app
* hal: flash: removed redundant #else

Co-authored-by: hedger <hedger@nanode.su>
2024-05-22 18:14:33 +01:00
MX
6a91588f52 Merge remote-tracking branch 'OFW/dev' into dev 2024-05-21 01:34:05 +03:00
あく
e0797131ec FuriHal: add flash ops stats, workaround bug in SHCI_C2_SetSystemClock (#3657)
* FuriHal: add flash ops stats, workaround bug in SHCI_C2_SetSystemClock
* hal: flash: added FLASH_OP_DEBUG to enable latency measurement

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-05-20 19:17:01 +01:00
hedger
9e42e00ead Icons: compression fixes & larger dimension support (#3564)
* toolbox, gui: fixes for compressed icon handling
* ufbt: fixes for generated vscode project
* scripts: increased max dimensions for image converter
* icon type changes
* linter fixes; api sync
* gui: docs fix
* toolbox: fixed potential decoder buffer overflow
* minor cleanup
* fbt: sdk: suppressed deprecation warnings in API table
* toolbox: compress: added unit tests
   vscode: now installs resources for unit_tests
   unit_tests: now loads subghz region data
* toolbox: compress: review fixes, pt 1
* compress: now passes decoder buffer size as constructor argument; auto-resize decoder buffer; crash on failed icon decompression
* PVS fixes
* pvs fixes, pt2
* doxygen fixes
* investigating unit test failures
* investigating unit test failures
* investigating unit test failures
* investigating unit test failures
* investigating unit test failures
* UnitTests: move all tests into plugins, brakes testing
* UnitTests: add plugin API and update plugin entrypoints
* UniTests: Test runner that works with plugins
* fbt: extra filtering for extapps to include in build
* UnitTests: filter tests by name
* loader: restored API table for unit_test build config
* Add various missing symbols to API table
* UnitTest: fail on plugin load error
* UnitTests: cleanup plugin api and reporting
* unit_tests: composite resolver
* UnitTests: remove unused declaration
* unit_tests, nfc: moved mock nfc implementation to libnfc
* unit_tests: api: removed redundant #define
* toolbox: compress: removed size_hint for icons; triggering furi_check on oversized icons
* gui: icon, icon_animation: removed size hit APIs
* Format Sources. Cleanup code.
* loader: refuse to start .fal as app
* toolbox: compress: fixed memory corruption in operations with small destination buffer; added unit tests for that case
* unit_tests: proper test skipping; better selective test interface
* unit_tests: moved 'loading' logging to proper location

Co-authored-by: あく <alleteam@gmail.com>
2024-05-20 18:23:47 +01:00
gornekich
d5339f8270 [FL-3816] Text Box rework (#3642)
* text box: rework text box to use less memory
* text box: optimize lines iteration
* text box: fix back scrolling
* text box: add end focus support
* text box: allocate index buffer on stack instead of heap
* text box: fix index decrement
* apps: add text box debug app
* debug: rework text box view app with view stack
* debug app: rename text_box_test app to text_box_element_test
* text box: rework text box module
* debug: update text box view test
* text box: fix end focus initial offset
* debug: fix memory leak in text box view test app

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-05-20 16:13:20 +01:00
MX
e909818f65 fix stealth jiggler icon with ble 2024-05-19 04:53:30 +03:00
MMX
e4ed15ba23 Merge pull request #753 from Willy-JL/hid-app-merge-fix
Hid app merge fix
2024-05-19 04:50:29 +03:00
MX
8275140fe6 rename 2024-05-19 03:57:19 +03:00
MX
4f6c98dc0d move js examples to examples subfolder 2024-05-19 03:56:22 +03:00
MX
21abcb56fd merge ofw dev missing parts 2024-05-19 03:54:21 +03:00
MX
fb6070f29d Merge remote-tracking branch 'OFW/dev' into dev 2024-05-19 03:45:07 +03:00
WillyJL
de4b086083 Fix calling both view_free_model() and view_free() (#3655) 2024-05-18 19:40:01 +01:00
Willy-JL
7c013c0534 HID App: Add few missing things from last merge 2024-05-18 08:31:36 +01:00
Willy-JL
23ca7e7b48 Some formatting to match upstream 2024-05-18 08:28:45 +01:00
Willy-JL
c4709a5b6b HID App: Update icons 2024-05-18 08:26:36 +01:00
Willy-JL
276feac73f HID App: Update to scene based startscreen 2024-05-18 08:24:29 +01:00
WillyJL
0d456aa550 JS: Add textbox module (#3597)
* JS: Add textbox module
* Using view_holder instead of view_dispatcher, more checks in js_textbox_show
* API version sync
* Rename emptyText() to clearText()
* Keeping view_holder allocated for thread sefety
* Js: proper comparision with 0 in js_math_sign
* Js: add comments and fix condition race in textbox

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: nminaylov <nm29719@gmail.com>
2024-05-17 18:43:52 +01:00
WillyJL
c673b53e21 JS: Add math module (#3598)
* JS: Add math module
* Double constants
* Error on argument type mismatch
* Fix missing returns
* Using sin, exp from c library
* asin, acos, pow, sqrt too
* Js: tests for math module and various fixes.

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: nminaylov <nm29719@gmail.com>
2024-05-17 17:45:40 +01:00
MX
51bb9c0a0a Merge remote-tracking branch 'OFW/dev' into dev 2024-05-17 17:15:48 +03:00
gornekich
217bfac2fc NFC: add Slix capabilities (#3652)
* iso15693 listener: fix inventory cmd and buffer overflow
* iso15 listener: fix read multiple blocks command
* slix: print password
* slix: add capabilities field
* slix listener: skip password validation for special capability
* slix: fix capability name
* slix: add capabilities handler to verify and reset
* nfc test: introduce slix tests
* fbt: change toolchain back to 33 version
* slix: fix saving capablities comment
* unit tests: add slix files to resources
* slix: fix set passwrd signature
* nfc tests: add set correct password test
* nfc test: complete slix password tests
* nfc test: add slix file test
* nfc test: handle errors in worker callback
* iso15693_3: code clean up
* iso15693_listener: fix incorrect afi handling
* slix: chage capabilities format to one word camel case
* unit tests: update nfc files with new slix format

Co-authored-by: あく <alleteam@gmail.com>
2024-05-17 12:58:32 +01:00
Astra
603a86dbe6 [FL-3797] Settings refactor fixes (#3654) 2024-05-17 12:52:42 +01:00
MX
7c5111e29f Merge remote-tracking branch 'OFW/dev' into dev 2024-05-16 23:37:03 +03:00
WillyJL
63403bbae2 JS: Add submenu module (#3601)
* JS: Add submenu module
* Using view_holder instead of view_dispatcher

Co-authored-by: nminaylov <nm29719@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-05-16 18:55:08 +01:00
あく
7c63bf7574 Revert "TLSF memory allocator. Less free flash, moar free ram. (#3572)" (#3651)
* Revert "TLSF memory allocator. Less free flash, moar free ram. (#3572)"

This reverts commit 1d17206e23.

* Fix PVS warnings

* github: logging for ticket number checks to stdout

* memgr: removed offending todo

---------

Co-authored-by: hedger <hedger@nanode.su>
2024-05-16 18:43:27 +04:00
MX
0ae78dfcdd Revert TLSF
This reverts commit 5dddb075ac
2024-05-16 05:41:16 +03:00
MX
97d5b8b6f6 subghz plugin ext only load 2024-05-16 03:54:20 +03:00
MX
33daa960cf Merge remote-tracking branch 'OFW/dev' into dev 2024-05-16 03:53:59 +03:00
Sergei Gavrilov
5dddb075ac TLSF memory allocator. Less free flash, moar free ram. (#3572)
* add tlsf as submodule
* libs: tlsf
* Furi: tlsf as allocator
* Furi: heap walker
* shmal fixshesh
* f18: tlsf
* PVS: ignore tlsf
* I like to moving
* merge upcoming changes
* memmgr: alloc aligned, realloc
* Furi: distinct name for auxiliary memory pool
* Furi: put idle and timer thread to mem2
* Furi: fix smal things in allocator
* Furi: remove aligned_free. Use free instead.
* aligned_malloc -> aligned_alloc
* aligned_alloc, parameters order
* aligned_alloc: check that alignment is correct
* unit test: malloc
* unit tests: realloc and test with memory fragmentation
* unit tests: aligned_alloc
* update api
* updater: properly read large update file

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-05-16 03:51:45 +03:00
Eric Betts
6d1a5c71e6 Skylanders plugin (#3315)
* PoC skylanders plugin
* based on db0c7e4fad
* More figures
* Fix util methods

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2024-05-16 03:44:40 +03:00
Eric Betts
50bee67748 Skylanders plugin (#3315)
* PoC skylanders plugin
* based on db0c7e4fad
* More figures
* Fix util methods

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2024-05-15 19:09:08 +01:00
MX
3005f6cd9a Hid app improvements
- Move new mouse jiggler into mouse jiggler stealth
- Set stealth jiggler max time default value to 4 min and min value to 1 min
- Various UI fixes
- Merge changes from OFW commit 11d7f53854

([FL-3770, FL-3680] HID App improvements and little extra (3518))
2024-05-15 19:08:10 +03:00
MX
fb8f59fa1d fix merge issues 2024-05-15 19:04:37 +03:00
Sergei Gavrilov
1d17206e23 TLSF memory allocator. Less free flash, moar free ram. (#3572)
* add tlsf as submodule
* libs: tlsf
* Furi: tlsf as allocator
* Furi: heap walker
* shmal fixshesh
* f18: tlsf
* PVS: ignore tlsf
* I like to moving
* merge upcoming changes
* memmgr: alloc aligned, realloc
* Furi: distinct name for auxiliary memory pool
* Furi: put idle and timer thread to mem2
* Furi: fix smal things in allocator
* Furi: remove aligned_free. Use free instead.
* aligned_malloc -> aligned_alloc
* aligned_alloc, parameters order
* aligned_alloc: check that alignment is correct
* unit test: malloc
* unit tests: realloc and test with memory fragmentation
* unit tests: aligned_alloc
* update api
* updater: properly read large update file

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-05-15 16:47:21 +01:00
MX
548d370ab9 Merge remote-tracking branch 'OFW/dev' into dev 2024-05-15 18:25:03 +03:00
MX
5efbd36bb8 sync anims 2024-05-15 18:23:19 +03:00
MX
1afa3f7ef3 Merge remote-tracking branch 'OFW/dev' into dev 2024-05-15 18:22:54 +03:00
Max Andreev
3d3db9f5b0 Add new map analyser (#3648)
* Add new map analyser
* Fix typos

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-05-15 12:25:02 +01:00
Astra
e3f95a326b [FL-3797] Settings menu refactoring (#3632)
* Settings menu refactoring
* Update F18 api
* Wording changes
* Update certification icon
* Desktop: optimize settings save routine, fix navigation lag
* Gui: add submenu position getter. Desktop: proper menu index preservation.
* Gui: proper index getter for submenu. Desktop: cleaner settings navigation.

Co-authored-by: あく <alleteam@gmail.com>
2024-05-14 19:58:09 +01:00
Leptopt1los
a86aeface5 electra lfrfid protocol implemented (#3640) 2024-05-15 00:27:35 +10:00
gornekich
5f9b300ab2 NFC: Mf Desfire fix reading big files (#3616)
* mf desfire: fix incorrect long files reading
* nfc app: trim record size for mf desfire render
* mf desfire: rework reading long record files
* mf desfire: more robust size check

Co-authored-by: あく <alleteam@gmail.com>
2024-05-14 13:34:27 +01:00
hakuyoku2011
a7715704f8 Infrared: Add Toshiba RAS-2518D (#3635)
* Infrared: Add Toshiba RAS-2518D
* Infrared: cleanup AC universal remote

Co-authored-by: あく <alleteam@gmail.com>
2024-05-14 13:15:30 +01:00
fatale69
98c51d13a1 vscode: config fixes (#3587)
* Update extensions.json

* vscode: fixed extensions config for clangd; updated paths for current toolchain location convention

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
2024-05-13 23:33:20 +04:00
あく
b9966a50d9 Ble: new connection parameters negotiation scheme (#3644)
* Ble: new connection parameters negotiation scheme

* Ble: finer connection parameters negotiation flow

* Ble: naming and grammar

* gap: typo fix & field init

---------

Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-05-13 21:54:59 +04:00
あく
9648da951a FuriHal: move version init to early stage (#3647) 2024-05-13 21:32:28 +04:00
Samar Sunkaria
8ffee678c6 Add support for R_ARM_REL32 relocations. (#3631)
It is fairly straightforward to correctly resolve an R_ARM_REL32 relocation as described in
in the "Relocation types" section of ARM ELF Specification
(https://developer.arm.com/documentation/espc0003/1-0/?lang=en). The documentation provides
the following formula:

```
S - P + A
```

where `S` is the value of the symbol (symAddr), `P` is the address of the place being
relocated (relAddr), and `A` is the addend (value extracted from the storage unit being
relocated, in this case).

I encountered the R_ARM_REL32 relocation type as part of my work for building apps written
in Swift for the Flipper Zero. I have manually tested that this relocation works correctly
by building and running multiple apps that depend on this relocation.

Co-authored-by: あく <alleteam@gmail.com>
2024-05-13 16:21:28 +01:00
WillyJL
e1cb69d046 Remove unused DolphinWait_61x59 icon (#3645)
Co-authored-by: あく <alleteam@gmail.com>
2024-05-13 16:11:46 +01:00
Astra
b60e6042a5 [FL-3813] Add the Akira animation (#3636)
* Add the Akira animation
* Dolphin: adjust weight for new animation

Co-authored-by: あく <alleteam@gmail.com>
2024-05-13 15:47:07 +01:00
MX
96db11a0d6 Merge remote-tracking branch 'OFW/dev' into dev 2024-05-11 00:54:32 +03:00
あく
b12d43b765 Desktop: fix crash on autolock after restart in locked state (#3643)
* Desktop: fix crash on autolock after restart in locked state
* Desktop: switch to clock model to fix condition race in desktop lock.
2024-05-10 16:01:33 +01:00
MX
a89a67d103 fix naming 2024-05-03 23:04:58 +03:00
MX
9656331618 update changelogus 2024-05-03 22:31:56 +03:00
MMX
a8dcec0dad Merge pull request #750 from DarkFlippers/electra
Electra intercom lfrfid protocol
2024-05-03 22:25:05 +03:00
Methodius
d73832a5dd Merge remote-tracking branch 'origin/dev' into electra 2024-05-03 22:17:14 +03:00
MMX
a27aa0336a Merge pull request #746 from gushmazuko/feature/random_mouse_jiggler
Enhance Random Interval and Movement Functionality in HID Mouse Jiggler for Improved Stealth and Human-Like Behavior
2024-05-03 22:04:55 +03:00
MX
887f6a20fc We already using furi random, cleanup unused parts, format code 2024-05-03 21:28:18 +03:00
MX
786dbfe0c3 Merge branch 'dev' into feature/random_mouse_jiggler 2024-05-03 21:09:21 +03:00
MX
374e96bb7d ibutton and lfrfid small ui improvements 2024-05-03 20:59:28 +03:00
MX
c9d23a9d1d update changelog 2024-05-03 19:02:09 +03:00
MX
6bfa383cea Revert "Merge remote-tracking branch 'OFW/astra/3746-mfp-detect' into dev"
This reverts commit 9b377e6f80, reversing
changes made to 1736a8a7c2.
2024-05-03 14:50:58 +03:00
Methodius
bf721d7a5f Merge remote-tracking branch 'origin/dev' into electra 2024-05-01 21:12:14 +03:00
Methodius
7077d588c7 electra protocol rename. again 2024-05-01 21:12:06 +03:00
MX
75ece9b697 add temp fix since no proper fix exist at the moment 2024-05-01 19:07:57 +03:00
MX
a57dbe446e update DS1420 for latest ibutton changes 2024-05-01 16:53:49 +03:00
MX
9b377e6f80 Merge remote-tracking branch 'OFW/astra/3746-mfp-detect' into dev 2024-05-01 16:49:53 +03:00
MX
1736a8a7c2 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-30 22:31:39 +03:00
Astra
7414e6d4df [FL-3817] iButton: fix crash when deleting some keys (#3617)
* iButton: fix crash when deleting some keys
* Fix cyfral crashes
* Better data formatting
* Remove void returns
2024-04-29 19:56:15 +09:00
MX
e7ef923729 Merge remote-tracking branch 'OFW/astra/3817-ibutton-crash' into dev 2024-04-27 15:09:25 +03:00
MX
c157ca9879 Merge remote-tracking branch 'OFW/gornek/desfire_long_files' into dev 2024-04-27 15:09:21 +03:00
MX
4965215c8d Merge remote-tracking branch 'OFW/dev' into dev 2024-04-27 14:44:18 +03:00
Astra
379e8d2a6a Fix cyfral crashes 2024-04-27 15:53:19 +09:00
Astra
42c69b076a iButton: fix crash when deleting some keys 2024-04-26 19:07:51 +09:00
gornekich
d13017a7fe Merge branch 'dev' into gornek/desfire_long_files 2024-04-25 20:13:20 +01:00
gornekich
0e3cbb4911 mf desfire: rework reading long record files 2024-04-25 20:01:32 +01:00
gornekich
f544aa8eb6 nfc app: trim record size for mf desfire render 2024-04-25 19:55:35 +01:00
gornekich
e5f9af3b43 mf desfire: fix incorrect long files reading 2024-04-25 18:13:52 +01:00
あく
43c4381820 [FL-3814] Desktop: cleanup error popups (#3615)
* Desktop: cleanup error popups, add missing factory keys notification
* Desktop: enclave warning wording
2024-04-25 08:39:38 +09:00
Astra
1559ee6293 [Fl-3809] Troika parser visual fixes (#3614)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-24 21:47:40 +09:00
Astra
34abaa7e27 [FL-3815] Fix the retry/exit confirmation prompts in iButton (#3613) 2024-04-24 21:35:15 +09:00
MX
3108f07a4b faac rc add button B 2024-04-23 15:04:20 +03:00
MX
c3b59a9dba add todo 2024-04-23 14:54:56 +03:00
MX
3269f751cd js vgm module and widget fix
VGM js module by jamisonderek
Js fixes by jamisonderek
2024-04-23 12:24:07 +03:00
Astra
2987a46322 Alloc takes no arguments 2024-04-23 11:00:37 +09:00
Astra
fb018ec170 Bump F18 API 2024-04-23 10:54:11 +09:00
Astra
85fc0a2dd3 Merge branch 'dev' into astra/3746-mfp-detect 2024-04-23 10:39:34 +09:00
Astra
83ff6fb8bf Mifare Plus detection done 2024-04-22 21:09:06 +09:00
Methodius
70cdd26855 electra cleanup, protocol description added 2024-04-21 21:03:10 +03:00
Methodius
0a7e258c1a Merge remote-tracking branch 'origin/dev' into electra 2024-04-21 12:31:55 +03:00
MX
f88a916ccc Merge remote-tracking branch 'OFW/dev' into dev [ci skip] 2024-04-21 11:42:57 +03:00
gushmazuko
6cb9ad12f1 Enhance Random Interval and Movement Functionality 2024-04-21 02:14:46 +02:00
Methodius
5bf16e7e0e no more hardcoded epilogue (for now, whitelist will be great if it is possible) 2024-04-19 23:17:18 +03:00
Methodius
7b99f0b0bb Merge remote-tracking branch 'origin/dev' into electra 2024-04-19 18:07:23 +03:00
gornekich
c87683596a nfc app: add legacy keys for plantain cards (#3602)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-19 23:22:07 +09:00
WillyJL
9bef2aaec6 GUI: Fix array out of bounds in menu exit (#3604)
* GUI: Fix array out of bounds in menu exit
* Gui: fix incorrect empty menu handling
* Gui: add missing item check in menu ok handling
* Gui: remove dead code from menu module

Co-authored-by: あく <alleteam@gmail.com>
2024-04-19 23:10:48 +09:00
Leopold
286fd796e7 add support for S(WTX) request in iso14443_4a_poller (#3590)
Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-04-19 21:11:22 +09:00
Astra
0d73a58123 Mosgortrans parser output fixes (#3554)
* Fix mosgortrans/troika newlines and mark unused variables
* Supress warnings for TODOs that don't need a ticket

Co-authored-by: あく <alleteam@gmail.com>
2024-04-19 21:01:57 +09:00
Astra
9042009b0b Proper detection (WIP) 2024-04-19 20:43:18 +09:00
MX
8eba6e18ff Merge remote-tracking branch 'OFW/dev' into dev 2024-04-18 17:24:48 +03:00
MX
4422a03ae9 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-18 17:22:36 +03:00
WillyJL
12112e70bc BLE: Add GapPairingNone support (#3596)
* BLE: Add GapPairingNone support
* FuriHal: cleanup naming in ble gap, remove useless config options

Co-authored-by: あく <alleteam@gmail.com>
2024-04-18 10:26:58 +09:00
gornekich
be43e49869 nfc app: fix false positive verification in bip plugin (#3595)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-18 09:56:39 +09:00
MMX
00970a4b12 Allow setting view_dispatcher callbacks to NULL again (#3580)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-18 09:34:33 +09:00
KRukus9
94c2d7a4e3 Update tv.ir (#3584)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-18 08:12:02 +09:00
Astra
4883383b20 [FL-3679] iButton new UI (#3471)
* iButton new UI
* UI final touches
* Satisfy PVS

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-04-18 08:05:37 +09:00
あく
70f93a48f5 [FL-2969] FuriHal: add ADC API (#3583)
* Examples: remove unused context
* FuriHal: add simple ADC API
* Examples: add ADC example app
* FuriHal: add extended configuration options for ADC API
* FuriHal: add ADC clock configuration, fix calibration routine for single ended mode, new optimized parameters, documentation.
* FuriHal: add FuriHalAdcChannelTEMPSENSOR sampling time note
* FuriHal: update FuriHalAdcChannelVBAT description.
* FuriHal: use insomnia while ADC is acquired.
* Examples: cleanup example_adc a little bit
2024-04-18 00:17:40 +09:00
Astra
7189026335 Initial MFPlus draft 2024-04-17 11:00:51 +09:00
MX
b079b46681 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-16 22:46:32 +03:00
gornekich
1a40fae003 [FL-3750] Mf Desfire multiple file rights support (#3576)
* mf desfire: remove unused type
* mf desfire: continue reading after failed get free mem cmd
* mf desfire: fix processing read master key settings command
* mf desfire: don't read applications if they are auth protected
* mf desfire: handle multiple rights
* mf desfire: fix PVS warnings
* mf desfire: fix print format
* mf desfire: fix logs
* mf classic: add send frame functions to poller
* unit tests: add test from mfc crypto frame exchange
* mf classic: add documentation
* mf classic: fix incorrect name
* target: fix api version
2024-04-16 14:55:24 +09:00
MX
f4ffd29bbc Allow no prefix usage of name_generator_make_detailed_datetime
Remove extra check for NULL since check is present in code already
2024-04-12 20:16:42 +03:00
MX
b299604932 js fix badusb double free crash with quit()
by Willy-JL
2024-04-12 20:02:38 +03:00
MX
6bb605f8ce Allow setting view dispatcher callbacks to NULL 2024-04-11 01:20:39 +03:00
MX
c1e8cbf3fd update changelog 2024-04-10 15:46:20 +03:00
MX
2443a702c9 update nfc parser
by zacharyweiss
2024-04-10 15:38:57 +03:00
MX
744ef8138e subghz add manually fixes 2024-04-10 15:26:47 +03:00
MX
b3151c563f Merge remote-tracking branch 'OFW/dev' into dev 2024-04-10 15:18:09 +03:00
RebornedBrain
fb9728d570 [FL-3772] Felica poller (#3570)
* New types for felica poller
* New functions for felica data transmissions
* Felica memory map extended with new fields
* Init/deinit of mbedtls context added for felica encryption
* Functions for session key and mac calculations added
* Raw felica_poller implementation added
* Removed MAC type parameter from check_mac function
* Replaced all data fields needed for auth with context structure
* Clean up felica_poller.c
* Now RC block is filled with random numbers
* New parameter for counting well-read blocks
* Some cleanups
* Felica file save and load logic added
* Now we use card key from context for session key calculation
* Copying card key to card block from auth context when both authentications succeeded, otherwise decrement blocks count by 1
* New felica poller event added
* Moved some data structions to public namespace
* FelicaAuthenticationContext struct moved to felica.h
* Field type and name changed for better ones
* Helper functions for felica_auth added to the app
* New scene for felica card key input added
* Logic for felica key input added
* Auth context request processing added
* Added block index definitions and replaced all index numbers with them
* More macro defines
* Replace nesting with do while block
* New function for write operations mac calculation added
* Replace nesting with do while block
* Make functions static for now because they are used internally
* Wrote some comments
* Raw felica render implementation
* New felica scenes
* Adjusted felica dump rendering according design requirements
* New felica scene added
* Helper for switching scene during unlock added
* Added warning scene and transfer to it
* Moved unlock scene logic to separate files
* Magic number changed
* New felica render logic
* Felica scenes adjusted according to design requirements
* Felica poller cleanups
* Some asserts added and some fixed
* Replcaed asserts to checks in public api
* Fixed pvs warnings in felica_poller
* New event for felica_poller added for incomplete read actions
* Handling of new poller event added
* Update SConscript with felica files
* Update api_symbols.csv with felica functions
* Sync API versions

Co-authored-by: あく <alleteam@gmail.com>
2024-04-10 18:51:36 +09:00
MX
c144611609 update changelog 2024-04-10 01:44:41 +03:00
MX
95da39ba88 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-09 20:33:52 +03:00
Victor Nikitchuk
db14ca964b Status output !TX/RX on the GDO2 CC1101 pin (#3571)
* Status output !TX/RX on the GDO2 CC1101 pin\
* Fix PVS warnings

Co-authored-by: あく <alleteam@gmail.com>
2024-04-10 00:05:30 +09:00
WillyJL
e3ca293eee Desktop/Loader: Unload animations before loading FAPs (#3573)
* Desktop: Unload animations before FAP is loaded
* Loader: Add API to start detached (returns instantly, queues event)
* Desktop: Fix early animation unload deadlocks
* Loader: remove redundant event
* Bump api symbols

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
2024-04-09 22:42:03 +09:00
Nikolay Minaylov
58da27fa91 JS Documentation (#3535)
* Initial JS documentation
* Spelling fix

Co-authored-by: あく <alleteam@gmail.com>
2024-04-09 18:06:37 +09:00
あく
88a6860913 Update radio stack to v1.19.0 (#3545)
* Update radio stack to v1.19.0
* Ble: set max connection interal same as min, kinda speedups everything
2024-04-09 16:01:55 +09:00
MX
c9909467f9 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-09 03:24:16 +03:00
Astra
27e61eb808 Move crypto1 to helpers, add it to the public API (#3567)
* Move crypto1 to helpers, add it to the public API
* F18 API version bump

Co-authored-by: あく <alleteam@gmail.com>
2024-04-07 23:47:48 +09:00
WillyJL
16b34c6e4d Explain RNG differences, add FURI_HAL_RANDOM_MAX (#3565)
* Explain RNG differences, add FURI_HAL_RANDOM_MAX
* Mark FURI_HAL_RANDOM_MAX unsigned

Co-authored-by: あく <alleteam@gmail.com>
2024-04-07 23:11:23 +09:00
WillyJL
6b120a3b09 Furi: Add "out of memory" and "malloc(0)" crash messages (#3574)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-07 22:49:00 +09:00
WillyJL
c31b60c7b7 IR: Fix crash on duty_cycle=1 (#3568)
* IR: Fix crash on duty_cycle=1
* Infrared: use float around duty_cycle

Co-authored-by: あく <alleteam@gmail.com>
2024-04-07 22:21:25 +09:00
MX
d1c75dc57b update changelog 2024-04-06 07:08:55 +03:00
MX
52d97b9329 update readme and fix hex uppercase 2024-04-06 06:44:08 +03:00
MX
294df5d1d4 desktop animations unload apilock revert
+ js layout fix and lfrfid ui fix
by Willy-JL
2024-04-06 05:40:53 +03:00
MX
344b624efc fix apps loading logic 2024-04-05 08:57:34 +03:00
MX
1e324a7314 fix favorites lockup 2024-04-05 08:02:38 +03:00
MX
6e4d32b941 js add badusb layout support
by Willy-JL
2024-04-05 08:01:53 +03:00
MX
22cf19dcef format 2024-04-05 06:42:05 +03:00
MX
7787845479 cleanup unused debug, set proper log levels 2024-04-05 06:41:31 +03:00
MX
ef29ed149d better subghz settings and more anim unload fixes
by Willy-JL
2024-04-05 06:36:35 +03:00
MX
a830d6b511 rework subghz settings, enable tx-rx state on unused gpio pin by default 2024-04-05 04:02:33 +03:00
MMX
f8d4d9397e Merge pull request #742 from quen0n/patch-1
Status output !TX/RX on the GDO2 CC1101 pin
2024-04-05 03:28:14 +03:00
MX
5ba6e3225b allow external apps to use infrared settings
by Willy-JL
2024-04-05 02:46:04 +03:00
MX
ec4b8b8f5e Various fixes
fixes by Willy-JL
nfc parser by zacharyweiss
js widget and path globals by jamisonderek
2024-04-05 01:25:03 +03:00
MX
45e7913435 after merge fixes
add void
2024-04-04 22:55:39 +03:00
Victor Nikitchuk
f5ca3ed2a1 Status output !TX/RX on the GDO2 CC1101 pin 2024-04-04 22:36:44 +03:00
MX
7c6541e513 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-04 21:11:59 +03:00
Sergei Gavrilov
5431257470 [FL-3765][FL-3737] Desktop: ensure that animation is unloaded before app start (#3569)
* Desktop: ensure that animation is unloaded before app start
* Desktop: unload animation only if it is loaded
2024-04-04 21:42:58 +09:00
Eric Betts
5793d5271c Hide unlock with reader for MFU-C (#3553)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-04 19:01:41 +09:00
MX
3ccb2956f3 Merge remote-tracking branch 'OFW/dev' into dev 2024-04-02 17:02:56 +03:00
hedger
d32f195557 fbt: fixed missing FBT_FAP_DEBUG_ELF_ROOT to dist env (#3563) 2024-04-02 20:30:42 +09:00
hedger
096a26b07d fbt: added -Wstrict-prototypes for main firmware (#3557)
* fbt: added -Wstrict-prototypes for main firmware (excludes extapps)
* unit_tests: fixed declarations using strict prototypes
* furi_hal: ble: changed gap stop log level to debug

Co-authored-by: あく <alleteam@gmail.com>
2024-04-02 02:02:45 +09:00
RebornedBrain
f426c44811 [FL-3801] Mifare Ultralight naming fix (#3551)
* Fixed some UI mismatches in plugin and nfc app
* Fixed nameing mismatches in mosgortrans_util
* Fix ultralight naming display
* Fix naming for Ultralight on read screen
* fbt: fixed regression with pvs-reports autoopen
* Revert st25tb_render.c

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@nanode.su>
2024-04-02 00:02:11 +09:00
WillyJL
9f71be6fef IR: Remember OTG state (#3549)
Co-authored-by: あく <alleteam@gmail.com>
2024-04-01 22:42:47 +09:00
Guacamolie
002e5cd9de Bad USB: fix crash when selecting a keyboard layout (#3555)
Commit 6de2934 (BadUSB: BLE, media keys, Fn/Globe key commands (#3403),
2024-03-25) changed the life-cycle of the bad_usb_script object, so that
the bad_usb_script is allocated when entering the work scene, and freed
when going to the config scene. It also made it so that the keyboard
layout always gets reloaded when entering the work scene.

The logic of the layout config scene, however, assumes that it still
needs to reload the keyboard layout after selecting it. The keyboard
layout data is stored within bad_usb_script however, which is NULL when
within the layout config scene.

The fix is simple. Since we are now reload the keyboard layout anyway
when entering the work scene, we can just remove this extra call.

Resolves: #3552
2024-04-01 21:49:51 +09:00
MX
e436ea275a Merge remote-tracking branch 'OFW/dev' into dev 2024-03-29 14:05:07 +03:00
Kuronons
3084469d83 L1_Mods animation update : adding VGM visual (#3502)
* Update images
* Update meta.txt
* Reverting to MOD 9999

Co-authored-by: あく <alleteam@gmail.com>
2024-03-29 12:40:26 +09:00
Georgii Surkov
64bd2f9c84 [FL-3677, FL-3798] RFID Improvements (#3524)
* Update saved_info and read_success scenes
* Update EM4100 rendering
* Update HIDExt rendering
* Update Gallagher rendering
* Update HidProx rendering
* Update IOProx rendering
* Update H10301 rendering
* Update PAC/Stanley rendering
* Add strcasecmp() to API, better manufacturer/name handling
* Update Viking rendering
* Update FDX-A rendering
* Update Pyramid rendering
* Update Indala26 rendering
* Update Idteck rendering
* Update Keri rendering
* Update Nexwatch rendering
* Update Jablotron rendering
* Update Paradox rendering
* Truncate long Hex string on scene_read_suceess
* Fix formatting
* Update AWID rendering
* Update FDX-B rendering
* Tweak string formatting in various screens
* More read_success view tweaks
* Fix formatting
* Fix Pyramid brief rendering
* Reset saved key menu when going back
* Reset other menus on back where applicable
* Update confirmation scenes
* Update emulation scene
* Update delete scene
* Update raw read info screen
* Update raw read scene, fix crash
* Update raw read success scene
* Update write scene
* Always return to SceneSelectKey after saving
* Update SceneWriteSuccess and SceneDeleteSuccess
* Replace closing parens with dots
* FL-3798: Fix special formatting in text_box
* Simplify SceneReadSuccess
* Fix crash when having a trailing newline in text_box
* Bump API symbols version
* Make PVS happy
* Format sources

Co-authored-by: あく <alleteam@gmail.com>
2024-03-29 12:32:43 +09:00
RebornedBrain
c353182353 [FL-3800, FL-3801] Fixed plugins and UI (#3543)
* Fixed some UI mismatches in plugin and nfc app
* Fixed nameing mismatches in mosgortrans_util
* Fix ultralight naming display

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-29 11:45:01 +09:00
hedger
538422e2a9 ufbt: fixes for generated vscode project (#3547)
Co-authored-by: あく <alleteam@gmail.com>
2024-03-29 10:47:43 +09:00
gornekich
74cda02368 [FL-3803] NFC: Fix mf desfire detect (#3548) 2024-03-29 10:32:15 +09:00
MX
f02b03172a Merge remote-tracking branch 'OFW/dev' into dev 2024-03-26 13:54:06 +03:00
superKoder
21e7c46033 infrared_transmit.h was missing #pragma once (#3541)
Co-authored-by: superKoder <superKoder@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-26 16:24:28 +09:00
FireFly7386
f5dff83595 Show the wrong PIN Attempt count on the login screen (#3495)
* now shows failed login attempt count
* fixed the memory leaking
* made some text changes
* removed second allocation of the furi string
* cleaned up code
* Changed Position of the Wrong Attempts Text + It removes if you typed an arrow
* aligned text to the center and switched to furi_string_reset insted of furi_string_set_str("")
* fixed weird behavior
* Desktop: cleanup pin scene code, better reporting on transition between states

Co-authored-by: あく <alleteam@gmail.com>
2024-03-26 16:18:44 +09:00
MX
175db7baa3 fix patch 2024-03-25 23:56:32 +03:00
MX
a6aa441edc add missing void 2024-03-25 23:20:48 +03:00
MX
ae84992f25 Merge remote-tracking branch 'OFW/dev' into dev 2024-03-25 23:20:46 +03:00
Silent
8ec1c74baf SavedStruct: Introduce saved_struct_get_metadata (#3392)
* SavedStruct: Replace saved_struct_get_payload_size with saved_struct_get_metadata
  This new function can obtain the magic value, version and payload size
  all at once. This makes the function useful e.g.
  for backwards compatibility.
* SavedStruct: const-qualify saved_struct_save
* Toolbox: add saved struct documentation

Co-authored-by: あく <alleteam@gmail.com>
2024-03-26 03:48:18 +09:00
Nikolay Minaylov
84beb9b23e JS CLI command (#3539)
* js command
* made the js command exit when there's an error
* JS CLI: moved to js_app
* JS: abortable cli invocations
* JS: less debug logging in console logs, fix storage descriptor leak in cli

Co-authored-by: Milk-Cool <milan-pl@mail.ru>
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-03-26 01:35:38 +09:00
MX
fda8370255 post merge fixes p2 [ci skip] 2024-03-25 15:47:34 +03:00
MX
7c0939ad52 Merge remote-tracking branch 'OFW/dev' into dev 2024-03-25 14:23:44 +03:00
MX
01f3192957 post merge fix 2024-03-25 14:08:51 +03:00
MX
9961dadee7 Gui: unicode support, new canvas API
merge ofw commit
2024-03-25 14:04:07 +03:00
MX
585b7f963d Api Symbols: replace asserts with checks
merge ofw commit
2024-03-25 13:53:32 +03:00
Brandon Weeks
bb439a9761 Fix DIP decoding for Linear Delta-3 (#3528)
Since my original PR (#2239) DIP values produced have been inverted.

Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 18:24:57 +09:00
Kowalski Dragon
8762629276 Add ChromeOS Bad USB demo (#3486)
Signed-off-by: Kowalski Dragon (kowalski7cc) <kowalski7cc@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 18:03:20 +09:00
Georgii Surkov
adafe96924 [FL-3762] Configurable Infrared TX output (#3484)
* Implement Gui for the feature
* Implement furi_hal side
* Implement IR module detection
* Fix PVS warnings
* Add comments

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-03-25 17:56:56 +09:00
Nikolay Minaylov
6de2934394 BadUSB: BLE, media keys, Fn/Globe key commands (#3403)
* BadUSB: media keys, GLOBE command
* f18 api table fix
* BadUSB over BLE
* Made PVS happy

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-03-25 17:39:33 +09:00
gornekich
f633f476c8 [FL-3787] NFC: Slix privacy password reveal and Desfire detect fix (#3504)
* slix: fix incorrect default privacy passwords
* slix poller: add check privacy password state
* mf desfire: change detect algorithm
* mf desfire: change detection algorithm to check master key version
* mf desfire: change assert to check
* Update api symbols and cleanup code

Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 16:18:28 +09:00
Georgii Surkov
11d7f53854 [FL-3770, FL-3680] HID App improvements and little extra (#3518)
* FL-3680: change capitalisation
* Replace D-Pad graphic
* Fix the bluetooth indicator not showing
* Remove exit confirm scene
* Fix wrong back button durations
* Improve application structure
* Improve mouse clicker view
* Improve mouse jiggler view
* Improve media view
* Improve mouse and media views
* Improve tiktok view
* Reset mouse jiggler state on view exit
* Use alpha in mouse and tiktok views
* Reset mouse left button state on view exit
* Improve button graphics
* Improve mouse graphics

Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 16:00:35 +09:00
hedger
763e2f5bab github: additional pre-upload checks for doxygen workflow (#3526)
Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 15:51:09 +09:00
Protik Banerji
bf769ee398 Add Dutch Originals Sound Bar IR codes to infrared app (#3529)
* Add Dutch Originals Soundbar IR codes
* Switch change_input button to next and prev

Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 15:42:42 +09:00
gornekich
23940bff81 [FL-3796], [FL-3795] NFC UI fixes (#3532)
* nfc app: fix navigation in select protocol scene
* nfc app: fix text box position and size on emulation screen

Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 15:36:17 +09:00
WillyJL
c52f28efa4 GUI: Fix textbox overflow/crash/hang with 256+ lines (#3536)
* GUI: Fix textbox overflow/crash/hang with 256+ lines
* GUI: Textbox calculate lines based on font height
* Gui: proper types in text_box

Co-authored-by: あく <alleteam@gmail.com>
2024-03-25 15:28:20 +09:00
MX
81a16e5a28 update changelog 2024-03-25 01:04:33 +03:00
MX
8d75af8457 update changelog 2024-03-24 00:17:02 +03:00
MX
aaa7c81f99 js modules updates 2
by Willy-JL
2024-03-23 23:48:55 +03:00
MX
385c3c1c01 Sync textbox changes with OFW PR 3536
by Willy-JL
https://github.com/flipperdevices/flipperzero-firmware/pull/3536/files
2024-03-23 23:32:47 +03:00
MX
c323656037 js modules updates
by Willy-JL
2024-03-23 23:18:26 +03:00
WillyJL
0a48658a9a GUI: Fix elements module for new canvas API (#3527)
* GUI: Fix elements module for new canvas API
* Update symbols
* Update f18 symbols
* Gui: update elements for new canvas

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2024-03-23 14:54:01 +09:00
MX
46a90ec97f BLE/GAP fixes
by hedger
https://github.com/flipperdevices/flipperzero-firmware/pull/3533/files
2024-03-22 23:43:09 +03:00
Egor Koleda
d1d3c43939 Add support for Pioneer SR IR remotes (#3308)
* add support for Pioneer SR IR remotes
* fix minor issues
* fix repeat
* Fix protocol enumeration order
* Add unit tests for Pioneer IR protocol
* Clean up raw test data
* Add encoder/decoder tests, modify parser
* Remove dead code
* Use loops where appropriate

Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
2024-03-22 23:37:37 +03:00
gornekich
34fac96ef6 nfc app: fix text box position and size on emulation screen 2024-03-22 23:37:29 +03:00
gornekich
c1441b1331 nfc app: fix navigation in select protocol scene 2024-03-22 23:37:22 +03:00
MX
6d73b266d5 Fixes for text box and uart echo
thanks Willy-JL !
2024-03-22 22:47:24 +03:00
hedger
6947d3dea2 BLE/GAP fixes (#3533)
* hal: fixed ble_gap race on queue init
* fbt: removed deprecated path_as_posix
* hal: fixed inconsistencies between f7/f18 APIs
* hal: fixed excessively strict event handler re-init checks

Co-authored-by: あく <alleteam@gmail.com>
2024-03-22 21:36:05 +09:00
Egor Koleda
2aa2dcc71b Add support for Pioneer SR IR remotes (#3308)
* add support for Pioneer SR IR remotes
* fix minor issues
* fix repeat
* Fix protocol enumeration order
* Add unit tests for Pioneer IR protocol
* Clean up raw test data
* Add encoder/decoder tests, modify parser
* Remove dead code
* Use loops where appropriate

Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
2024-03-22 21:25:52 +09:00
MX
09c46a3381 Fix DIP decoding for Linear Delta-3
by brandonweeks

https://github.com/flipperdevices/flipperzero-firmware/pull/3528/files
2024-03-22 11:30:55 +03:00
MX
6d9a2cc699 fbt/ufbt: Ensure POSIX paths are passed to GDB on all platforms
https://github.com/flipperdevices/flipperzero-firmware/pull/3360/files
2024-03-22 11:27:48 +03:00
Jaroslav Nesterov
760deb66c5 Add support for DEFAULT_STRING_DELAY in Bad USB App (#3476)
* Add support for `DEFAULT_STRING_DELAY` in bad_usb
* Format Sources

Co-authored-by: あく <alleteam@gmail.com>
2024-03-22 11:26:30 +03:00
MX
e0469ae1ed Adding F13-F24 function key support to BadUSB
https://github.com/flipperdevices/flipperzero-firmware/pull/3468/files
2024-03-22 11:26:00 +03:00
Silent
4039ccbcca fbt/ufbt: Ensure POSIX paths are passed to GDB on all platforms (#3360)
* fbt/ufbt: Ensure POSIX paths are passed to GDB on all platforms
  GDB heavily dislikes forward slashes from Windows paths and strips
  them internally instead of normalizing them. Account for this by
  passing POSIX paths explicitly.
* fbt: different approach for posix path handling
* fbt, ufbt: further fixes for path handling
* fbt: explicit path stringification
* linter fixes

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: hedger <hedger@nanode.su>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 07:36:38 +09:00
小兽兽
0c465f7eb3 Added new IR commands (#3480)
Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 07:24:33 +09:00
Jaroslav Nesterov
1bef579b82 Add support for DEFAULT_STRING_DELAY in Bad USB App (#3476)
* Add support for `DEFAULT_STRING_DELAY` in bad_usb
* Format Sources

Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 07:18:02 +09:00
Gabe
702ab672bb Adding F13-F24 function key support to BadUSB (#3468)
* Adding F13-F24 function key support to BadUSB
* Adding F13-F24 function key support to JS version of BadUSB

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 06:45:16 +09:00
Nikolay Minaylov
7d50c4a742 it-IT-mac layout (#3401)
Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 06:35:48 +09:00
MX
139cc3c93d upd changelog 2024-03-20 22:02:13 +03:00
MX
3b83d8b825 the biggest update ever 2024-03-20 21:47:01 +03:00
MX
8c0ba4de9f add icon 2024-03-20 20:17:16 +03:00
hedger
ee36c66572 fbt: doxygen target (#3510)
* fbt: doxygen target
* github: adjustments for doxygen
* github: always generate docs, only upload for dev
* doxygen: fixed exclusion path for awesome-css
* github: stricter check for push ref
* github: bumped action version to fix node.js deprecation
* github: added PVS report url to workflow summary
* github: pvs: reworked report URL handling
* github: added size report to summary
* docs: added `doxygen` target
* fbt: common naming scheme for COMSTR
* Documentation: fix warnings and errors
* Doxygen: stricter warning checks
* fbt: "doxy" target, opens generated doxygen documentation in browser
* github: doxygen: now using edge (1.10) version

Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 01:32:53 +09:00
Astra
4a673397b3 [FL-3760] NFC Parsers cosmetic fixes (#3511)
* NFC Parsers cosmetic fixes
* Clarify the unknown digit indication

Co-authored-by: あく <alleteam@gmail.com>
2024-03-20 18:10:51 +03:00
Astra
a5bb1ead68 NFC wording fixes (#3512)
* NFC wording fixes
* Fix filename

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-20 18:10:34 +03:00
Astra
558f75672f [FL-3760] NFC Parsers cosmetic fixes (#3511)
* NFC Parsers cosmetic fixes
* Clarify the unknown digit indication

Co-authored-by: あく <alleteam@gmail.com>
2024-03-21 00:08:35 +09:00
Georgii Surkov
7987917d85 [FL-3496, FL-3523, FL-3767, FL-3790] Infrared fixes and more (#3515)
* FL-3496: do not hardcode universal library names in CLI
* FL-3523: remove TODO, no changes necessary
* FL-3767: remove TODO, no changes necessary
* FL-3790: fix laggy TextInput by not adding it into a ViewStack
* Improve documentation
* Fix logical error in documentation

Co-authored-by: あく <alleteam@gmail.com>
2024-03-20 23:54:07 +09:00
Astra
1c033e2afe NFC wording fixes (#3512)
* NFC wording fixes
* Fix filename

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
2024-03-20 23:44:48 +09:00
Georgii Surkov
169522cbe8 [FL-3792] Fix iButton emulation regression (#3519)
Co-authored-by: あく <alleteam@gmail.com>
2024-03-20 23:37:16 +09:00
MX
7c607abfe6 fix module load 2024-03-20 14:48:54 +03:00
MX
6f560ef210 js updates
by Willy-JL , oldip
2024-03-20 13:13:04 +03:00
MX
71111b0d2f sync anims with OFW
[FL-3776] Add the Freedom_2_dolphins animation
2024-03-20 12:48:50 +03:00
Astra
8bd984ff81 [FL-3151] Update the WiFi devboard developer documentation (#3520)
Co-authored-by: あく <alleteam@gmail.com>
2024-03-20 18:44:31 +09:00
MX
2276432745 Merge remote-tracking branch 'OFW/gsurkov/3792_onewire_fix' into dev 2024-03-20 12:42:15 +03:00
Astra
ff0952d66a [FL-3776] Add the Freedom_2_dolphins animation (#3521)
* Add the Freedom_2_dolphins animation
* Dolphin: rebalance animation weights

Co-authored-by: あく <alleteam@gmail.com>
2024-03-20 18:37:07 +09:00
あく
bcde0aefbd [FL-3729] Gui: unicode support, new canvas API (#3322)
* Revert "Rollback #3305 and #3297 fix various rendering issues (#3307)"

This reverts commit 531ba24e9a.

* Gui: refactor canvas to use proper coordinate system types. Furi: new furi_break check macros. Desktop: proper types for negative offset.

* Desktop: proper types in desktop_view_locked_doors_draw

* Examples: update images example, off it goes

---------

Co-authored-by: hedger <hedger@users.noreply.github.com>
2024-03-19 19:23:06 +04:00
あく
acc39a4bc0 Api Symbols: replace asserts with checks (#3507)
* 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>
2024-03-19 23:43:52 +09:00
Georgii Surkov
c541227483 Merge branch 'dev' into gsurkov/3792_onewire_fix 2024-03-19 12:45:38 +03:00
Anna Prosvetova
a09ec4d976 Infrared: Add Fujitsu ASYG24KMTB (#3513) 2024-03-19 18:19:31 +09:00
Georgii Surkov
a0dc2b5cfc Fix DS1990 emulation 2024-03-18 20:59:35 +03:00
MX
7e9ecdf394 the real update 2024-03-16 02:56:55 +03:00
MX
ce67472dc4 use non prefixed names for regular files with random name 2024-03-15 09:33:27 +03:00
MX
f88da8b0c3 test swap em4100 t5577 blocks (issue 3463 ofw) 2024-03-15 09:32:42 +03:00
MX
d573cc06da js modules updates
by Willy-JL and Sil333033
2024-03-15 07:09:16 +03:00
MX
17dd089b5a sync scenes 2024-03-15 04:27:37 +03:00
MX
eb013ab6ec revert usb cdc config changes to verify issue 3452 2024-03-15 04:08:52 +03:00
MX
d7711d729f Merge branch 'slix_test' into dev 2024-03-15 04:08:43 +03:00
MX
375eb55d33 Merge remote-tracking branch 'OFW/gsurkov/infrared_miscellany' into dev 2024-03-15 04:08:39 +03:00
MX
6e52c591e5 Merge remote-tracking branch 'OFW/gornek/3787_nfc_slix_issues' into slix_test 2024-03-15 04:04:31 +03:00
MX
c5bf29cb8c Merge remote-tracking branch 'OFW/ktq/ac_contrib' into slix_test 2024-03-15 04:04:18 +03:00
Georgii Surkov
2aa85347ee Fix logical error in documentation 2024-03-13 12:28:08 +03:00
Georgii Surkov
75432346de Improve documentation 2024-03-12 19:54:45 +03:00
Georgii Surkov
98c328f93f FL-3790: fix laggy TextInput by not adding it into a ViewStack 2024-03-12 19:45:22 +03:00
Georgii Surkov
3f7a070397 FL-3767: remove TODO, no changes necessary 2024-03-12 16:18:48 +03:00
Georgii Surkov
b27066b508 FL-3523: remove TODO, no changes necessary 2024-03-12 16:14:21 +03:00
Georgii Surkov
5cfc773b7b FL-3496: do not hardcode universal library names in CLI 2024-03-12 15:09:35 +03:00
Anna Prosvetova
2da05bfa6c Infrared: Add Fujitsu ASYG24KMTB 2024-03-12 00:24:29 +01:00
MX
9050a242e6 Merge branch 'ofw_dev' into dev 2024-03-11 21:10:01 +03:00
Georgii Surkov
022fccf0d7 [FL-3783] Asynchronous Infrared remote manipulation (#3503)
* Introduce ConcurrentRunner, load universal and regular remotes concurrently
* Perform all lengthy operations in a ConcurrentRunner
* Fix python formatting
* Clean up code
* Add usage warning
* Remove ConcurrentRunner, use a plain FuriThread instead
* Load remotes asynchronously in RPC mode as well
* Reorder code for clarity
* Clean up, use thread return code to report errors
* Improve wording
* Fix logical error
2024-03-12 02:35:51 +09:00
あく
adbe4d44f4 DateTime: fix missing weekday in datetime_timestamp_to_datetime conversion (#3508) 2024-03-11 17:09:39 +04:00
MX
79a286fe1a upd changelog 2024-03-11 03:53:32 +03:00
MMX
2f5be8f695 Merge pull request #719 from amec0e/dev
Update ac.ir
2024-03-11 02:51:28 +03:00
MMX
e8e596e4c9 Merge pull request #721 from MizumasuShoichi/patch-3
Update subghz_setting.c
2024-03-11 02:51:04 +03:00
MX
7b09a22a5c fix bipki [ci skip] 2024-03-11 02:37:37 +03:00
MX
c9434492b8 Various changes, in expansion, rgb, js
by Willy-JL , Spooks4576 , Sil333033 , HaxSam
2024-03-11 00:37:29 +03:00
Methodius
1bd56fb190 bip parser refactor 2024-03-11 00:24:55 +03:00
MX
25d4c4f829 upd subremote 2024-03-10 23:56:23 +03:00
MX
175f603678 Merge branch 'ofw_dev'
Conflicts:
	.gitmodules
	ReadMe.md
2024-03-10 23:38:56 +03:00
MX
df57ecd786 rem module that is not used in UL for now 2024-03-10 23:37:30 +03:00
MX
58cd56a439 Merge branch 'ofw_dev' into dev p1 2024-03-10 23:35:44 +03:00
gornekich
b1a9904ea5 mf desfire: change detection algorithm to check master key version 2024-03-07 19:29:18 +00:00
gornekich
43d1659200 Merge branch 'dev' into gornek/3787_nfc_slix_issues 2024-03-07 18:55:18 +00:00
gornekich
8f9fbc3a79 mf desfire: change detect algorithm 2024-03-07 18:48:14 +00:00
gornekich
bf97209c9b slix poller: add check privacy password state 2024-03-07 17:38:42 +00:00
gornekich
2961ad5ee1 slix: fix incorrect default privacy passwords 2024-03-07 15:59:27 +00:00
Astra
4f7eb77071 Fix troika 4K keys (#3499) 2024-03-07 15:57:32 +09:00
Astra
ecab4d53d2 [FL-870] Auto-generated firmware documentation take two (#2944)
* Add doxygen and doxygen-awesome css, cleanup docs files
* Ignore more libraries and remove leftover local variables
* Create an actual intro page
* .md files linting
* Add doxygen action
* Fix Doxygen path
* Fix doxyfile path
* Try to upload
* Change docs branch
* Add submudules checkout
* Disable doxygen on PR
* Mention the firmware docs in the readme
* More dev docs mentions in the readme
* Fix runner group, add tags
* Test dev in PR
* Disable running on PR
* Fix a typo in the doxyfile
* Try upload to S3
* Fix local path
* Fix S3 ACL
* Add delete flag, unifying dev and tags
* Update ignored directories
* More ignored directories
* Even more ignored directories
* Fix submodule
* Change S3 uploader
* Change S3 uploader version
* Fix aws sync flags
* Fix ACL
* Disable ACL
* Improve ignores, add WiFi devboard docs
* TEMP: generate dev docs
* TEMP: generate 0.89.0 docs
* Disabling PR trigger
* Enable submodules and test build
* Enable test build
* Disable test build
* Change docs directory structure
* Fix accidentally committed submodule
* Fix submodules
* Update links to the developer documentation
* Markdown linting
* Update workflow, enable test build
* Fix doxygen dir path
* Update Doxyfile-awesome.cfg
* Change paths
* Fix upload docs path
* Disable pull_request debug trigger
* Disable tags building
* Remove autolinks and namespaces
* Establish basic documentation structure
* Add missing changes
* Improve stylesheet, move some files
* Improve examples
* Improve the main page
* Improve application dev docs
* Improve system programming docs
* Improve development tools docs
* Improve other docs
* Improve application examples
* Fix formatting
* Fix PVS-studio warnings
* Improve visuals
* Fix doxygen syntax warnings
* Fix broken links
* Update doxygen action

Co-authored-by: DrunkBatya <drunkbatya.js@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: Georgii Surkov <georgii.surkov@outlook.com>
Co-authored-by: Georgii Surkov <37121527+gsurkov@users.noreply.github.com>
2024-03-06 15:25:21 +09:00
Methodius
78e6c236c7 electra protocol added 2024-02-28 15:13:54 +09:00
MizumasuShoichi
33fe146a57 Update subghz_setting.c
Added frequency: 430.50
2024-02-27 16:02:51 +08:00
amec0e
ee2c7bed92 Update ac.ir
Updated AC
2024-02-21 14:15:52 +00:00
1153 changed files with 23995 additions and 8009 deletions

View File

@@ -69,7 +69,7 @@ Min butthurt: 0
Max butthurt: 9 Max butthurt: 9
Min level: 1 Min level: 1
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L1_Painting_128x64 Name: L1_Painting_128x64
Min butthurt: 0 Min butthurt: 0
@@ -85,26 +85,33 @@ Min level: 1
Max level: 3 Max level: 3
Weight: 3 Weight: 3
Name: L1_Senpai_128x64
Min butthurt: 0
Max butthurt: 5
Min level: 1
Max level: 3
Weight: 3
Name: L1_Kaiju_128x64 Name: L1_Kaiju_128x64
Min butthurt: 0 Min butthurt: 0
Max butthurt: 10 Max butthurt: 10
Min level: 1 Min level: 1
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L1_My_dude_128x64 Name: L1_My_dude_128x64
Min butthurt: 0 Min butthurt: 0
Max butthurt: 8 Max butthurt: 8
Min level: 1 Min level: 1
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L2_Wake_up_128x64 Name: L2_Wake_up_128x64
Min butthurt: 0 Min butthurt: 0
Max butthurt: 12 Max butthurt: 12
Min level: 2 Min level: 2
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L2_Furippa2_128x64 Name: L2_Furippa2_128x64
Min butthurt: 0 Min butthurt: 0
@@ -132,7 +139,7 @@ Min butthurt: 0
Max butthurt: 8 Max butthurt: 8
Min level: 2 Min level: 2
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L3_Furippa3_128x64 Name: L3_Furippa3_128x64
Min butthurt: 0 Min butthurt: 0
@@ -155,30 +162,37 @@ Min level: 3
Max level: 3 Max level: 3
Weight: 3 Weight: 3
Name: L1_Senpai_128x64
Min butthurt: 0
Max butthurt: 5
Min level: 1
Max level: 3
Weight: 4
Name: L1_Sad_song_128x64 Name: L1_Sad_song_128x64
Min butthurt: 8 Min butthurt: 8
Max butthurt: 13 Max butthurt: 13
Min level: 1 Min level: 1
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L2_Coding_in_the_shell_128x64 Name: L2_Coding_in_the_shell_128x64
Min butthurt: 0 Min butthurt: 0
Max butthurt: 12 Max butthurt: 12
Min level: 2 Min level: 2
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L2_Secret_door_128x64 Name: L2_Secret_door_128x64
Min butthurt: 0 Min butthurt: 0
Max butthurt: 12 Max butthurt: 12
Min level: 2 Min level: 2
Max level: 3 Max level: 3
Weight: 4 Weight: 3
Name: L3_Freedom_2_dolphins_128x64
Min butthurt: 0
Max butthurt: 12
Min level: 3
Max level: 3
Weight: 5
Name: L1_Akira_128x64
Min butthurt: 0
Max butthurt: 8
Min level: 1
Max level: 3
Weight: 5

View File

@@ -527,7 +527,7 @@ index 0000000..572e1df
+ +
+void SK6805_update(void) { +void SK6805_update(void) {
+ SK6805_init(); + SK6805_init();
+ furi_kernel_lock(); + FURI_CRITICAL_ENTER();
+ uint32_t end; + uint32_t end;
+ /* Последовательная отправка цветов светодиодов */ + /* Последовательная отправка цветов светодиодов */
+ for(uint8_t lednumber = 0; lednumber < SK6805_LED_COUNT; lednumber++) { + for(uint8_t lednumber = 0; lednumber < SK6805_LED_COUNT; lednumber++) {
@@ -567,7 +567,7 @@ index 0000000..572e1df
+ } + }
+ } + }
+ } + }
+ furi_kernel_unlock(); + FURI_CRITICAL_EXIT();
+} +}
diff --git a/lib/drivers/SK6805.h b/lib/drivers/SK6805.h diff --git a/lib/drivers/SK6805.h b/lib/drivers/SK6805.h
new file mode 100644 new file mode 100644
@@ -637,9 +637,9 @@ index 83e1603..45798ca 100644
#include <stdint.h> #include <stdint.h>
+#include <applications/settings/notification_settings/rgb_backlight.h> +#include <applications/settings/notification_settings/rgb_backlight.h>
#define LED_CURRENT_RED 50 #define LED_CURRENT_RED (50u)
#define LED_CURRENT_GREEN 50 #define LED_CURRENT_GREEN (50u)
@@ -31,22 +32,21 @@ void furi_hal_light_init() { @@ -31,22 +32,21 @@ void furi_hal_light_init(void) {
} }
void furi_hal_light_set(Light light, uint8_t value) { void furi_hal_light_set(Light light, uint8_t value) {

View File

@@ -1,10 +1,10 @@
# MLib macros we can't do much about. # MLib macros we can't do much about.
//-V:M_LET:1048,1044 //-V:M_LET:1048,1044
//-V:M_EACH:1048,1044 //-V:M_EACH:1048,1044
//-V:ARRAY_DEF:760,747,568,776,729,712,654 //-V:ARRAY_DEF:760,747,568,776,729,712,654,1103
//-V:LIST_DEF:760,747,568,712,729,654,776 //-V:LIST_DEF:760,747,568,712,729,654,776,1103
//-V:BPTREE_DEF2:779,1086,557,773,512 //-V:BPTREE_DEF2:779,1086,557,773,512
//-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685 //-V:DICT_DEF2:779,524,776,760,1044,1001,729,590,568,747,685,1103
//-V:ALGO_DEF:1048,747,1044 //-V:ALGO_DEF:1048,747,1044
//-V:TUPLE_DEF2:524,590,1001,760 //-V:TUPLE_DEF2:524,590,1001,760
@@ -42,8 +42,5 @@
# Model-related warnings # Model-related warnings
//-V:with_view_model:1044,1048 //-V:with_view_model:1044,1048
# Functions that always return the same error code
//-V:picopass_device_decrypt:1048
# Examples # Examples
//V_EXCLUDE_PATH applications/examples/ //V_EXCLUDE_PATH applications/examples/

2
.vscode/ReadMe.md vendored
View File

@@ -1,4 +1,4 @@
# Visual Studio Code workspace for Flipper Zero # Visual Studio Code workspace for Flipper Zero {#vscode}
## Setup ## Setup

View File

@@ -8,7 +8,8 @@
"amiralizadeh9480.cpp-helper", "amiralizadeh9480.cpp-helper",
"marus25.cortex-debug", "marus25.cortex-debug",
"zxh404.vscode-proto3", "zxh404.vscode-proto3",
"augustocdias.tasks-shell-input" "augustocdias.tasks-shell-input",
"rioj7.command-variable"
], ],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace. // List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": [ "unwantedRecommendations": [
@@ -16,4 +17,4 @@
"ms-vscode.cpptools", "ms-vscode.cpptools",
"ms-vscode.cmake-tools" "ms-vscode.cmake-tools"
] ]
} }

View File

@@ -2,7 +2,7 @@
"configurations": [ "configurations": [
{ {
"name": "Win32", "name": "Win32",
"compilerPath": "${workspaceFolder}/toolchain/x86_64-windows/bin/arm-none-eabi-gcc.exe", "compilerPath": "${workspaceFolder}/toolchain/current/bin/arm-none-eabi-gcc.exe",
"intelliSenseMode": "gcc-arm", "intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/build/latest/compile_commands.json", "compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
"cStandard": "gnu23", "cStandard": "gnu23",
@@ -10,7 +10,7 @@
}, },
{ {
"name": "Linux", "name": "Linux",
"compilerPath": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gcc", "compilerPath": "${workspaceFolder}/toolchain/current/bin/arm-none-eabi-gcc",
"intelliSenseMode": "gcc-arm", "intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/build/latest/compile_commands.json", "compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
"cStandard": "gnu23", "cStandard": "gnu23",
@@ -18,7 +18,7 @@
}, },
{ {
"name": "Mac", "name": "Mac",
"compilerPath": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gcc", "compilerPath": "${workspaceFolder}/toolchain/current/bin/arm-none-eabi-gcc",
"intelliSenseMode": "gcc-arm", "intelliSenseMode": "gcc-arm",
"compileCommands": "${workspaceFolder}/build/latest/compile_commands.json", "compileCommands": "${workspaceFolder}/build/latest/compile_commands.json",
"cStandard": "gnu23", "cStandard": "gnu23",

View File

@@ -14,7 +14,7 @@
"*.scons": "python", "*.scons": "python",
"SConscript": "python", "SConscript": "python",
"SConstruct": "python", "SConstruct": "python",
"*.fam": "python", "*.fam": "python"
}, },
"clangd.arguments": [ "clangd.arguments": [
// We might be able to tighten this a bit more to only include the correct toolchain. // We might be able to tighten this a bit more to only include the correct toolchain.

View File

@@ -91,7 +91,7 @@
"label": "[Debug:unit_tests] Flash (USB)", "label": "[Debug:unit_tests] Flash (USB)",
"group": "build", "group": "build",
"type": "shell", "type": "shell",
"command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb" "command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb_full"
}, },
{ {
"label": "[Debug] Flash (USB, with resources)", "label": "[Debug] Flash (USB, with resources)",

View File

@@ -1,60 +1,75 @@
## New changes ## New changes
* NFC: **Fixed stuck Saved success screen** * LFRFID: **Electra intercom protocol support** (Romania) (by @Leptopt1los | PR #750)
* NFC: **Fixed crash when reading mifare classic tag then going to add manually menu and adding NFC-A tag** * NFC: Temp fix for `iso14443_4_layer_decode_block` crash
* NFC: Fixed EMV txs render * NFC: CharlieCard parser (by @zacharyweiss)
* NFC/LFRFID: Don't Stop emulation after 5 mins to avoid antenna damage if debug is ON (by @Leptopt1los) * SubGHz: FAAC RC XT - add 0xB button code on arrow buttons for programming mode
* LFRFID: Fixed T5577 custom password input (by @Leptopt1los) * SubGHz: Add Manually - Sommer FM fixes
* OFW PR 3410: lfrfid/em4100: added support for different bit rates - by @Mrkvak (RF/32 full support, RF/16 support without reading (16clk removed for now)) * SubGHz: Enabled tx-rx state on unused gpio pin by default (**external amp option was removed and is enabled by default now**)
* OFW PR 3412: Fixed MyKey LockID - by @zProAle * SubGHz: **Status output !TX/RX on the GDO2 CC1101 pin** (by @quen0n | PR #742)
<br>----<br> * SubGHz: Reworked saved settings (by @xMasterX and @Willy-JL)
**Changes from 070 release:**<br> * Desktop: Fixes for animation unload (by @Willy-JL)
* NFC: **EMV parser** added (by @Leptopt1los and @wosk | PR #700) * iButton: Updated DS1420 for latest ibutton changes
* NFC: Metromoney parser balance fix (by @Leptopt1los | PR #699) * Misc: Allow no prefix usage of name_generator_make_detailed_datetime
* NFC/LFRFID: Stop emulation after 5 mins to avoid antenna damage (by @Leptopt1los) * Misc: Allow setting view dispatcher callbacks to NULL
* Archive: Fix two filebrowser bugs * Misc: Added `void` due to `-Wstrict-prototypes`
* SubGHz: **Programming mode for Dea Mio** (right arrow button) * Misc: Some code cleanup and proper log levels in nfc parsers
* SubGHz: **Keeloq fix emulation for multiple systems and extend add manually support** for 2 of them (Dea Mio, Genius Bravo, GSN, Normstahl) * Infrared: Allow external apps to use infrared settings (by @Willy-JL)
* SubGHz: Fixed hopper state when entering Read via Freq analyzer * JS & HAL: Various fixes and FURI_HAL_RANDOM_MAX define added (by @Willy-JL)
* SubGHz: Raw erase fixes (by @Willy-JL) * JS: **BadUSB layout support** (by @Willy-JL)
* SubGHz: Subghz save files with receive time (by @Willy-JL) * JS: New Modules `widget`, `vgm` and path globals (by @jamisonderek)
* NFC: Fix NFC V dumps with v3 (pre refactor saves) crashing at info page * Apps: Enhance Random Interval and Movement Functionality in HID Mouse Jiggler for Improved Stealth and Human-Like Behavior (by @gushmazuko | PR #746)
* NFC: Zolotaya Korona Online parser added (by @Leptopt1los) * Apps: NFC Magic - **Gen2 writing support, Gen4 NTAG password and PACK fixes** (by @Astrrra)
* NFC: Add NFC **NDEF parser** (by @Willy-JL) * Apps: MFKey - **fixed crashes**, add more free ram (by @noproto & @Willy-JL)
* LF RFID: **Write T5577 with random and custom password** added (clear password via Extra actions) (by @Leptopt1los)
* SubGHz: Update honeywell protocol (by @Willy-JL)
* System: More contrast values for replacement displays (up to +8 or -8)
* USB/BLE HID: Add macOS Music app volume control
* Apps: **Check out Apps updates by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev) * Apps: **Check out Apps updates by following** [this link](https://github.com/xMasterX/all-the-plugins/commits/dev)
* OFW PR 3384: NFC: Display unread Mifare Classic bytes as question marks - by @TollyH * OFW PR 3616: NFC: Mf Desfire fix reading big files (by gornekich)
* OFW PR 3396: NFC: **fix application opening from browser** - by @RebornedBrain (+ fix for leftover issues) * OFW: iButton: fix crash when deleting some keys
* OFW PR 3382: NFC UI refactor - by @RebornedBrain * OFW: Desktop: cleanup error popups
* OFW PR 3391: Rework more info scene for Ultralight cards - by @RebornedBrain * OFW: Troika parser visual fixes
* OFW PR 3401: it-IT-mac layout - by @nminaylov * OFW: Fix the retry/exit confirmation prompts in iButton
* OFW: Fix expansion protocol crash when fed lots of garbage * OFW: nfc app: add legacy keys for plantain cards
* OFW: 0.98.0-rc various fixes * OFW: GUI: Fix array out of bounds in menu exit
* OFW: RFID CLI: better usage * OFW: add support for S(WTX) request in iso14443_4a_poller
* OFW: **Mf DESFire fixes** * OFW: Mosgortrans parser output fixes
* OFW: NFC UI refactor * OFW: BLE: Add GapPairingNone support
* OFW: **Expansion module protocol** (+ expansion settings read and store in ram by @Willy-JL) * OFW: iButton new UI
* OFW: Bugfix: Strip last parity bit from decoded FDX-B data * OFW: FuriHal: add ADC API
* OFW: FuriHal: interrupt priorities and documentation * OFW: Mf Desfire multiple file rights support
* OFW: FuriHal: **UART refactoring** * OFW: **Felica poller** (NFC-F)
* OFW: SubGhz: add `subghz tx_from_file` CLI cmd, major TX flow refactoring, various improvements and bug fixes * OFW: Desktop/Loader: Unload animations before loading FAPs
* OFW: Furi_hal_rtc: new function * OFW: JS Documentation
* OFW: NFC UI refactor * OFW: **Update radio stack to v1.19.0**
* OFW: assets: checking limits on image size; ufbt: cdb target * OFW: **Move crypto1 to helpers, add it to the public API**
* OFW: NFC: system dict skip when user dict is skipped fix (replaces our fix) * OFW: Explain RNG differences, add FURI_HAL_RANDOM_MAX
* OFW: FuriHal: fix start duration furi_hal_subghz_async_tx * OFW: Furi: Add "out of memory" and "malloc(0)" crash messages
* OFW: NFC: parsers minor cleanup * OFW: IR: Fix crash on duty_cycle=1
* OFW: NFC Ntag success write freeze when not saved card * OFW: **Desktop: ensure that animation is unloaded before app start (fixes some out of memory crashes)**
* OFW: ufbt: fixed generated project paths on Windows * OFW: Hide unlock with reader for MFU-C
* OFW: fbt: fixed missing FBT_FAP_DEBUG_ELF_ROOT to dist env
* OFW: fbt: added -Wstrict-prototypes for main firmware
* OFW: Mifare Ultralight naming fix
* OFW: IR: Remember OTG state
* OFW: Bad USB: fix crash when selecting a keyboard layout
* OFW: L1_Mods animation update : adding VGM visual
* OFW: RFID Improvements
* OFW: Fixed plugins and UI
* OFW: **NFC: Fix mf desfire detect**
* OFW: infrared_transmit.h was missing `#pragma once`
* OFW: Show the wrong PIN Attempt count on the login screen
* OFW: SavedStruct: Introduce saved_struct_get_metadata
* OFW: JS CLI command
* OFW: Add ChromeOS Bad USB demo
* OFW: **Configurable Infrared TX output** (previous UL version is replaced with OFW version, new features added "AutoDetect" and saving settings)
* OFW: BadUSB: BLE, media keys, Fn/Globe key commands
* OFW: NFC: Slix privacy password reveal ->(was included in previous UL release) and **Desfire detect fix**
* OFW: github: additional pre-upload checks for doxygen workflow
* OFW: NFC UI fixes
* OFW: Gui: unicode support, new canvas API
* OFW: **Api Symbols: replace asserts with checks**
<br><br> <br><br>
#### Known NFC post-refactor regressions list: #### Known NFC post-refactor regressions list:
- Mifare Mini clones reading is broken (original mini working fine) (OFW) - Mifare Mini clones reading is broken (original mini working fine) (OFW)
- Option to unlock Slix-L (NFC V) with preset or custom password was removed with refactoring (OFW) - NFC CLI was removed with refactoring (OFW) (will be back soon)
- NFC CLI was removed with refactoring (OFW) - Mifare Nested not ported to latest API yet, `unlshd-065` is the latest version on old NFC API that works with "nested app"
- Current list of affected apps: https://github.com/xMasterX/all-the-plugins/tree/dev/apps_broken_by_last_refactors
- Also in app **Enhanced Sub-GHz Chat** - NFC part was temporarily removed to make app usable, NFC part of the app requires remaking it with new nfc stack
---- ----
@@ -70,13 +85,14 @@
|cloudtips|only RU payments accepted|https://pay.cloudtips.ru/p/7b3e9d65| |cloudtips|only RU payments accepted|https://pay.cloudtips.ru/p/7b3e9d65|
|YooMoney|only RU payments accepted|https://yoomoney.ru/fundraise/XA49mgQLPA0.221209| |YooMoney|only RU payments accepted|https://yoomoney.ru/fundraise/XA49mgQLPA0.221209|
|USDT|(TRC20)|`TSXcitMSnWXUFqiUfEXrTVpVewXy2cYhrs`| |USDT|(TRC20)|`TSXcitMSnWXUFqiUfEXrTVpVewXy2cYhrs`|
|BCH||`qquxfyzntuqufy2dx0hrfr4sndp0tucvky4sw8qyu3`|
|ETH|(BSC/ERC20-Tokens)|`darkflippers.eth` (or `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`)| |ETH|(BSC/ERC20-Tokens)|`darkflippers.eth` (or `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`)|
|BTC||`bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`| |BTC||`bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`|
|SOL|(Solana/Tokens)|`DSgwouAEgu8iP5yr7EHHDqMNYWZxAqXWsTEeqCAXGLj8`|
|DOGE||`D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`| |DOGE||`D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`|
|LTC||`ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`| |LTC||`ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`|
|BCH||`qquxfyzntuqufy2dx0hrfr4sndp0tucvky4sw8qyu3`|
|XMR|(Monero)| `41xUz92suUu1u5Mu4qkrcs52gtfpu9rnZRdBpCJ244KRHf6xXSvVFevdf2cnjS7RAeYr5hn9MsEfxKoFDRSctFjG5fv1Mhn`| |XMR|(Monero)| `41xUz92suUu1u5Mu4qkrcs52gtfpu9rnZRdBpCJ244KRHf6xXSvVFevdf2cnjS7RAeYr5hn9MsEfxKoFDRSctFjG5fv1Mhn`|
|TON||`EQCOqcnYkvzOZUV_9bPE_8oTbOrOF03MnF-VcJyjisTZmpGf`| |TON||`UQCOqcnYkvzOZUV_9bPE_8oTbOrOF03MnF-VcJyjisTZmsxa`|
#### Thanks to our sponsors who supported project in the past and special thanks to sponsors who supports us on regular basis: #### Thanks to our sponsors who supported project in the past and special thanks to sponsors who supports us on regular basis:
ClaraCrazy, Pathfinder [Count Zero cDc], callmezimbra, Quen0n, MERRON, grvpvl (lvpvrg), art_col, ThurstonWaffles, Moneron, UterGrooll, LUCFER, Northpirate, zloepuzo, T.Rat, Alexey B., ionelife, ... ClaraCrazy, Pathfinder [Count Zero cDc], callmezimbra, Quen0n, MERRON, grvpvl (lvpvrg), art_col, ThurstonWaffles, Moneron, UterGrooll, LUCFER, Northpirate, zloepuzo, T.Rat, Alexey B., ionelife, ...

View File

@@ -1,6 +1,6 @@
<h3 align="center"> <h3 align="center">
<a href="https://github.com/DarkFlippers/unleashed-firmware"> <a href="https://github.com/DarkFlippers/unleashed-firmware">
<img src="https://user-images.githubusercontent.com/10697207/186202043-26947e28-b1cc-459a-8f20-ffcc7fc0c71c.png" align="center" alt="fzCUSTOM" border="0"> <img src="https://user-images.githubusercontent.com/10697207/186202043-26947e28-b1cc-459a-8f20-ffcc7fc0c71c.png" align="center" alt="Unleashed Firmware Logo" border="0">
</a> </a>
</h3> </h3>
<div align="center" id="badges"> <div align="center" id="badges">
@@ -20,15 +20,15 @@
### Welcome to the Flipper Zero Unleashed Firmware repo! ### Welcome to the Flipper Zero Unleashed Firmware repo!
#### **This firmware is a fork from** [flipperdevices/flipperzero-firmware](https://github.com/flipperdevices/flipperzero-firmware) #### **This firmware is a fork from original (OFW) firmware** [flipperdevices/flipperzero-firmware](https://github.com/flipperdevices/flipperzero-firmware)
<br> <br>
### Most stable custom firmware focused on new features and improvements of original firmware components, with almost no UI changes ### Most stable custom firmware focused on new features and improvements of original firmware components, keeping compatibility with original firmware API and Apps
<br> <br>
##### This software is for experimental purposes only and is not meant for any illegal activity/purposes. <br> We do not condone illegal activity and strongly encourage keeping transmissions to legal/valid uses allowed by law. <br> Also, this software is made without any support from Flipper Devices and is in no way related to the official devs. ##### This software is for experimental purposes only and is not meant for any illegal activity/purposes. <br> We do not condone illegal activity and strongly encourage keeping transmissions to legal/valid uses allowed by law. <br> Also, this software is made without any support from Flipper Devices and is in no way related to the official team.
<br> <br>
@@ -36,7 +36,7 @@
## FAQ (frequently asked questions) ## FAQ (frequently asked questions)
[Follow this link to find answers to most asked questions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/FAQ.md) [Follow this link to find answers to most asked questions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/FAQ.md)
## Dev builds (unstable) ## Dev builds (unstable) (built automatically from dev branch)
- https://dev.unleashedflip.com/ - https://dev.unleashedflip.com/
- https://t.me/kotnehleb - https://t.me/kotnehleb
## Releases in Telegram ## Releases in Telegram
@@ -45,19 +45,20 @@
# What's changed # What's changed
- **Sub-GHz** *lib & hal* - **Sub-GHz** *lib & hal*
- Regional TX restrictions removed - Regional TX restrictions removed
- Extra Sub-GHz frequencies - Extra Sub-GHz frequencies added
- Frequency range can be extended in settings file (Warning: It can damage Flipper's hardware) - Frequency range can be extended in settings file (Warning: It can damage Flipper's hardware)
- Many rolling code [protocols](https://github.com/DarkFlippers/unleashed-firmware#current-modified-and-new-sub-ghz-protocols-list) now have the ability to save & send captured signals - Many rolling code [protocols](https://github.com/DarkFlippers/unleashed-firmware#current-modified-and-new-sub-ghz-protocols-list) now have the ability to save & send captured signals
- FAAC SLH (Spa) & BFT Mitto (keeloq secure with seed) manual creation - FAAC SLH (Spa) & BFT Mitto (keeloq secure with seed) manual creation
- External CC1101 module support [(by quen0n)](https://github.com/DarkFlippers/unleashed-firmware/pull/307) - External CC1101 module support [(by quen0n)](https://github.com/DarkFlippers/unleashed-firmware/pull/307)
- **Sub-GHz** *Main App* - **Sub-GHz** *Main App*
- Save last used frequency [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77) - Save last used settings [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77)
- New frequency analyzer [(by ClusterM)](https://github.com/DarkFlippers/unleashed-firmware/pull/43) - New frequency analyzer [(by ClusterM)](https://github.com/DarkFlippers/unleashed-firmware/pull/43)
- Press OK in frequency analyzer to use detected frequency in Read modes [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77) - Press OK in frequency analyzer to use detected frequency in Read modes [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77)
- Long press OK button in Sub-GHz Frequency analyzer to switch to Read menu [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/79) - Long press OK button in Sub-GHz Frequency analyzer to switch to Read menu [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/79)
- New option to use timestamps + protocol name when you saving file, instead of random name or timestamp only - Enable in `Radio Settings -> Protocol Names = ON` - New option to use timestamps + protocol name when you saving file, instead of random name or timestamp only - Enable in `Radio Settings -> Protocol Names = ON`
- Read mode UI improvements (shows time when signal was received) (by @wosk) - Read mode UI improvements (shows time when signal was received) (by @wosk)
- External CC1101 module support (Hardware SPI used) - External CC1101 module support (Hardware SPI used)
- External CC1101 module amplifier control (or LED control) support (enabled by default)
- **Hold right in received signal list to delete selected signal** - **Hold right in received signal list to delete selected signal**
- **Custom buttons for Keeloq / Alutech AT4N / Nice Flor S / Somfy Telis / Security+ 2.0 / CAME Atomo** - now you can use arrow buttons to send signal with different button code - **Custom buttons for Keeloq / Alutech AT4N / Nice Flor S / Somfy Telis / Security+ 2.0 / CAME Atomo** - now you can use arrow buttons to send signal with different button code
- `Add manually` menu extended with new protocols - `Add manually` menu extended with new protocols
@@ -75,12 +76,11 @@
- Recompiled IR TV Universal Remote for ALL buttons - Recompiled IR TV Universal Remote for ALL buttons
- Universal remotes for Projectors, Fans, A/Cs and Audio(soundbars, etc.) -> Also always updated and verified by our team - Universal remotes for Projectors, Fans, A/Cs and Audio(soundbars, etc.) -> Also always updated and verified by our team
- Infrared -> `RCA` Protocol - Infrared -> `RCA` Protocol
- Infrared -> Debug TX PIN output settings - Infrared -> External IR modules support (with autodetect by OFW)
- **NFC/RFID/iButton** - **NFC/RFID/iButton**
* LFRFID/iButton Fuzzer plugins * LFRFID and iButton Fuzzer plugins
* Extra Mifare Classic keys * Extra Mifare Classic keys in system dict
* EMV Protocol + Public data parser (by @Leptopt1los and @wosk) * EMV Protocol + Public data parser (by @Leptopt1los and @wosk)
* NFC/LFRFID - Stop emulation after 5 mins to avoid antenna damage (by @Leptopt1los)
* NFC `Add manually` -> Mifare Classic with custom UID * NFC `Add manually` -> Mifare Classic with custom UID
* NFC parsers: Umarsh, Zolotaya Korona, Kazan, Metromoney, Moscow Social Card, Troika (reworked) and [many others](https://github.com/DarkFlippers/unleashed-firmware/tree/dev/applications/main/nfc/plugins/supported_cards) (by @Leptopt1los and @assasinfil) * NFC parsers: Umarsh, Zolotaya Korona, Kazan, Metromoney, Moscow Social Card, Troika (reworked) and [many others](https://github.com/DarkFlippers/unleashed-firmware/tree/dev/applications/main/nfc/plugins/supported_cards) (by @Leptopt1los and @assasinfil)
- **Quality of life & other features** - **Quality of life & other features**
@@ -91,7 +91,7 @@
- Battery percentage display with different styles `Settings -> Desktop -> Battery View` - Battery percentage display with different styles `Settings -> Desktop -> Battery View`
- More games in Dummy Mode -> click or hold any of arrow buttons - More games in Dummy Mode -> click or hold any of arrow buttons
- Lock device with pin(or regular lock if pin not set) by holding UP button on main screen [(by an4tur0r)](https://github.com/DarkFlippers/unleashed-firmware/pull/107) - Lock device with pin(or regular lock if pin not set) by holding UP button on main screen [(by an4tur0r)](https://github.com/DarkFlippers/unleashed-firmware/pull/107)
- **BadBT** plugin (BT version of BadKB) [(by Willy-JL, ClaraCrazy, XFW contributors)](https://github.com/ClaraCrazy/Flipper-Xtreme/tree/dev/applications/main/bad_kb) - (See in Applications->Tools) - (aka BadUSB via Bluetooth) - **BadKB** plugin [(by Willy-JL, ClaraCrazy, XFW contributors)](https://github.com/Flipper-XFW/Xtreme-Firmware/tree/dev/applications/main/bad_kb) - (See in Applications->Tools) - (aka BadUSB via Bluetooth)
- BadUSB -> Keyboard layouts [(by rien > dummy-decoy)](https://github.com/dummy-decoy/flipperzero-firmware/tree/dummy_decoy/bad_usb_keyboard_layout) - BadUSB -> Keyboard layouts [(by rien > dummy-decoy)](https://github.com/dummy-decoy/flipperzero-firmware/tree/dummy_decoy/bad_usb_keyboard_layout)
- Custom community plugins and games added + all known working apps can be downloaded in extra pack in every release - Custom community plugins and games added + all known working apps can be downloaded in extra pack in every release
- Other small fixes and changes throughout - Other small fixes and changes throughout
@@ -100,16 +100,16 @@
Also check the [changelog in releases](https://github.com/DarkFlippers/unleashed-firmware/releases) for latest updates! Also check the [changelog in releases](https://github.com/DarkFlippers/unleashed-firmware/releases) for latest updates!
### Current modified and new Sub-GHz protocols list: ### Current modified and new Sub-GHz protocols list:
Thanks to Official team (to their SubGHz Developer, Skorp) for implementing decoders for these protocols in OFW. Thanks to Official team (to their SubGHz Developer, Skorp) for implementing support (decoder + encoder / or decode only) for these protocols in OFW.
Keeloq [Not ALL systems supported for decode or emulation!] - [Supported manufacturers list](https://pastes.io/raw/unuj9bhe4m) Keeloq [Not ALL systems supported for decode or emulation!] - [Supported manufacturers list](https://pastes.io/raw/unuj9bhe4m)
Encoders or sending made by @xMasterX: Encoders or emulation support made by @xMasterX:
- Nero Radio 57bit (+ 56bit encoder improvements) - Nero Radio 57bit (+ 56bit support)
- CAME 12bit/24bit encoder fixes (Fixes now merged in OFW) - CAME 12bit/24bit encoder fixes (Fixes are now merged in OFW)
- Keeloq: Dea Mio, Genius Bravo, GSN, HCS101, AN-Motors, JCM Tech, MHouse, Nice Smilo, DTM Neo, FAAC RC,XT, Mutancode, Normstahl, Beninca + Allmatic, Stilmatic, CAME Space, Aprimatic (model TR and similar), Centurion Nova (thanks Carlos !) - Keeloq: Dea Mio, Genius Bravo, GSN, HCS101, AN-Motors, JCM Tech, MHouse, Nice Smilo, DTM Neo, FAAC RC,XT, Mutancode, Normstahl, Beninca + Allmatic, Stilmatic, CAME Space, Aprimatic (model TR and similar), Centurion Nova (thanks Carlos !)
Encoders or sending made by @Eng1n33r(first implementation in Q2 2022) & @xMasterX (current version): Encoders or emulation made by @Eng1n33r(first implementation in Q2 2022) and @xMasterX (current version):
- CAME Atomo -> Update! check out new [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md) - CAME Atomo -> Update! check out new [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md)
- Nice Flor S -> How to create new remote - [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md) - Nice Flor S -> How to create new remote - [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md)
- FAAC SLH (Spa) -> Update!!! Check out new [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md) - FAAC SLH (Spa) -> Update!!! Check out new [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md)
@@ -117,7 +117,7 @@ Encoders or sending made by @Eng1n33r(first implementation in Q2 2022) & @xMaste
- Star Line - Star Line
- Security+ v1 & v2 (encoders was made in OFW) - Security+ v1 & v2 (encoders was made in OFW)
Encoders made by @assasinfil & @xMasterX: Encoders made by @assasinfil and @xMasterX:
- Somfy Telis -> How to create new remote - [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md) - Somfy Telis -> How to create new remote - [instructions](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemoteProg.md)
- Somfy Keytis - Somfy Keytis
- KingGates Stylo 4k - KingGates Stylo 4k
@@ -126,10 +126,9 @@ Encoders made by @assasinfil & @xMasterX:
## Please support development of the project ## Please support development of the project
The majority of this project is developed and maintained by me, @xMasterX. The majority of this project is developed and maintained by me, @xMasterX.
I'm unemployed, and the only income I receive is from your donations.
Our team is small and the guys are working on this project as much as they can solely based on the enthusiasm they have for this project and the community. Our team is small and the guys are working on this project as much as they can solely based on the enthusiasm they have for this project and the community.
- @Leptopt1los - NFC, RFID, IR Assets (only ACs), Plugins, and many other things - @Leptopt1los - NFC, RFID, Plugins, and many other things
- @gid9798 - SubGHz, Plugins, many other things - @gid9798 - SubGHz, Plugins, many other things - currently offline :(
- @assasinfil - SubGHz protocols, NFC parsers - @assasinfil - SubGHz protocols, NFC parsers
- @Svaarich - UI design and animations - @Svaarich - UI design and animations
- @amec0e - Infrared assets - @amec0e - Infrared assets
@@ -146,13 +145,14 @@ You can support us by using links or addresses below:
|cloudtips|only RU payments accepted|https://pay.cloudtips.ru/p/7b3e9d65| |cloudtips|only RU payments accepted|https://pay.cloudtips.ru/p/7b3e9d65|
|YooMoney|only RU payments accepted|https://yoomoney.ru/fundraise/XA49mgQLPA0.221209| |YooMoney|only RU payments accepted|https://yoomoney.ru/fundraise/XA49mgQLPA0.221209|
|USDT|(TRC20)|`TSXcitMSnWXUFqiUfEXrTVpVewXy2cYhrs`| |USDT|(TRC20)|`TSXcitMSnWXUFqiUfEXrTVpVewXy2cYhrs`|
|BCH||`qquxfyzntuqufy2dx0hrfr4sndp0tucvky4sw8qyu3`|
|ETH|(BSC/ERC20-Tokens)|`darkflippers.eth` (or `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`)| |ETH|(BSC/ERC20-Tokens)|`darkflippers.eth` (or `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`)|
|BTC||`bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`| |BTC||`bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`|
|SOL|(Solana/Tokens)|`DSgwouAEgu8iP5yr7EHHDqMNYWZxAqXWsTEeqCAXGLj8`|
|DOGE||`D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`| |DOGE||`D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`|
|LTC||`ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`| |LTC||`ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`|
|BCH||`qquxfyzntuqufy2dx0hrfr4sndp0tucvky4sw8qyu3`|
|XMR|(Monero)| `41xUz92suUu1u5Mu4qkrcs52gtfpu9rnZRdBpCJ244KRHf6xXSvVFevdf2cnjS7RAeYr5hn9MsEfxKoFDRSctFjG5fv1Mhn`| |XMR|(Monero)| `41xUz92suUu1u5Mu4qkrcs52gtfpu9rnZRdBpCJ244KRHf6xXSvVFevdf2cnjS7RAeYr5hn9MsEfxKoFDRSctFjG5fv1Mhn`|
|TON||`EQCOqcnYkvzOZUV_9bPE_8oTbOrOF03MnF-VcJyjisTZmpGf`| |TON||`UQCOqcnYkvzOZUV_9bPE_8oTbOrOF03MnF-VcJyjisTZmsxa`|
## Community apps included ## Community apps included
@@ -168,6 +168,8 @@ See full list and sources here: [xMasterX/all-the-plugins](https://github.com/xM
## [How to install](/documentation/HowToInstall.md) - [versions info](/CHANGELOG.md#recommended-update-option---web-updater): `n`,` `,`e`... ## [How to install](/documentation/HowToInstall.md) - [versions info](/CHANGELOG.md#recommended-update-option---web-updater): `n`,` `,`e`...
## Firmware & Development ## Firmware & Development
### - **Developer Documentation** - [developer.flipper.net](https://developer.flipper.net/flipperzero/doxygen)
### - **[How to build](/documentation/HowToBuild.md#how-to-build-by-yourself) | [Project-structure](#project-structure)** ### - **[How to build](/documentation/HowToBuild.md#how-to-build-by-yourself) | [Project-structure](#project-structure)**
### - **CLion IDE** - How to setup workspace for flipper firmware development [by Savely Krasovsky](https://krasovs.ky/2022/11/01/flipper-zero-clion.html) ### - **CLion IDE** - How to setup workspace for flipper firmware development [by Savely Krasovsky](https://krasovs.ky/2022/11/01/flipper-zero-clion.html)
@@ -246,6 +248,8 @@ See full list and sources here: [xMasterX/all-the-plugins](https://github.com/xM
* Official Docs: [docs.flipper.net](https://docs.flipper.net/) * Official Docs: [docs.flipper.net](https://docs.flipper.net/)
* Official Forum: [forum.flipperzero.one](https://forum.flipperzero.one/) * Official Forum: [forum.flipperzero.one](https://forum.flipperzero.one/)
* Update! Developer Documentation [developer.flipper.net](https://developer.flipper.net/flipperzero/doxygen)
# Project structure # Project structure
- `applications` - Applications and services used in firmware - `applications` - Applications and services used in firmware

View File

@@ -7,7 +7,7 @@
# construction of certain targets behind command-line options. # construction of certain targets behind command-line options.
import os import os
from fbt.util import path_as_posix from fbt.util import open_browser_action
DefaultEnvironment(tools=[]) DefaultEnvironment(tools=[])
@@ -42,6 +42,7 @@ distenv = coreenv.Clone(
"openocd", "openocd",
"blackmagic", "blackmagic",
"jflash", "jflash",
"doxygen",
], ],
ENV=os.environ, ENV=os.environ,
UPDATE_BUNDLE_DIR="dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}", UPDATE_BUNDLE_DIR="dist/${DIST_DIR}/f${TARGET_HW}-update-${DIST_SUFFIX}",
@@ -229,7 +230,7 @@ firmware_debug = distenv.PhonyTarget(
source=firmware_env["FW_ELF"], source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE}", GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}", GDBREMOTE="${OPENOCD_GDB_PIPE}",
FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")), FBT_FAP_DEBUG_ELF_ROOT=firmware_env["FBT_FAP_DEBUG_ELF_ROOT"],
) )
distenv.Depends(firmware_debug, firmware_flash) distenv.Depends(firmware_debug, firmware_flash)
@@ -239,7 +240,7 @@ distenv.PhonyTarget(
source=firmware_env["FW_ELF"], source=firmware_env["FW_ELF"],
GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}", GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
GDBREMOTE="${BLACKMAGIC_ADDR}", GDBREMOTE="${BLACKMAGIC_ADDR}",
FBT_FAP_DEBUG_ELF_ROOT=path_as_posix(firmware_env.subst("$FBT_FAP_DEBUG_ELF_ROOT")), FBT_FAP_DEBUG_ELF_ROOT=firmware_env["FBT_FAP_DEBUG_ELF_ROOT"],
) )
# Debug alien elf # Debug alien elf
@@ -419,3 +420,18 @@ distenv.PhonyTarget(
"env", "env",
"@echo $( ${FBT_SCRIPT_DIR.abspath}/toolchain/fbtenv.sh $)", "@echo $( ${FBT_SCRIPT_DIR.abspath}/toolchain/fbtenv.sh $)",
) )
doxy_build = distenv.DoxyBuild(
"documentation/doxygen/build/html/index.html",
"documentation/doxygen/Doxyfile-awesome.cfg",
doxy_env_variables={
"DOXY_SRC_ROOT": Dir(".").abspath,
"DOXY_BUILD_DIR": Dir("documentation/doxygen/build").abspath,
"DOXY_CONFIG_DIR": "documentation/doxygen",
},
)
distenv.Alias("doxygen", doxy_build)
distenv.AlwaysBuild(doxy_build)
# Open generated documentation in browser
distenv.PhonyTarget("doxy", open_browser_action, source=doxy_build)

View File

@@ -11,29 +11,29 @@ class AccessorApp {
public: public:
void run(void); void run(void);
AccessorApp(); AccessorApp(void);
~AccessorApp(); ~AccessorApp(void);
enum class Scene : uint8_t { enum class Scene : uint8_t {
Exit, Exit,
Start, Start,
}; };
AccessorAppViewManager* get_view_manager(); AccessorAppViewManager* get_view_manager(void);
void switch_to_next_scene(Scene index); void switch_to_next_scene(Scene index);
void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list); void search_and_switch_to_previous_scene(std::initializer_list<Scene> scenes_list);
bool switch_to_previous_scene(uint8_t count = 1); bool switch_to_previous_scene(uint8_t count = 1);
Scene get_previous_scene(); Scene get_previous_scene(void);
void notify_green_blink(); void notify_green_blink(void);
void notify_success(); void notify_success(void);
char* get_text_store(); char* get_text_store(void);
uint8_t get_text_store_size(); uint8_t get_text_store_size(void);
void set_text_store(const char* text...); void set_text_store(const char* text...);
WIEGAND* get_wiegand(); WIEGAND* get_wiegand(void);
OneWireHost* get_one_wire(); OneWireHost* get_one_wire(void);
private: private:
std::list<Scene> previous_scenes_list = {Scene::Exit}; std::list<Scene> previous_scenes_list = {Scene::Exit};

View File

@@ -15,16 +15,16 @@ public:
FuriMessageQueue* event_queue; FuriMessageQueue* event_queue;
AccessorAppViewManager(); AccessorAppViewManager(void);
~AccessorAppViewManager(); ~AccessorAppViewManager(void);
void switch_to(ViewType type); void switch_to(ViewType type);
void receive_event(AccessorEvent* event); void receive_event(AccessorEvent* event);
void send_event(AccessorEvent* event); void send_event(AccessorEvent* event);
Submenu* get_submenu(); Submenu* get_submenu(void);
Popup* get_popup(); Popup* get_popup(void);
private: private:
ViewDispatcher* view_dispatcher; ViewDispatcher* view_dispatcher;

View File

@@ -2,19 +2,19 @@
class WIEGAND { class WIEGAND {
public: public:
WIEGAND(); WIEGAND(void);
void begin(); void begin(void);
void end(); void end(void);
bool available(); bool available(void);
unsigned long getCode(); unsigned long getCode(void);
unsigned long getCodeHigh(); unsigned long getCodeHigh(void);
int getWiegandType(); int getWiegandType(void);
static void ReadD0(); static void ReadD0(void);
static void ReadD1(); static void ReadD1(void);
private: private:
static bool DoWiegandConversion(); static bool DoWiegandConversion(void);
static unsigned long static unsigned long
GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength); GetCardId(unsigned long* codehigh, unsigned long* codelow, char bitlength);

View File

@@ -32,7 +32,7 @@ static void battery_test_battery_info_update_model(void* context) {
notification_message(app->notifications, &sequence_display_backlight_on); notification_message(app->notifications, &sequence_display_backlight_on);
} }
BatteryTestApp* battery_test_alloc() { BatteryTestApp* battery_test_alloc(void) {
BatteryTestApp* app = malloc(sizeof(BatteryTestApp)); BatteryTestApp* app = malloc(sizeof(BatteryTestApp));
// Records // Records

View File

@@ -116,7 +116,7 @@ static void battery_info_draw_callback(Canvas* canvas, void* context) {
draw_stat(canvas, 104, 42, &I_Health_16x16, health); draw_stat(canvas, 104, 42, &I_Health_16x16, health);
} }
BatteryInfo* battery_info_alloc() { BatteryInfo* battery_info_alloc(void) {
BatteryInfo* battery_info = malloc(sizeof(BatteryInfo)); BatteryInfo* battery_info = malloc(sizeof(BatteryInfo));
battery_info->view = view_alloc(); battery_info->view = view_alloc();
view_set_context(battery_info->view, battery_info); view_set_context(battery_info->view, battery_info);

View File

@@ -14,7 +14,7 @@ typedef struct {
uint8_t health; uint8_t health;
} BatteryInfoModel; } BatteryInfoModel;
BatteryInfo* battery_info_alloc(); BatteryInfo* battery_info_alloc(void);
void battery_info_free(BatteryInfo* battery_info); void battery_info_free(BatteryInfo* battery_info);

View File

@@ -28,7 +28,7 @@ uint32_t bt_debug_start_view(void* context) {
return BtDebugAppViewSubmenu; return BtDebugAppViewSubmenu;
} }
BtDebugApp* bt_debug_app_alloc() { BtDebugApp* bt_debug_app_alloc(void) {
BtDebugApp* app = malloc(sizeof(BtDebugApp)); BtDebugApp* app = malloc(sizeof(BtDebugApp));
// Gui // Gui

View File

@@ -129,7 +129,7 @@ static void bt_test_carrier_timer_callback(void* context) {
} }
} }
BtCarrierTest* bt_carrier_test_alloc() { BtCarrierTest* bt_carrier_test_alloc(void) {
BtCarrierTest* bt_carrier_test = malloc(sizeof(BtCarrierTest)); BtCarrierTest* bt_carrier_test = malloc(sizeof(BtCarrierTest));
bt_carrier_test->bt_test = bt_test_alloc(); bt_carrier_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_carrier_test->bt_test, bt_carrier_test); bt_test_set_context(bt_carrier_test->bt_test, bt_carrier_test);

View File

@@ -3,7 +3,7 @@
typedef struct BtCarrierTest BtCarrierTest; typedef struct BtCarrierTest BtCarrierTest;
BtCarrierTest* bt_carrier_test_alloc(); BtCarrierTest* bt_carrier_test_alloc(void);
void bt_carrier_test_free(BtCarrierTest* bt_carrier_test); void bt_carrier_test_free(BtCarrierTest* bt_carrier_test);

View File

@@ -97,7 +97,7 @@ static void bt_test_packet_timer_callback(void* context) {
} }
} }
BtPacketTest* bt_packet_test_alloc() { BtPacketTest* bt_packet_test_alloc(void) {
BtPacketTest* bt_packet_test = malloc(sizeof(BtPacketTest)); BtPacketTest* bt_packet_test = malloc(sizeof(BtPacketTest));
bt_packet_test->bt_test = bt_test_alloc(); bt_packet_test->bt_test = bt_test_alloc();
bt_test_set_context(bt_packet_test->bt_test, bt_packet_test); bt_test_set_context(bt_packet_test->bt_test, bt_packet_test);

View File

@@ -3,7 +3,7 @@
typedef struct BtPacketTest BtPacketTest; typedef struct BtPacketTest BtPacketTest;
BtPacketTest* bt_packet_test_alloc(); BtPacketTest* bt_packet_test_alloc(void);
void bt_packet_test_free(BtPacketTest* bt_packet_test); void bt_packet_test_free(BtPacketTest* bt_packet_test);

View File

@@ -305,7 +305,7 @@ void bt_test_process_back(BtTest* bt_test) {
} }
} }
BtTest* bt_test_alloc() { BtTest* bt_test_alloc(void) {
BtTest* bt_test = malloc(sizeof(BtTest)); BtTest* bt_test = malloc(sizeof(BtTest));
bt_test->view = view_alloc(); bt_test->view = view_alloc();
view_set_context(bt_test->view, bt_test); view_set_context(bt_test->view, bt_test);

View File

@@ -12,7 +12,7 @@ typedef void (*BtTestBackCallback)(void* context);
typedef struct BtTestParam BtTestParam; typedef struct BtTestParam BtTestParam;
typedef void (*BtTestParamChangeCallback)(BtTestParam* param); typedef void (*BtTestParamChangeCallback)(BtTestParam* param);
BtTest* bt_test_alloc(); BtTest* bt_test_alloc(void);
void bt_test_free(BtTest* bt_test); void bt_test_free(BtTest* bt_test);

View File

@@ -90,7 +90,7 @@ uint32_t ccid_test_exit(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
CcidTestApp* ccid_test_app_alloc() { CcidTestApp* ccid_test_app_alloc(void) {
CcidTestApp* app = malloc(sizeof(CcidTestApp)); CcidTestApp* app = malloc(sizeof(CcidTestApp));
// Gui // Gui

View File

@@ -50,7 +50,7 @@ static void crash_test_submenu_callback(void* context, uint32_t index) {
furi_halt("Crash test: furi_halt"); furi_halt("Crash test: furi_halt");
break; break;
default: default:
furi_crash("Programming error"); furi_crash();
} }
} }
@@ -59,7 +59,7 @@ static uint32_t crash_test_exit_callback(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
CrashTest* crash_test_alloc() { CrashTest* crash_test_alloc(void) {
CrashTest* instance = malloc(sizeof(CrashTest)); CrashTest* instance = malloc(sizeof(CrashTest));
View* view = NULL; View* view = NULL;

View File

@@ -26,7 +26,7 @@ static void gui_input_events_callback(const void* value, void* ctx) {
} }
} }
static DirectDraw* direct_draw_alloc() { static DirectDraw* direct_draw_alloc(void) {
DirectDraw* instance = malloc(sizeof(DirectDraw)); DirectDraw* instance = malloc(sizeof(DirectDraw));
instance->input = furi_record_open(RECORD_INPUT_EVENTS); instance->input = furi_record_open(RECORD_INPUT_EVENTS);

View File

@@ -121,7 +121,7 @@ static void display_config_set_contrast(VariableItem* item) {
display_test_reload_config(instance); display_test_reload_config(instance);
} }
DisplayTest* display_test_alloc() { DisplayTest* display_test_alloc(void) {
DisplayTest* instance = malloc(sizeof(DisplayTest)); DisplayTest* instance = malloc(sizeof(DisplayTest));
View* view = NULL; View* view = NULL;

View File

@@ -154,7 +154,7 @@ static void view_display_test_timer_callback(void* context) {
instance->view, ViewDisplayTestModel * model, { model->counter++; }, true); instance->view, ViewDisplayTestModel * model, { model->counter++; }, true);
} }
ViewDisplayTest* view_display_test_alloc() { ViewDisplayTest* view_display_test_alloc(void) {
ViewDisplayTest* instance = malloc(sizeof(ViewDisplayTest)); ViewDisplayTest* instance = malloc(sizeof(ViewDisplayTest));
instance->view = view_alloc(); instance->view = view_alloc();

View File

@@ -5,7 +5,7 @@
typedef struct ViewDisplayTest ViewDisplayTest; typedef struct ViewDisplayTest ViewDisplayTest;
ViewDisplayTest* view_display_test_alloc(); ViewDisplayTest* view_display_test_alloc(void);
void view_display_test_free(ViewDisplayTest* instance); void view_display_test_free(ViewDisplayTest* instance);

View File

@@ -81,7 +81,7 @@ static void expansion_test_app_serial_rx_callback(
} }
} }
static ExpansionTestApp* expansion_test_app_alloc() { static ExpansionTestApp* expansion_test_app_alloc(void) {
ExpansionTestApp* instance = malloc(sizeof(ExpansionTestApp)); ExpansionTestApp* instance = malloc(sizeof(ExpansionTestApp));
instance->buf = furi_stream_buffer_alloc(RECEIVE_BUFFER_SIZE, 1); instance->buf = furi_stream_buffer_alloc(RECEIVE_BUFFER_SIZE, 1);
return instance; return instance;

View File

@@ -12,7 +12,7 @@ static bool lfrfid_debug_back_event_callback(void* context) {
return scene_manager_handle_back_event(app->scene_manager); return scene_manager_handle_back_event(app->scene_manager);
} }
static LfRfidDebug* lfrfid_debug_alloc() { static LfRfidDebug* lfrfid_debug_alloc(void) {
LfRfidDebug* app = malloc(sizeof(LfRfidDebug)); LfRfidDebug* app = malloc(sizeof(LfRfidDebug));
app->view_dispatcher = view_dispatcher_alloc(); app->view_dispatcher = view_dispatcher_alloc();

View File

@@ -170,7 +170,7 @@ static bool lfrfid_debug_view_tune_input_callback(InputEvent* event, void* conte
return consumed; return consumed;
} }
LfRfidTuneView* lfrfid_debug_view_tune_alloc() { LfRfidTuneView* lfrfid_debug_view_tune_alloc(void) {
LfRfidTuneView* tune_view = malloc(sizeof(LfRfidTuneView)); LfRfidTuneView* tune_view = malloc(sizeof(LfRfidTuneView));
tune_view->view = view_alloc(); tune_view->view = view_alloc();
view_set_context(tune_view->view, tune_view); view_set_context(tune_view->view, tune_view);

View File

@@ -3,7 +3,7 @@
typedef struct LfRfidTuneView LfRfidTuneView; typedef struct LfRfidTuneView LfRfidTuneView;
LfRfidTuneView* lfrfid_debug_view_tune_alloc(); LfRfidTuneView* lfrfid_debug_view_tune_alloc(void);
void lfrfid_debug_view_tune_free(LfRfidTuneView* tune_view); void lfrfid_debug_view_tune_free(LfRfidTuneView* tune_view);

View File

@@ -53,7 +53,7 @@ static uint32_t locale_test_exit(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
static LocaleTestApp* locale_test_alloc() { static LocaleTestApp* locale_test_alloc(void) {
LocaleTestApp* app = malloc(sizeof(LocaleTestApp)); LocaleTestApp* app = malloc(sizeof(LocaleTestApp));
// Gui // Gui

View File

@@ -83,7 +83,7 @@ static bool rpc_debug_app_rpc_init_rpc(RpcDebugApp* app, const char* args) {
return ret; return ret;
} }
static RpcDebugApp* rpc_debug_app_alloc() { static RpcDebugApp* rpc_debug_app_alloc(void) {
RpcDebugApp* app = malloc(sizeof(RpcDebugApp)); RpcDebugApp* app = malloc(sizeof(RpcDebugApp));
app->gui = furi_record_open(RECORD_GUI); app->gui = furi_record_open(RECORD_GUI);

View File

@@ -21,7 +21,7 @@ typedef struct {
Cli* cli; Cli* cli;
} SpeakerDebugApp; } SpeakerDebugApp;
static SpeakerDebugApp* speaker_app_alloc() { static SpeakerDebugApp* speaker_app_alloc(void) {
SpeakerDebugApp* app = (SpeakerDebugApp*)malloc(sizeof(SpeakerDebugApp)); SpeakerDebugApp* app = (SpeakerDebugApp*)malloc(sizeof(SpeakerDebugApp));
app->music_worker = music_worker_alloc(); app->music_worker = music_worker_alloc();
app->message_queue = furi_message_queue_alloc(8, sizeof(SpeakerDebugAppMessage)); app->message_queue = furi_message_queue_alloc(8, sizeof(SpeakerDebugAppMessage));

View File

@@ -38,7 +38,7 @@ typedef enum {
PrincetonDecoderStepCheckDuration, PrincetonDecoderStepCheckDuration,
} PrincetonDecoderStep; } PrincetonDecoderStep;
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc() { SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(void) {
SubGhzEncoderPrinceton* instance = malloc(sizeof(SubGhzEncoderPrinceton)); SubGhzEncoderPrinceton* instance = malloc(sizeof(SubGhzEncoderPrinceton));
return instance; return instance;
} }

View File

@@ -15,7 +15,7 @@ typedef void (*SubGhzDecoderPrincetonCallback)(SubGhzDecoderPrinceton* parser, v
* Allocate SubGhzEncoderPrinceton * Allocate SubGhzEncoderPrinceton
* @return pointer to SubGhzEncoderPrinceton instance * @return pointer to SubGhzEncoderPrinceton instance
*/ */
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(); SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc(void);
/** /**
* Free SubGhzEncoderPrinceton instance * Free SubGhzEncoderPrinceton instance
@@ -69,7 +69,7 @@ LevelDuration subghz_encoder_princeton_for_testing_yield(void* context);
* Allocate SubGhzDecoderPrinceton * Allocate SubGhzDecoderPrinceton
* @return SubGhzDecoderPrinceton* * @return SubGhzDecoderPrinceton*
*/ */
SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc(); SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc(void);
/** /**
* Free SubGhzDecoderPrinceton * Free SubGhzDecoderPrinceton

View File

@@ -12,7 +12,7 @@ void subghz_test_scene_show_only_rx_on_enter(void* context) {
// Setup view // Setup view
Popup* popup = app->popup; Popup* popup = app->popup;
const char* header_text = "Transmission is blocked"; const char* header_text = "Transmission is Blocked";
const char* message_text = "Transmission on\nthis frequency is\nrestricted in\nyour region"; const char* message_text = "Transmission on\nthis frequency is\nrestricted in\nyour region";
if(!furi_hal_region_is_provisioned()) { if(!furi_hal_region_is_provisioned()) {
header_text = "Firmware update needed"; header_text = "Firmware update needed";

View File

@@ -21,7 +21,7 @@ static void subghz_test_app_tick_event_callback(void* context) {
scene_manager_handle_tick_event(app->scene_manager); scene_manager_handle_tick_event(app->scene_manager);
} }
SubGhzTestApp* subghz_test_app_alloc() { SubGhzTestApp* subghz_test_app_alloc(void) {
SubGhzTestApp* app = malloc(sizeof(SubGhzTestApp)); SubGhzTestApp* app = malloc(sizeof(SubGhzTestApp));
// GUI // GUI

View File

@@ -219,7 +219,7 @@ void subghz_test_carrier_rssi_timer_callback(void* context) {
false); false);
} }
SubGhzTestCarrier* subghz_test_carrier_alloc() { SubGhzTestCarrier* subghz_test_carrier_alloc(void) {
SubGhzTestCarrier* subghz_test_carrier = malloc(sizeof(SubGhzTestCarrier)); SubGhzTestCarrier* subghz_test_carrier = malloc(sizeof(SubGhzTestCarrier));
// View allocation and configuration // View allocation and configuration

View File

@@ -16,7 +16,7 @@ void subghz_test_carrier_set_callback(
SubGhzTestCarrierCallback callback, SubGhzTestCarrierCallback callback,
void* context); void* context);
SubGhzTestCarrier* subghz_test_carrier_alloc(); SubGhzTestCarrier* subghz_test_carrier_alloc(void);
void subghz_test_carrier_free(SubGhzTestCarrier* subghz_test_carrier); void subghz_test_carrier_free(SubGhzTestCarrier* subghz_test_carrier);

View File

@@ -236,7 +236,7 @@ void subghz_test_packet_exit(void* context) {
furi_hal_subghz_sleep(); furi_hal_subghz_sleep();
} }
SubGhzTestPacket* subghz_test_packet_alloc() { SubGhzTestPacket* subghz_test_packet_alloc(void) {
SubGhzTestPacket* instance = malloc(sizeof(SubGhzTestPacket)); SubGhzTestPacket* instance = malloc(sizeof(SubGhzTestPacket));
// View allocation and configuration // View allocation and configuration

View File

@@ -15,7 +15,7 @@ void subghz_test_packet_set_callback(
SubGhzTestPacketCallback callback, SubGhzTestPacketCallback callback,
void* context); void* context);
SubGhzTestPacket* subghz_test_packet_alloc(); SubGhzTestPacket* subghz_test_packet_alloc(void);
void subghz_test_packet_free(SubGhzTestPacket* subghz_test_packet); void subghz_test_packet_free(SubGhzTestPacket* subghz_test_packet);

View File

@@ -164,7 +164,7 @@ void subghz_test_static_exit(void* context) {
furi_hal_subghz_sleep(); furi_hal_subghz_sleep();
} }
SubGhzTestStatic* subghz_test_static_alloc() { SubGhzTestStatic* subghz_test_static_alloc(void) {
SubGhzTestStatic* instance = malloc(sizeof(SubGhzTestStatic)); SubGhzTestStatic* instance = malloc(sizeof(SubGhzTestStatic));
// View allocation and configuration // View allocation and configuration

View File

@@ -15,7 +15,7 @@ void subghz_test_static_set_callback(
SubGhzTestStaticCallback callback, SubGhzTestStaticCallback callback,
void* context); void* context);
SubGhzTestStatic* subghz_test_static_alloc(); SubGhzTestStatic* subghz_test_static_alloc(void);
void subghz_test_static_free(SubGhzTestStatic* subghz_static); void subghz_test_static_free(SubGhzTestStatic* subghz_static);

View File

@@ -0,0 +1,10 @@
App(
appid="text_box_element_test",
name="Text Box Element Test",
apptype=FlipperAppType.DEBUG,
entry_point="text_box_element_test_app",
requires=["gui"],
stack_size=1 * 1024,
order=140,
fap_category="Debug",
)

View File

@@ -71,7 +71,7 @@ static void text_box_test_input_callback(InputEvent* input_event, void* ctx) {
furi_message_queue_put(event_queue, input_event, FuriWaitForever); furi_message_queue_put(event_queue, input_event, FuriWaitForever);
} }
int32_t text_box_test_app(void* p) { int32_t text_box_element_test_app(void* p) {
UNUSED(p); UNUSED(p);
FuriMessageQueue* event_queue = furi_message_queue_alloc(32, sizeof(InputEvent)); FuriMessageQueue* event_queue = furi_message_queue_alloc(32, sizeof(InputEvent));
furi_check(event_queue); furi_check(event_queue);

View File

@@ -1,8 +1,8 @@
App( App(
appid="text_box_test", appid="text_box_view_test",
name="Text Box Test", name="Text Box View Test",
apptype=FlipperAppType.DEBUG, apptype=FlipperAppType.DEBUG,
entry_point="text_box_test_app", entry_point="text_box_view_test_app",
requires=["gui"], requires=["gui"],
stack_size=1 * 1024, stack_size=1 * 1024,
order=140, order=140,

View File

@@ -0,0 +1,161 @@
#include <furi.h>
#include <gui/gui.h>
#include <gui/view_dispatcher.h>
#include <gui/modules/text_box.h>
#include <gui/view_stack.h>
#define TAG "TextBoxViewTest"
typedef struct {
TextBoxFont font;
TextBoxFocus focus;
const char* text;
} TextBoxViewTestContent;
static const TextBoxViewTestContent text_box_view_test_content_arr[] = {
{
.font = TextBoxFontText,
.focus = TextBoxFocusStart,
.text = "Hello, let's test text box. Press Right and Left to switch content",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusEnd,
.text = "First test to add dynamically lines with EndFocus set\nLine 0",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusEnd,
.text = "First test to add dynamically lines with EndFocus set\nLine 0\nLine 1",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusEnd,
.text = "First test to add dynamically lines with EndFocus set\nLine 0\nLine 1\nLine 2",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusEnd,
.text =
"First test to add dynamically lines with EndFocus set\nLine 0\nLine 1\nLine 2\nLine 3",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusEnd,
.text =
"First test to add dynamically lines with EndFocus set\nLine 0\nLine 1\nLine 2\nLine 3\nLine 4",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusStart,
.text =
"Verify that symbols don't overlap borders: llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllend",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusStart,
.text =
"\n\n\n Start from several newline chars. Verify that scrolling doesn't break.\n\n\n\n\nThe end",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusStart,
.text =
"Let's test big text.\n\n The ARM Cortex-M is a group of 32-bit RISC ARM processor cores licensed by ARM Limited. These cores are optimized for low-cost and energy-efficient integrated circuits, which have been embedded in tens of billions of consumer devices.[1] Though they are most often the main component of microcontroller chips, sometimes they are embedded inside other types of chips too. The Cortex-M family consists of Cortex-M0,[2] Cortex-M0+,[3] Cortex-M1,[4] Cortex-M3,[5] Cortex-M4,[6] Cortex-M7,[7] Cortex-M23,[8] Cortex-M33,[9] Cortex-M35P,[10] Cortex-M52,[11] Cortex-M55,[12] Cortex-M85.[13] A floating-point unit (FPU) option is available for Cortex-M4 / M7 / M33 / M35P / M52 / M55 / M85 cores, and when included in the silicon these cores are sometimes known as \"Cortex-MxF\", where 'x' is the core variant.\n\nThe ARM Cortex-M family are ARM microprocessor cores that are designed for use in microcontrollers, ASICs, ASSPs, FPGAs, and SoCs. Cortex-M cores are commonly used as dedicated microcontroller chips, but also are hidden inside of SoC chips as power management controllers, I/O controllers, system controllers, touch screen controllers, smart battery controllers, and sensor controllers. The main difference from Cortex-A cores is that Cortex-M cores have no memory management unit (MMU) for virtual memory, considered essential for full-fledged operating systems. Cortex-M programs instead run bare metal or on one of the many real-time operating systems which support a Cortex-M.Though 8-bit microcontrollers were very popular in the past, Cortex-M has slowly been chipping away at the 8-bit market as the prices of low-end Cortex-M chips have moved downward. Cortex-M have become a popular replacements for 8-bit chips in applications that benefit from 32-bit math operations, and replacing older legacy ARM cores such as ARM7 and ARM9.",
},
{
.font = TextBoxFontText,
.focus = TextBoxFocusEnd,
.text =
"The same but with EndFocus\n\n The ARM Cortex-M is a group of 32-bit RISC ARM processor cores licensed by ARM Limited. These cores are optimized for low-cost and energy-efficient integrated circuits, which have been embedded in tens of billions of consumer devices.[1] Though they are most often the main component of microcontroller chips, sometimes they are embedded inside other types of chips too. The Cortex-M family consists of Cortex-M0,[2] Cortex-M0+,[3] Cortex-M1,[4] Cortex-M3,[5] Cortex-M4,[6] Cortex-M7,[7] Cortex-M23,[8] Cortex-M33,[9] Cortex-M35P,[10] Cortex-M52,[11] Cortex-M55,[12] Cortex-M85.[13] A floating-point unit (FPU) option is available for Cortex-M4 / M7 / M33 / M35P / M52 / M55 / M85 cores, and when included in the silicon these cores are sometimes known as \"Cortex-MxF\", where 'x' is the core variant.\n\nThe ARM Cortex-M family are ARM microprocessor cores that are designed for use in microcontrollers, ASICs, ASSPs, FPGAs, and SoCs. Cortex-M cores are commonly used as dedicated microcontroller chips, but also are hidden inside of SoC chips as power management controllers, I/O controllers, system controllers, touch screen controllers, smart battery controllers, and sensor controllers. The main difference from Cortex-A cores is that Cortex-M cores have no memory management unit (MMU) for virtual memory, considered essential for full-fledged operating systems. Cortex-M programs instead run bare metal or on one of the many real-time operating systems which support a Cortex-M.Though 8-bit microcontrollers were very popular in the past, Cortex-M has slowly been chipping away at the 8-bit market as the prices of low-end Cortex-M chips have moved downward. Cortex-M have become a popular replacements for 8-bit chips in applications that benefit from 32-bit math operations, and replacing older legacy ARM cores such as ARM7 and ARM9.",
},
{
.font = TextBoxFontHex,
.focus = TextBoxFocusEnd,
.text =
"0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999\n0000 0000 0000 0000\n1111 1111 1111 1111\n2222 2222 2222 2222\n3333 3333 3333 3333\n4444 4444 4444 4444\n5555 5555 5555 5555\n6666 6666 6666 6666\n7777 7777 7777 7777\n8888 8888 8888 8888\n9999 9999 9999 9999",
},
};
typedef struct {
TextBox* text_box;
ViewDispatcher* view_dispatcher;
size_t current_content_i;
} TextBoxViewTest;
static void text_box_update_view(TextBoxViewTest* instance) {
// Intentional incorrect way to reset text box to verify that state resets if text changes
text_box_set_text(instance->text_box, "");
const TextBoxViewTestContent* content =
&text_box_view_test_content_arr[instance->current_content_i];
text_box_set_font(instance->text_box, content->font);
text_box_set_focus(instance->text_box, content->focus);
text_box_set_text(instance->text_box, content->text);
}
static bool text_box_switch_view_input_callback(InputEvent* event, void* context) {
bool consumed = false;
TextBoxViewTest* instance = context;
size_t contents_cnt = COUNT_OF(text_box_view_test_content_arr);
if(event->type == InputTypeShort) {
if(event->key == InputKeyRight) {
if(instance->current_content_i < contents_cnt - 1) {
instance->current_content_i++;
text_box_update_view(instance);
consumed = true;
}
} else if(event->key == InputKeyLeft) {
if(instance->current_content_i > 0) {
instance->current_content_i--;
text_box_update_view(instance);
consumed = true;
}
} else if(event->key == InputKeyBack) {
view_dispatcher_stop(instance->view_dispatcher);
}
}
return consumed;
}
int32_t text_box_view_test_app(void* p) {
UNUSED(p);
Gui* gui = furi_record_open(RECORD_GUI);
ViewDispatcher* view_dispatcher = view_dispatcher_alloc();
view_dispatcher_attach_to_gui(view_dispatcher, gui, ViewDispatcherTypeFullscreen);
view_dispatcher_enable_queue(view_dispatcher);
TextBoxViewTest instance = {
.text_box = text_box_alloc(),
.current_content_i = 0,
.view_dispatcher = view_dispatcher,
};
text_box_update_view(&instance);
View* text_box_switch_view = view_alloc();
view_set_input_callback(text_box_switch_view, text_box_switch_view_input_callback);
view_set_context(text_box_switch_view, &instance);
ViewStack* view_stack = view_stack_alloc();
view_stack_add_view(view_stack, text_box_switch_view);
view_stack_add_view(view_stack, text_box_get_view(instance.text_box));
view_dispatcher_add_view(view_dispatcher, 0, view_stack_get_view(view_stack));
view_dispatcher_switch_to_view(view_dispatcher, 0);
view_dispatcher_run(view_dispatcher);
view_dispatcher_remove_view(view_dispatcher, 0);
view_dispatcher_free(view_dispatcher);
view_stack_free(view_stack);
view_free(text_box_switch_view);
text_box_free(instance.text_box);
furi_record_close(RECORD_GUI);
return 0;
}

View File

@@ -283,13 +283,14 @@ static UartEchoApp* uart_echo_app_alloc(uint32_t baudrate) {
static void uart_echo_app_free(UartEchoApp* app) { static void uart_echo_app_free(UartEchoApp* app) {
furi_assert(app); furi_assert(app);
furi_hal_serial_async_rx_stop(app->serial_handle);
furi_hal_serial_deinit(app->serial_handle);
furi_hal_serial_control_release(app->serial_handle);
furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventStop); furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventStop);
furi_thread_join(app->worker_thread); furi_thread_join(app->worker_thread);
furi_thread_free(app->worker_thread); furi_thread_free(app->worker_thread);
furi_hal_serial_deinit(app->serial_handle);
furi_hal_serial_control_release(app->serial_handle);
// Free views // Free views
view_dispatcher_remove_view(app->view_dispatcher, 0); view_dispatcher_remove_view(app->view_dispatcher, 0);

View File

@@ -2,8 +2,9 @@ App(
appid="unit_tests", appid="unit_tests",
apptype=FlipperAppType.STARTUP, apptype=FlipperAppType.STARTUP,
entry_point="unit_tests_on_system_start", entry_point="unit_tests_on_system_start",
sources=["unit_tests.c", "test_runner.c", "unit_test_api_table.cpp"],
cdefines=["APP_UNIT_TESTS"], cdefines=["APP_UNIT_TESTS"],
requires=["system_settings"], requires=["system_settings", "subghz_start"],
provides=["delay_test"], provides=["delay_test"],
resources="resources", resources="resources",
order=100, order=100,
@@ -12,9 +13,210 @@ App(
App( App(
appid="delay_test", appid="delay_test",
name="Delay Test", name="Delay Test",
sources=["tests/common/*.c", "tests/rpc/*.c"],
apptype=FlipperAppType.SYSTEM, apptype=FlipperAppType.SYSTEM,
entry_point="delay_test_app", entry_point="delay_test_app",
stack_size=1 * 1024, stack_size=1 * 1024,
requires=["unit_tests"], requires=["unit_tests"],
order=110, order=110,
) )
App(
appid="test_varint",
sources=["tests/common/*.c", "tests/varint/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_furi",
sources=["tests/common/*.c", "tests/furi/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_furi_hal",
sources=["tests/common/*.c", "tests/furi_hal/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_furi_hal_crypto",
sources=["tests/common/*.c", "tests/furi_hal_crypto/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_furi_string",
sources=["tests/common/*.c", "tests/furi_string/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_storage",
sources=["tests/common/*.c", "tests/storage/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_stream",
sources=["tests/common/*.c", "tests/stream/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_dirwalk",
sources=["tests/common/*.c", "tests/dirwalk/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_manifest",
sources=["tests/common/*.c", "tests/manifest/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_flipper_format",
sources=["tests/common/*.c", "tests/flipper_format/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_flipper_format_string",
sources=["tests/common/*.c", "tests/flipper_format_string/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_rpc",
sources=["tests/common/*.c", "tests/rpc/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_subghz",
sources=["tests/common/*.c", "tests/subghz/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_infrared",
sources=["tests/common/*.c", "tests/infrared/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_nfc",
sources=["tests/common/*.c", "tests/nfc/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_power",
sources=["tests/common/*.c", "tests/power/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_protocol_dict",
sources=["tests/common/*.c", "tests/protocol_dict/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_lfrfid",
sources=["tests/common/*.c", "tests/lfrfid/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_bit_lib",
sources=["tests/common/*.c", "tests/bit_lib/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_datetime",
sources=["tests/common/*.c", "tests/datetime/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_float_tools",
sources=["tests/common/*.c", "tests/float_tools/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_bt",
sources=["tests/common/*.c", "tests/bt/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_dialogs_file_browser_options",
sources=["tests/common/*.c", "tests/dialogs_file_browser_options/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_expansion",
sources=["tests/common/*.c", "tests/expansion/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)
App(
appid="test_compress",
sources=["tests/common/*.c", "tests/compress/*.c"],
apptype=FlipperAppType.PLUGIN,
entry_point="get_api",
requires=["unit_tests"],
)

View File

@@ -0,0 +1,205 @@
Filetype: IR tests file
Version: 1
#
name: decoder_input1
type: raw
data: 25557 8437 4188 571 1538 595 1514 567 1542 570 1539 573 501 565 1544 568 506 571 1539 573 501 565 509 568 508 569 506 571 1538 574 501 565 1543 569 506 571 504 573 1536 566 1544 568 506 592 1517 574 1535 567 507 570 505 572 1537 575 500 566 508 600 1509 572 503 574 501 565 1544 568 1540 593
#
name: decoder_expected1
type: parsed_array
count: 1
#
protocol: Pioneer
address: AF 00 00 00
command: 36 00 00 00
repeat: false
#
name: decoder_input2
type: raw
data: 25609 8444 4152 564 1568 544 1565 547 1561 541 1568 544 530 547 1536 566 510 567 1567 545 529 548 526 540 535 542 508 569 1539 573 527 539 1543 569 506 571 504 573 1561 541 508 569 507 570 1538 564 1545 567 507 570 505 572 1537 565 509 568 1541 571 1538 564 511 566 509 568 1539 573 1537 596
#
name: decoder_expected2
type: parsed_array
count: 1
#
protocol: Pioneer
address: AF 00 00 00
command: 32 00 00 00
repeat: false
#
name: decoder_input3
type: raw
data: 25582 8448 4176 571 1537 565 1544 568 1540 572 1537 575 500 566 1542 570 505 572 1537 575 500 566 508 569 506 571 504 573 1536 565 510 567 1542 570 504 573 1536 566 1543 569 506 571 504 573 1536 566 1543 569 506 571 504 573 502 575 500 566 1542 570 1539 573 502 575 500 566 1542 570 1540 572
#
name: decoder_expected3
type: parsed_array
count: 1
#
protocol: Pioneer
address: AF 00 00 00
command: 33 00 00 00
repeat: false
#
name: decoder_input4
type: raw
data: 25594 8443 4181 568 1542 570 505 572 1538 564 1545 567 508 569 1540 572 504 573 1536 566 510 567 1542 571 505 572 504 573 1562 540 510 567 1543 570 506 571 504 573 503 574 501 565 510 567 509 568 507 570 1539 573 502 565 1545 568 1542 571 1539 573 1536 566 1544 569 1541 572 503 574 1537 565
#
name: decoder_expected4
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 40 00 00 00
repeat: false
#
name: decoder_input5
type: raw
data: 25556 8475 4150 597 1512 600 476 601 1509 603 1506 595 480 597 1512 600 476 601 1508 594 482 595 1515 597 478 599 477 600 1510 602 473 604 1506 595 480 597 1513 599 476 601 475 602 474 603 472 594 482 595 1514 598 477 600 476 601 1508 594 1516 596 1513 599 1510 602 1507 595 480 597 1513 599
#
name: decoder_expected5
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 41 00 00 00
repeat: false
#
name: decoder_input6
type: raw
data: 25567 8471 4155 604 1506 596 480 597 1513 599 1510 603 473 594 1515 597 478 599 1511 602 474 603 1507 595 480 597 479 598 1511 602 474 603 1506 596 480 597 478 599 1511 602 474 603 472 594 481 596 479 598 1512 601 474 603 1506 596 479 598 1511 602 1508 594 1515 598 1512 600 475 602 1507 595
#
name: decoder_expected6
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 42 00 00 00
repeat: false
#
name: decoder_input7
type: raw
data: 25584 8444 4180 569 1541 572 504 573 1536 566 1544 569 507 570 1539 574 501 566 1569 596 455 570 1540 573 502 575 501 565 1544 569 507 570 1565 548 503 574 1535 567 1543 570 506 571 529 548 502 565 511 566 1543 601 475 571 504 573 503 574 1536 566 1543 570 1539 574 1536 566 509 568 1541 572
#
name: decoder_expected7
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 43 00 00 00
repeat: false
#
name: decoder_input8
type: raw
data: 25562 8445 4181 568 1543 570 505 572 1538 575 1535 567 508 569 1539 573 503 595 1514 567 508 600 1509 572 503 595 481 596 1513 568 507 601 1508 573 502 575 501 566 1543 570 506 571 504 573 1536 566 510 567 508 600 475 571 1539 573 502 575 1534 568 1542 571 505 572 1537 575 1534 568 1542 571
#
name: decoder_expected8
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 12 00 00 00
repeat: false
#
name: decoder_input9
type: raw
data: 25558 8470 4152 597 1513 600 476 601 1508 594 1515 598 478 599 1509 593 483 594 1515 598 478 599 1510 603 474 592 482 595 1514 599 477 600 1509 593 483 594 481 596 1513 600 476 601 1508 594 1515 598 478 599 476 601 474 593 1517 596 479 598 1512 601 474 603 472 594 1515 598 1511 602 1508 594
#
name: decoder_expected9
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 1A 00 00 00
repeat: false
#
name: decoder_input10
type: raw
data: 25587 8442 4179 601 1507 595 481 565 1544 600 1509 593 482 595 1513 568 507 570 1539 594 481 565 1544 600 476 570 505 593 1516 597 479 598 1511 591 484 593 481 575 1534 600 476 570 1539 595 480 597 478 599 476 570 505 593 1517 564 511 597 1511 602 474 572 1537 597 1513 600 1509 572 1537 565
#
name: decoder_expected10
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 0A 00 00 00
repeat: false
#
name: decoder_input11
type: raw
data: 25554 8474 4149 600 1510 603 472 594 1515 597 1512 601 475 602 1507 595 480 597 1513 599 475 602 1508 594 481 596 479 598 1512 601 474 603 1506 596 479 598 1512 601 1508 594 481 596 1513 599 476 601 474 603 472 594 481 596 480 597 478 599 1510 603 473 593 1515 597 1512 601 1509 603 1506 596
#
name: decoder_expected11
type: parsed_array
count: 1
#
protocol: Pioneer
address: AD 00 00 00
command: 0B 00 00 00
repeat: false
#
name: encoder_decoder_input1
type: parsed_array
count: 11
#
protocol: Pioneer
address: AF 00 00 00
command: 36 00 00 00
repeat: false
#
protocol: Pioneer
address: AF 00 00 00
command: 32 00 00 00
repeat: false
#
protocol: Pioneer
address: AF 00 00 00
command: 33 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 40 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 41 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 42 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 43 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 12 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 1A 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 0A 00 00 00
repeat: false
#
protocol: Pioneer
address: AD 00 00 00
command: 0B 00 00 00
repeat: false
#

View File

@@ -0,0 +1,41 @@
Filetype: Flipper NFC device
Version: 4
# Device type can be ISO14443-3A, ISO14443-3B, ISO14443-4A, ISO14443-4B, ISO15693-3, FeliCa, NTAG/Ultralight, Mifare Classic, Mifare DESFire, SLIX, ST25TB
Device type: SLIX
# UID is common for all formats
UID: E0 04 01 08 49 D0 DC 81
# ISO15693-3 specific data
# Data Storage Format Identifier
DSFID: 01
# Application Family Identifier
AFI: 3D
# IC Reference - Vendor specific meaning
IC Reference: 01
# Lock Bits
Lock DSFID: true
Lock AFI: true
# Number of memory blocks, valid range = 1..256
Block Count: 80
# Size of a single memory block, valid range = 01...20 (hex)
Block Size: 04
Data Content: 03 0A 82 ED 86 39 61 D2 03 14 1E 32 B6 CA 00 3C 36 42 0C 33 53 30 37 32 32 34 30 30 00 00 00 00 00 FF 04 01 01 00 00 00 A3 03 1E 00 26 00 00 00 00 00 0F 00 76 03 65 01 00 00 00 00 85 01 34 00 75 09 05 00 01 00 00 00 00 00 00 00 00 00 00 00 D7 FA 00 1C 9E 1C 67 27 00 30 30 30 30 30 30 30 30 30 30 00 00 00 97 25 55 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 8C 00 30 53 48 80 DE 00 00 00 00 F4 C3 58 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 F3 00 2C DD C3 3E 91 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E5 FF 00 01
# Block Security Status: 01 = locked, 00 = not locked
Security Status: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
# SLIX specific data
# SLIX capabilities field affects emulation modes. Possible options: Default, AcceptAllPasswords
Capabilities: AcceptAllPasswords
# Passwords are optional. If a password is omitted, a default value will be used
Password Read: 00 00 00 00
Password Write: 00 00 00 00
Password Privacy: 0F 0F 0F 0F
Password Destroy: 0F 0F 0F 0F
Password EAS: 00 00 00 00
# This is the card's secp128r1 elliptic curve signature. It can not be calculated without knowing NXP's private key.
Signature: A6 25 54 03 74 24 C4 38 36 F4 89 70 76 1A 72 27 54 D9 E7 3D 38 CB 4C 1B 3E FD 0E DF 8A F6 7E 3D
Privacy Mode: false
# Protection pointer configuration
Protection Pointer: 32
Protection Condition: 02
# SLIX Lock Bits
Lock EAS: true
Lock PPL: true

View File

@@ -0,0 +1,41 @@
Filetype: Flipper NFC device
Version: 4
# Device type can be ISO14443-3A, ISO14443-3B, ISO14443-4A, ISO14443-4B, ISO15693-3, FeliCa, NTAG/Ultralight, Mifare Classic, Mifare DESFire, SLIX, ST25TB
Device type: SLIX
# UID is common for all formats
UID: E0 04 01 08 49 D0 DC 81
# ISO15693-3 specific data
# Data Storage Format Identifier
DSFID: 01
# Application Family Identifier
AFI: 3D
# IC Reference - Vendor specific meaning
IC Reference: 01
# Lock Bits
Lock DSFID: true
Lock AFI: true
# Number of memory blocks, valid range = 1..256
Block Count: 80
# Size of a single memory block, valid range = 01...20 (hex)
Block Size: 04
Data Content: 03 0A 82 ED 86 39 61 D2 03 14 1E 32 B6 CA 00 3C 36 42 0C 33 53 30 37 32 32 34 30 30 00 00 00 00 00 FF 04 01 01 00 00 00 A3 03 1E 00 26 00 00 00 00 00 0F 00 76 03 65 01 00 00 00 00 85 01 34 00 75 09 05 00 01 00 00 00 00 00 00 00 00 00 00 00 D7 FA 00 1C 9E 1C 67 27 00 30 30 30 30 30 30 30 30 30 30 00 00 00 97 25 55 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 8C 00 30 53 48 80 DE 00 00 00 00 F4 C3 58 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 F3 00 2C DD C3 3E 91 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E5 FF 00 01
# Block Security Status: 01 = locked, 00 = not locked
Security Status: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
# SLIX specific data
# SLIX capabilities field affects emulation modes. Possible options: Default, AcceptAllPasswords
Capabilities: Default
# Passwords are optional. If a password is omitted, a default value will be used
Password Read: 00 00 00 00
Password Write: 00 00 00 00
Password Privacy: 0F 0F 0F 0F
Password Destroy: 0F 0F 0F 0F
Password EAS: 00 00 00 00
# This is the card's secp128r1 elliptic curve signature. It can not be calculated without knowing NXP's private key.
Signature: A6 25 54 03 74 24 C4 38 36 F4 89 70 76 1A 72 27 54 D9 E7 3D 38 CB 4C 1B 3E FD 0E DF 8A F6 7E 3D
Privacy Mode: false
# Protection pointer configuration
Protection Pointer: 32
Protection Condition: 02
# SLIX Lock Bits
Lock EAS: true
Lock PPL: true

View File

@@ -0,0 +1,39 @@
Filetype: Flipper NFC device
Version: 4
# Device type can be ISO14443-3A, ISO14443-3B, ISO14443-4A, ISO14443-4B, ISO15693-3, FeliCa, NTAG/Ultralight, Mifare Classic, Mifare DESFire, SLIX, ST25TB
Device type: SLIX
# UID is common for all formats
UID: E0 04 01 08 49 D0 DC 81
# ISO15693-3 specific data
# Data Storage Format Identifier
DSFID: 01
# Application Family Identifier
AFI: 3D
# IC Reference - Vendor specific meaning
IC Reference: 01
# Lock Bits
Lock DSFID: true
Lock AFI: true
# Number of memory blocks, valid range = 1..256
Block Count: 80
# Size of a single memory block, valid range = 01...20 (hex)
Block Size: 04
Data Content: 03 0A 82 ED 86 39 61 D2 03 14 1E 32 B6 CA 00 3C 36 42 0C 33 53 30 37 32 32 34 30 30 00 00 00 00 00 FF 04 01 01 00 00 00 A3 03 1E 00 26 00 00 00 00 00 0F 00 76 03 65 01 00 00 00 00 85 01 34 00 75 09 05 00 01 00 00 00 00 00 00 00 00 00 00 00 D7 FA 00 1C 9E 1C 67 27 00 30 30 30 30 30 30 30 30 30 30 00 00 00 97 25 55 08 00 00 00 00 00 00 00 00 00 00 00 00 00 00 32 8C 00 30 53 48 80 DE 00 00 00 00 F4 C3 58 2B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 11 F3 00 2C DD C3 3E 91 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 E5 FF 00 01
# Block Security Status: 01 = locked, 00 = not locked
Security Status: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
# SLIX specific data
# Passwords are optional. If a password is omitted, a default value will be used
Password Read: 00 00 00 00
Password Write: 00 00 00 00
Password Privacy: 0F 0F 0F 0F
Password Destroy: 0F 0F 0F 0F
Password EAS: 00 00 00 00
# This is the card's secp128r1 elliptic curve signature. It can not be calculated without knowing NXP's private key.
Signature: A6 25 54 03 74 24 C4 38 36 F4 89 70 76 1A 72 27 54 D9 E7 3D 38 CB 4C 1B 3E FD 0E DF 8A F6 7E 3D
Privacy Mode: false
# Protection pointer configuration
Protection Pointer: 32
Protection Condition: 02
# SLIX Lock Bits
Lock EAS: true
Lock PPL: true

View File

@@ -1,168 +0,0 @@
#include <stdio.h>
#include <furi.h>
#include <furi_hal.h>
#include "minunit_vars.h"
#include <notification/notification_messages.h>
#include <cli/cli.h>
#include <loader/loader.h>
#define TAG "UnitTests"
int run_minunit_test_furi();
int run_minunit_test_furi_hal();
int run_minunit_test_furi_hal_crypto();
int run_minunit_test_furi_string();
int run_minunit_test_infrared();
int run_minunit_test_rpc();
int run_minunit_test_manifest();
int run_minunit_test_flipper_format();
int run_minunit_test_flipper_format_string();
int run_minunit_test_stream();
int run_minunit_test_storage();
int run_minunit_test_subghz();
int run_minunit_test_dirwalk();
int run_minunit_test_power();
int run_minunit_test_protocol_dict();
int run_minunit_test_lfrfid_protocols();
int run_minunit_test_nfc();
int run_minunit_test_bit_lib();
int run_minunit_test_datetime();
int run_minunit_test_float_tools();
int run_minunit_test_bt();
int run_minunit_test_dialogs_file_browser_options();
int run_minunit_test_expansion();
typedef int (*UnitTestEntry)();
typedef struct {
const char* name;
const UnitTestEntry entry;
} UnitTest;
const UnitTest unit_tests[] = {
{.name = "furi", .entry = run_minunit_test_furi},
{.name = "furi_hal", .entry = run_minunit_test_furi_hal},
{.name = "furi_hal_crypto", .entry = run_minunit_test_furi_hal_crypto},
{.name = "furi_string", .entry = run_minunit_test_furi_string},
{.name = "storage", .entry = run_minunit_test_storage},
{.name = "stream", .entry = run_minunit_test_stream},
{.name = "dirwalk", .entry = run_minunit_test_dirwalk},
{.name = "manifest", .entry = run_minunit_test_manifest},
{.name = "flipper_format", .entry = run_minunit_test_flipper_format},
{.name = "flipper_format_string", .entry = run_minunit_test_flipper_format_string},
{.name = "rpc", .entry = run_minunit_test_rpc},
{.name = "subghz", .entry = run_minunit_test_subghz},
{.name = "infrared", .entry = run_minunit_test_infrared},
{.name = "nfc", .entry = run_minunit_test_nfc},
{.name = "power", .entry = run_minunit_test_power},
{.name = "protocol_dict", .entry = run_minunit_test_protocol_dict},
{.name = "lfrfid", .entry = run_minunit_test_lfrfid_protocols},
{.name = "bit_lib", .entry = run_minunit_test_bit_lib},
{.name = "datetime", .entry = run_minunit_test_datetime},
{.name = "float_tools", .entry = run_minunit_test_float_tools},
{.name = "bt", .entry = run_minunit_test_bt},
{.name = "dialogs_file_browser_options",
.entry = run_minunit_test_dialogs_file_browser_options},
{.name = "expansion", .entry = run_minunit_test_expansion},
};
void minunit_print_progress() {
static const char progress[] = {'\\', '|', '/', '-'};
static uint8_t progress_counter = 0;
static uint32_t last_tick = 0;
uint32_t current_tick = furi_get_tick();
if(current_tick - last_tick > 20) {
last_tick = current_tick;
printf("[%c]\033[3D", progress[++progress_counter % COUNT_OF(progress)]);
fflush(stdout);
}
}
void minunit_print_fail(const char* str) {
printf(_FURI_LOG_CLR_E "%s\r\n" _FURI_LOG_CLR_RESET, str);
}
void minunit_printf_warning(const char* format, ...) {
FuriString* str = furi_string_alloc();
va_list args;
va_start(args, format);
furi_string_vprintf(str, format, args);
va_end(args);
printf(_FURI_LOG_CLR_W "%s\r\n" _FURI_LOG_CLR_RESET, furi_string_get_cstr(str));
furi_string_free(str);
}
void unit_tests_cli(Cli* cli, FuriString* args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
minunit_run = 0;
minunit_assert = 0;
minunit_fail = 0;
minunit_status = 0;
Loader* loader = furi_record_open(RECORD_LOADER);
NotificationApp* notification = furi_record_open(RECORD_NOTIFICATION);
// TODO FL-3491: lock device while test running
if(loader_is_locked(loader)) {
printf("RPC: stop all applications to run tests\r\n");
notification_message(notification, &sequence_blink_magenta_100);
} else {
notification_message_block(notification, &sequence_set_only_blue_255);
uint32_t heap_before = memmgr_get_free_heap();
uint32_t cycle_counter = furi_get_tick();
for(size_t i = 0; i < COUNT_OF(unit_tests); i++) {
if(cli_cmd_interrupt_received(cli)) {
break;
}
if(furi_string_size(args)) {
if(furi_string_cmp_str(args, unit_tests[i].name) == 0) {
unit_tests[i].entry();
} else {
printf("Skipping %s\r\n", unit_tests[i].name);
}
} else {
unit_tests[i].entry();
}
}
if(minunit_run != 0) {
printf("\r\nFailed tests: %u\r\n", minunit_fail);
// Time report
cycle_counter = (furi_get_tick() - cycle_counter);
printf("Consumed: %lu ms\r\n", cycle_counter);
// Wait for tested services and apps to deallocate memory
furi_delay_ms(200);
uint32_t heap_after = memmgr_get_free_heap();
printf("Leaked: %ld\r\n", heap_before - heap_after);
// Final Report
if(minunit_fail == 0) {
notification_message(notification, &sequence_success);
printf("Status: PASSED\r\n");
} else {
notification_message(notification, &sequence_error);
printf("Status: FAILED\r\n");
}
}
}
furi_record_close(RECORD_NOTIFICATION);
furi_record_close(RECORD_LOADER);
}
void unit_tests_on_system_start() {
#ifdef SRV_CLI
Cli* cli = furi_record_open(RECORD_CLI);
// We need to launch apps from tests, so we cannot lock loader
cli_add_command(cli, "unit_tests", CliCommandFlagParallelSafe, unit_tests_cli, NULL);
furi_record_close(RECORD_CLI);
#endif
}

View File

@@ -0,0 +1,216 @@
#include "test_runner.h"
#include "tests/test_api.h"
#include <cli/cli.h>
#include <toolbox/path.h>
#include <loader/loader.h>
#include <storage/storage.h>
#include <notification/notification_messages.h>
#include <loader/firmware_api/firmware_api.h>
#include <flipper_application/flipper_application.h>
#include <flipper_application/api_hashtable/api_hashtable.h>
#include <flipper_application/plugins/composite_resolver.h>
extern const ElfApiInterface* const unit_tests_api_interface;
#define TAG "TestRunner"
#define PLUGINS_PATH "/ext/apps_data/unit_tests/plugins"
struct TestRunner {
Storage* storage;
Loader* loader;
NotificationApp* notification;
// Temporary used things
Cli* cli;
FuriString* args;
// ELF related stuff
CompositeApiResolver* composite_resolver;
// Report data
int minunit_run;
int minunit_assert;
int minunit_fail;
int minunit_status;
};
TestRunner* test_runner_alloc(Cli* cli, FuriString* args) {
TestRunner* instance = malloc(sizeof(TestRunner));
instance->storage = furi_record_open(RECORD_STORAGE);
instance->loader = furi_record_open(RECORD_LOADER);
instance->notification = furi_record_open(RECORD_NOTIFICATION);
instance->cli = cli;
instance->args = args;
instance->composite_resolver = composite_api_resolver_alloc();
composite_api_resolver_add(instance->composite_resolver, firmware_api_interface);
composite_api_resolver_add(instance->composite_resolver, unit_tests_api_interface);
return instance;
}
void test_runner_free(TestRunner* instance) {
furi_assert(instance);
composite_api_resolver_free(instance->composite_resolver);
furi_record_close(RECORD_NOTIFICATION);
instance->notification = NULL;
furi_record_close(RECORD_LOADER);
instance->loader = NULL;
furi_record_close(RECORD_STORAGE);
instance->storage = NULL;
free(instance);
}
static bool test_runner_run_plugin(TestRunner* instance, const char* path) {
furi_assert(instance);
FURI_LOG_D(TAG, "Loading %s", path);
FlipperApplication* lib = flipper_application_alloc(
instance->storage, composite_api_resolver_get(instance->composite_resolver));
bool result = false;
instance->minunit_fail = -1;
do {
FlipperApplicationPreloadStatus preload_res = flipper_application_preload(lib, path);
if(preload_res != FlipperApplicationPreloadStatusSuccess) {
FURI_LOG_E(TAG, "Failed to preload %s, %d", path, preload_res);
break;
}
if(!flipper_application_is_plugin(lib)) {
FURI_LOG_E(TAG, "Not a plugin %s", path);
break;
}
FlipperApplicationLoadStatus load_status = flipper_application_map_to_memory(lib);
if(load_status != FlipperApplicationLoadStatusSuccess) {
FURI_LOG_E(TAG, "Failed to load %s", path);
break;
}
const FlipperAppPluginDescriptor* app_descriptor =
flipper_application_plugin_get_descriptor(lib);
const TestApi* test = app_descriptor->entry_point;
instance->minunit_fail = test->run();
instance->minunit_run += test->get_minunit_run();
instance->minunit_assert += test->get_minunit_assert();
instance->minunit_status += test->get_minunit_status();
result = (instance->minunit_fail == 0);
} while(false);
flipper_application_free(lib);
return result;
}
static void test_runner_run_internal(TestRunner* instance) {
furi_assert(instance);
char file_name_buffer[256];
FuriString* file_name = furi_string_alloc();
FuriString* file_basename = furi_string_alloc();
File* directory = storage_file_alloc(instance->storage);
do {
if(!storage_dir_open(directory, PLUGINS_PATH)) {
FURI_LOG_E(TAG, "Failed to open directory %s", PLUGINS_PATH);
break;
}
while(true) {
if(cli_cmd_interrupt_received(instance->cli)) {
break;
}
if(!storage_dir_read(directory, NULL, file_name_buffer, sizeof(file_name_buffer))) {
break;
}
furi_string_set(file_name, file_name_buffer);
if(!furi_string_end_with_str(file_name, ".fal")) {
continue;
}
path_concat(PLUGINS_PATH, file_name_buffer, file_name);
path_extract_filename(file_name, file_basename, true);
const char* file_basename_cstr = furi_string_get_cstr(file_basename);
bool result = true;
if(furi_string_size(instance->args)) {
if(furi_string_cmp_str(instance->args, file_basename_cstr) == 0) {
result = test_runner_run_plugin(instance, furi_string_get_cstr(file_name));
} else {
printf("Skipping %s\r\n", file_basename_cstr);
}
} else {
result = test_runner_run_plugin(instance, furi_string_get_cstr(file_name));
}
if(!result) {
printf("Failed to execute test: %s\r\n", file_basename_cstr);
break;
}
}
} while(false);
storage_dir_close(directory);
storage_file_free(directory);
furi_string_free(file_name);
furi_string_free(file_basename);
}
void test_runner_run(TestRunner* instance) {
furi_assert(instance);
// TODO FL-3491: lock device while test running
if(loader_is_locked(instance->loader)) {
printf("RPC: stop all applications to run tests\r\n");
notification_message(instance->notification, &sequence_blink_magenta_100);
} else {
notification_message_block(instance->notification, &sequence_set_only_blue_255);
uint32_t heap_before = memmgr_get_free_heap();
uint32_t cycle_counter = furi_get_tick();
test_runner_run_internal(instance);
if(instance->minunit_run != 0) {
printf("\r\nFailed tests: %d\r\n", instance->minunit_fail);
// Time report
cycle_counter = (furi_get_tick() - cycle_counter);
printf("Consumed: %lu ms\r\n", cycle_counter);
// Wait for tested services and apps to deallocate memory
furi_delay_ms(200);
uint32_t heap_after = memmgr_get_free_heap();
printf("Leaked: %ld\r\n", heap_before - heap_after);
// Final Report
if(instance->minunit_fail == 0) {
notification_message(instance->notification, &sequence_success);
printf("Status: PASSED\r\n");
} else {
notification_message(instance->notification, &sequence_error);
printf("Status: FAILED\r\n");
}
}
}
}

View File

@@ -0,0 +1,12 @@
#pragma once
#include <furi.h>
typedef struct TestRunner TestRunner;
typedef struct Cli Cli;
TestRunner* test_runner_alloc(Cli* cli, FuriString* args);
void test_runner_free(TestRunner* isntance);
void test_runner_run(TestRunner* isntance);

View File

@@ -1,5 +1,5 @@
#include <furi.h> #include <furi.h>
#include "../minunit.h" #include "../test.h"
#include <bit_lib/bit_lib.h> #include <bit_lib/bit_lib.h>
MU_TEST(test_bit_lib_increment_index) { MU_TEST(test_bit_lib_increment_index) {
@@ -734,7 +734,9 @@ MU_TEST_SUITE(test_bit_lib) {
MU_RUN_TEST(test_bit_lib_bytes_to_num_bcd); MU_RUN_TEST(test_bit_lib_bytes_to_num_bcd);
} }
int run_minunit_test_bit_lib() { int run_minunit_test_bit_lib(void) {
MU_RUN_SUITE(test_bit_lib); MU_RUN_SUITE(test_bit_lib);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_bit_lib)

View File

@@ -1,6 +1,6 @@
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include "../minunit.h" #include "../test.h"
#include <bt/bt_service/bt_keys_storage.h> #include <bt/bt_service/bt_keys_storage.h>
#include <storage/storage.h> #include <storage/storage.h>
@@ -17,7 +17,7 @@ typedef struct {
BtTest* bt_test = NULL; BtTest* bt_test = NULL;
void bt_test_alloc() { void bt_test_alloc(void) {
bt_test = malloc(sizeof(BtTest)); bt_test = malloc(sizeof(BtTest));
bt_test->storage = furi_record_open(RECORD_STORAGE); bt_test->storage = furi_record_open(RECORD_STORAGE);
bt_test->nvm_ram_buff_dut = malloc(BT_TEST_NVM_RAM_BUFF_SIZE); bt_test->nvm_ram_buff_dut = malloc(BT_TEST_NVM_RAM_BUFF_SIZE);
@@ -27,7 +27,7 @@ void bt_test_alloc() {
bt_test->bt_keys_storage, bt_test->nvm_ram_buff_dut, BT_TEST_NVM_RAM_BUFF_SIZE); bt_test->bt_keys_storage, bt_test->nvm_ram_buff_dut, BT_TEST_NVM_RAM_BUFF_SIZE);
} }
void bt_test_free() { void bt_test_free(void) {
furi_check(bt_test); furi_check(bt_test);
free(bt_test->nvm_ram_buff_ref); free(bt_test->nvm_ram_buff_ref);
free(bt_test->nvm_ram_buff_dut); free(bt_test->nvm_ram_buff_dut);
@@ -37,7 +37,7 @@ void bt_test_free() {
bt_test = NULL; bt_test = NULL;
} }
static void bt_test_keys_storage_profile() { static void bt_test_keys_storage_profile(void) {
// Emulate nvm change on initial connection // Emulate nvm change on initial connection
const int nvm_change_size_on_connection = 88; const int nvm_change_size_on_connection = 88;
for(size_t i = 0; i < nvm_change_size_on_connection; i++) { for(size_t i = 0; i < nvm_change_size_on_connection; i++) {
@@ -82,7 +82,7 @@ static void bt_test_keys_storage_profile() {
"Wrong buffer loaded"); "Wrong buffer loaded");
} }
static void bt_test_keys_remove_test_file() { static void bt_test_keys_remove_test_file(void) {
mu_assert( mu_assert(
storage_simply_remove(bt_test->storage, BT_TEST_KEY_STORAGE_FILE_PATH), storage_simply_remove(bt_test->storage, BT_TEST_KEY_STORAGE_FILE_PATH),
"Can't remove test file"); "Can't remove test file");
@@ -104,7 +104,9 @@ MU_TEST_SUITE(test_bt) {
bt_test_free(); bt_test_free();
} }
int run_minunit_test_bt() { int run_minunit_test_bt(void) {
MU_RUN_SUITE(test_bt); MU_RUN_SUITE(test_bt);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_bt)

View File

@@ -0,0 +1,42 @@
#include "../test.h"
#include "../minunit_vars.h"
#include <furi.h>
void minunit_print_progress(void) {
static const char progress[] = {'\\', '|', '/', '-'};
static uint8_t progress_counter = 0;
static uint32_t last_tick = 0;
uint32_t current_tick = furi_get_tick();
if(current_tick - last_tick > 20) {
last_tick = current_tick;
printf("[%c]\033[3D", progress[++progress_counter % COUNT_OF(progress)]);
fflush(stdout);
}
}
void minunit_print_fail(const char* str) {
printf(_FURI_LOG_CLR_E "%s\r\n" _FURI_LOG_CLR_RESET, str);
}
void minunit_printf_warning(const char* format, ...) {
FuriString* str = furi_string_alloc();
va_list args;
va_start(args, format);
furi_string_vprintf(str, format, args);
va_end(args);
printf(_FURI_LOG_CLR_W "%s\r\n" _FURI_LOG_CLR_RESET, furi_string_get_cstr(str));
furi_string_free(str);
}
int get_minunit_run(void) {
return minunit_run;
}
int get_minunit_assert(void) {
return minunit_assert;
}
int get_minunit_status(void) {
return minunit_status;
}

View File

@@ -0,0 +1,159 @@
#include "../test.h"
#include <toolbox/compress.h>
#include <furi.h>
#include <furi_hal.h>
#include <furi_hal_random.h>
#include <storage/storage.h>
#include <stdint.h>
#define COMPRESS_UNIT_TESTS_PATH(path) EXT_PATH("unit_tests/compress/" path)
static void compress_test_reference_comp_decomp() {
Storage* storage = furi_record_open(RECORD_STORAGE);
File* compressed_file = storage_file_alloc(storage);
File* decompressed_file = storage_file_alloc(storage);
mu_assert(
storage_file_open(
compressed_file,
COMPRESS_UNIT_TESTS_PATH("compressed.bin"),
FSAM_READ,
FSOM_OPEN_EXISTING),
"Failed to open compressed file");
mu_assert(
storage_file_open(
decompressed_file,
COMPRESS_UNIT_TESTS_PATH("uncompressed.bin"),
FSAM_READ,
FSOM_OPEN_EXISTING),
"Failed to open decompressed file");
uint64_t compressed_ref_size = storage_file_size(compressed_file);
uint64_t decompressed_ref_size = storage_file_size(decompressed_file);
mu_assert(compressed_ref_size > 0 && decompressed_ref_size > 0, "Invalid file sizes");
uint8_t* compressed_ref_buff = malloc(compressed_ref_size);
uint8_t* decompressed_ref_buff = malloc(decompressed_ref_size);
mu_assert(
storage_file_read(compressed_file, compressed_ref_buff, compressed_ref_size) ==
compressed_ref_size,
"Failed to read compressed file");
mu_assert(
storage_file_read(decompressed_file, decompressed_ref_buff, decompressed_ref_size) ==
decompressed_ref_size,
"Failed to read decompressed file");
storage_file_free(compressed_file);
storage_file_free(decompressed_file);
furi_record_close(RECORD_STORAGE);
uint8_t* temp_buffer = malloc(1024);
Compress* comp = compress_alloc(1024);
size_t encoded_size = 0;
mu_assert(
compress_encode(
comp, decompressed_ref_buff, decompressed_ref_size, temp_buffer, 1024, &encoded_size),
"Compress failed");
mu_assert(encoded_size == compressed_ref_size, "Encoded size is not equal to reference size");
mu_assert(
memcmp(temp_buffer, compressed_ref_buff, compressed_ref_size) == 0,
"Encoded buffer is not equal to reference");
size_t decoded_size = 0;
mu_assert(
compress_decode(
comp, compressed_ref_buff, compressed_ref_size, temp_buffer, 1024, &decoded_size),
"Decompress failed");
mu_assert(
decoded_size == decompressed_ref_size, "Decoded size is not equal to reference size");
mu_assert(
memcmp(temp_buffer, decompressed_ref_buff, decompressed_ref_size) == 0,
"Decoded buffer is not equal to reference");
compress_free(comp);
free(temp_buffer);
free(compressed_ref_buff);
free(decompressed_ref_buff);
}
static void compress_test_random_comp_decomp() {
static const size_t src_buffer_size = 1024;
static const size_t encoded_buffer_size = 1024;
static const size_t small_buffer_size = src_buffer_size / 32;
// We only fill half of the buffer with random data, so if anything goes wrong, there's no overflow
static const size_t src_data_size = src_buffer_size / 2;
Compress* comp = compress_alloc(src_buffer_size);
uint8_t* src_buff = malloc(src_buffer_size);
uint8_t* encoded_buff = malloc(encoded_buffer_size);
uint8_t* decoded_buff = malloc(src_buffer_size);
uint8_t* small_buff = malloc(small_buffer_size);
furi_hal_random_fill_buf(src_buff, src_data_size);
size_t encoded_size = 0;
mu_assert(
compress_encode(
comp, src_buff, src_data_size, encoded_buff, encoded_buffer_size, &encoded_size),
"Compress failed");
mu_assert(encoded_size > 0, "Encoded size is zero");
size_t small_enc_dec_size = 0;
mu_assert(
compress_encode(
comp, src_buff, src_data_size, small_buff, small_buffer_size, &small_enc_dec_size) ==
false,
"Compress to small buffer failed");
size_t decoded_size = 0;
mu_assert(
compress_decode(
comp, encoded_buff, encoded_size, decoded_buff, src_buffer_size, &decoded_size),
"Decompress failed");
mu_assert(decoded_size == src_data_size, "Decoded size is not equal to source size");
mu_assert(
memcmp(src_buff, decoded_buff, src_data_size) == 0,
"Decoded buffer is not equal to source");
mu_assert(
compress_decode(
comp, encoded_buff, encoded_size, small_buff, small_buffer_size, &small_enc_dec_size) ==
false,
"Decompress to small buffer failed");
free(small_buff);
free(src_buff);
free(encoded_buff);
free(decoded_buff);
compress_free(comp);
}
MU_TEST_SUITE(test_compress) {
MU_RUN_TEST(compress_test_random_comp_decomp);
MU_RUN_TEST(compress_test_reference_comp_decomp);
}
int run_minunit_test_compress(void) {
MU_RUN_SUITE(test_compress);
return MU_EXIT_CODE;
}
TEST_API_DEFINE(run_minunit_test_compress)

View File

@@ -1,5 +1,5 @@
#include <furi.h> #include <furi.h>
#include "../minunit.h" #include "../test.h"
#include <datetime/datetime.h> #include <datetime/datetime.h>
@@ -112,7 +112,7 @@ MU_TEST_SUITE(test_datetime_validate_datetime) {
MU_TEST(test_datetime_timestamp_to_datetime_min) { MU_TEST(test_datetime_timestamp_to_datetime_min) {
uint32_t test_value = 0; uint32_t test_value = 0;
DateTime min_datetime_expected = {0, 0, 0, 1, 1, 1970, 0}; DateTime min_datetime_expected = {0, 0, 0, 1, 1, 1970, 4};
DateTime result = {0}; DateTime result = {0};
datetime_timestamp_to_datetime(test_value, &result); datetime_timestamp_to_datetime(test_value, &result);
@@ -122,7 +122,7 @@ MU_TEST(test_datetime_timestamp_to_datetime_min) {
MU_TEST(test_datetime_timestamp_to_datetime_max) { MU_TEST(test_datetime_timestamp_to_datetime_max) {
uint32_t test_value = UINT32_MAX; uint32_t test_value = UINT32_MAX;
DateTime max_datetime_expected = {6, 28, 15, 7, 2, 2106, 0}; DateTime max_datetime_expected = {6, 28, 15, 7, 2, 2106, 7};
DateTime result = {0}; DateTime result = {0};
datetime_timestamp_to_datetime(test_value, &result); datetime_timestamp_to_datetime(test_value, &result);
@@ -141,10 +141,26 @@ MU_TEST(test_datetime_timestamp_to_datetime_to_timestamp) {
mu_assert_int_eq(test_value, result); mu_assert_int_eq(test_value, result);
} }
MU_TEST(test_datetime_timestamp_to_datetime_weekday) {
uint32_t test_value = 1709748421; // Wed Mar 06 18:07:01 2024 UTC
DateTime datetime = {0};
datetime_timestamp_to_datetime(test_value, &datetime);
mu_assert_int_eq(datetime.hour, 18);
mu_assert_int_eq(datetime.minute, 7);
mu_assert_int_eq(datetime.second, 1);
mu_assert_int_eq(datetime.day, 6);
mu_assert_int_eq(datetime.month, 3);
mu_assert_int_eq(datetime.weekday, 3);
mu_assert_int_eq(datetime.year, 2024);
}
MU_TEST_SUITE(test_datetime_timestamp_to_datetime_suite) { MU_TEST_SUITE(test_datetime_timestamp_to_datetime_suite) {
MU_RUN_TEST(test_datetime_timestamp_to_datetime_min); MU_RUN_TEST(test_datetime_timestamp_to_datetime_min);
MU_RUN_TEST(test_datetime_timestamp_to_datetime_max); MU_RUN_TEST(test_datetime_timestamp_to_datetime_max);
MU_RUN_TEST(test_datetime_timestamp_to_datetime_to_timestamp); MU_RUN_TEST(test_datetime_timestamp_to_datetime_to_timestamp);
MU_RUN_TEST(test_datetime_timestamp_to_datetime_weekday);
} }
MU_TEST(test_datetime_datetime_to_timestamp_min) { MU_TEST(test_datetime_datetime_to_timestamp_min) {
@@ -166,10 +182,12 @@ MU_TEST_SUITE(test_datetime_datetime_to_timestamp_suite) {
MU_RUN_TEST(test_datetime_datetime_to_timestamp_max); MU_RUN_TEST(test_datetime_datetime_to_timestamp_max);
} }
int run_minunit_test_datetime() { int run_minunit_test_datetime(void) {
MU_RUN_SUITE(test_datetime_timestamp_to_datetime_suite); MU_RUN_SUITE(test_datetime_timestamp_to_datetime_suite);
MU_RUN_SUITE(test_datetime_datetime_to_timestamp_suite); MU_RUN_SUITE(test_datetime_datetime_to_timestamp_suite);
MU_RUN_SUITE(test_datetime_validate_datetime); MU_RUN_SUITE(test_datetime_validate_datetime);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_datetime)

View File

@@ -1,6 +1,6 @@
#include <dialogs/dialogs.h> #include <dialogs/dialogs.h>
#include "../minunit.h" #include "../test.h"
MU_TEST(test_dialog_file_browser_set_basic_options_should_init_all_fields) { MU_TEST(test_dialog_file_browser_set_basic_options_should_init_all_fields) {
mu_assert( mu_assert(
@@ -25,8 +25,10 @@ MU_TEST_SUITE(dialogs_file_browser_options) {
MU_RUN_TEST(test_dialog_file_browser_set_basic_options_should_init_all_fields); MU_RUN_TEST(test_dialog_file_browser_set_basic_options_should_init_all_fields);
} }
int run_minunit_test_dialogs_file_browser_options() { int run_minunit_test_dialogs_file_browser_options(void) {
MU_RUN_SUITE(dialogs_file_browser_options); MU_RUN_SUITE(dialogs_file_browser_options);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_dialogs_file_browser_options)

View File

@@ -1,4 +1,4 @@
#include "../minunit.h" #include "../test.h"
#include <furi.h> #include <furi.h>
#include <m-dict.h> #include <m-dict.h>
#include <toolbox/dir_walk.h> #include <toolbox/dir_walk.h>
@@ -266,7 +266,9 @@ MU_TEST_SUITE(test_dirwalk_suite) {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
int run_minunit_test_dirwalk() { int run_minunit_test_dirwalk(void) {
MU_RUN_SUITE(test_dirwalk_suite); MU_RUN_SUITE(test_dirwalk_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_dirwalk)

View File

@@ -1,4 +1,4 @@
#include "../minunit.h" #include "../test.h"
#include <furi.h> #include <furi.h>
#include <furi_hal_random.h> #include <furi_hal_random.h>
@@ -194,7 +194,9 @@ MU_TEST_SUITE(test_expansion_suite) {
MU_RUN_TEST(test_expansion_garbage_input); MU_RUN_TEST(test_expansion_garbage_input);
} }
int run_minunit_test_expansion() { int run_minunit_test_expansion(void) {
MU_RUN_SUITE(test_expansion_suite); MU_RUN_SUITE(test_expansion_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_expansion)

View File

@@ -2,7 +2,7 @@
#include <flipper_format/flipper_format.h> #include <flipper_format/flipper_format.h>
#include <flipper_format/flipper_format_i.h> #include <flipper_format/flipper_format_i.h>
#include <toolbox/stream/stream.h> #include <toolbox/stream/stream.h>
#include "../minunit.h" #include "../test.h"
#define TEST_DIR TEST_DIR_NAME "/" #define TEST_DIR TEST_DIR_NAME "/"
#define TEST_DIR_NAME EXT_PATH("unit_tests_tmp") #define TEST_DIR_NAME EXT_PATH("unit_tests_tmp")
@@ -103,14 +103,14 @@ static bool storage_write_string(const char* path, const char* data) {
return result; return result;
} }
static void tests_setup() { static void tests_setup(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data"); mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data");
mu_assert(storage_simply_mkdir(storage, TEST_DIR_NAME), "Cannot create dir"); mu_assert(storage_simply_mkdir(storage, TEST_DIR_NAME), "Cannot create dir");
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
static void tests_teardown() { static void tests_teardown(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data"); mu_assert(storage_simply_remove_recursive(storage, TEST_DIR_NAME), "Cannot clean data");
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@@ -545,7 +545,9 @@ MU_TEST_SUITE(flipper_format) {
tests_teardown(); tests_teardown();
} }
int run_minunit_test_flipper_format() { int run_minunit_test_flipper_format(void) {
MU_RUN_SUITE(flipper_format); MU_RUN_SUITE(flipper_format);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_flipper_format)

View File

@@ -3,7 +3,7 @@
#include <flipper_format/flipper_format_i.h> #include <flipper_format/flipper_format_i.h>
#include <toolbox/stream/stream.h> #include <toolbox/stream/stream.h>
#include <storage/storage.h> #include <storage/storage.h>
#include "../minunit.h" #include "../test.h"
static const char* test_filetype = "Flipper Format test"; static const char* test_filetype = "Flipper Format test";
static const uint32_t test_version = 666; static const uint32_t test_version = 666;
@@ -331,7 +331,9 @@ MU_TEST_SUITE(flipper_format_string_suite) {
MU_RUN_TEST(flipper_format_file_test); MU_RUN_TEST(flipper_format_file_test);
} }
int run_minunit_test_flipper_format_string() { int run_minunit_test_flipper_format_string(void) {
MU_RUN_SUITE(flipper_format_string_suite); MU_RUN_SUITE(flipper_format_string_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_flipper_format_string)

View File

@@ -1,7 +1,7 @@
#include <float.h> #include <float.h>
#include <float_tools.h> #include <float_tools.h>
#include "../minunit.h" #include "../test.h"
MU_TEST(float_tools_equal_test) { MU_TEST(float_tools_equal_test) {
mu_check(float_is_equal(FLT_MAX, FLT_MAX)); mu_check(float_is_equal(FLT_MAX, FLT_MAX));
@@ -54,7 +54,9 @@ MU_TEST_SUITE(float_tools_suite) {
MU_RUN_TEST(float_tools_equal_test); MU_RUN_TEST(float_tools_equal_test);
} }
int run_minunit_test_float_tools() { int run_minunit_test_float_tools(void) {
MU_RUN_SUITE(float_tools_suite); MU_RUN_SUITE(float_tools_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_float_tools)

View File

@@ -1,10 +1,10 @@
#include "../minunit.h" #include "../test.h"
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>
void test_furi_memmgr() { void test_furi_memmgr(void) {
void* ptr; void* ptr;
// allocate memory case // allocate memory case

View File

@@ -1,7 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <furi.h> #include <furi.h>
#include "../minunit.h" #include "../test.h"
const uint32_t context_value = 0xdeadbeef; const uint32_t context_value = 0xdeadbeef;
const uint32_t notify_value_0 = 0x12345678; const uint32_t notify_value_0 = 0x12345678;
@@ -15,7 +15,7 @@ void test_pubsub_handler(const void* arg, void* ctx) {
pubsub_context_value = *(uint32_t*)ctx; pubsub_context_value = *(uint32_t*)ctx;
} }
void test_furi_pubsub() { void test_furi_pubsub(void) {
FuriPubSub* test_pubsub = NULL; FuriPubSub* test_pubsub = NULL;
FuriPubSubSubscription* test_pubsub_subscription = NULL; FuriPubSubSubscription* test_pubsub_subscription = NULL;

View File

@@ -1,11 +1,11 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <furi.h> #include <furi.h>
#include "../minunit.h" #include "../test.h"
#define TEST_RECORD_NAME "test/holding" #define TEST_RECORD_NAME "test/holding"
void test_furi_create_open() { void test_furi_create_open(void) {
// Test that record does not exist // Test that record does not exist
mu_check(furi_record_exists(TEST_RECORD_NAME) == false); mu_check(furi_record_exists(TEST_RECORD_NAME) == false);

View File

@@ -1,14 +1,14 @@
#include <stdio.h> #include <stdio.h>
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include "../minunit.h" #include "../test.h"
// v2 tests // v2 tests
void test_furi_create_open(); void test_furi_create_open(void);
void test_furi_concurrent_access(); void test_furi_concurrent_access(void);
void test_furi_pubsub(); void test_furi_pubsub(void);
void test_furi_memmgr(); void test_furi_memmgr(void);
static int foo = 0; static int foo = 0;
@@ -50,8 +50,10 @@ MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(mu_test_furi_memmgr); MU_RUN_TEST(mu_test_furi_memmgr);
} }
int run_minunit_test_furi() { int run_minunit_test_furi(void) {
MU_RUN_SUITE(test_suite); MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_furi)

View File

@@ -4,7 +4,7 @@
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include <lp5562_reg.h> #include <lp5562_reg.h>
#include "../minunit.h" #include "../test.h"
#include <stdlib.h> #include <stdlib.h>
#define DATA_SIZE 4 #define DATA_SIZE 4
@@ -14,19 +14,19 @@
#define EEPROM_PAGE_SIZE 16 #define EEPROM_PAGE_SIZE 16
#define EEPROM_WRITE_DELAY_MS 6 #define EEPROM_WRITE_DELAY_MS 6
static void furi_hal_i2c_int_setup() { static void furi_hal_i2c_int_setup(void) {
furi_hal_i2c_acquire(&furi_hal_i2c_handle_power); furi_hal_i2c_acquire(&furi_hal_i2c_handle_power);
} }
static void furi_hal_i2c_int_teardown() { static void furi_hal_i2c_int_teardown(void) {
furi_hal_i2c_release(&furi_hal_i2c_handle_power); furi_hal_i2c_release(&furi_hal_i2c_handle_power);
} }
static void furi_hal_i2c_ext_setup() { static void furi_hal_i2c_ext_setup(void) {
furi_hal_i2c_acquire(&furi_hal_i2c_handle_external); furi_hal_i2c_acquire(&furi_hal_i2c_handle_external);
} }
static void furi_hal_i2c_ext_teardown() { static void furi_hal_i2c_ext_teardown(void) {
furi_hal_i2c_release(&furi_hal_i2c_handle_external); furi_hal_i2c_release(&furi_hal_i2c_handle_external);
} }
@@ -227,8 +227,10 @@ MU_TEST_SUITE(furi_hal_i2c_ext_suite) {
MU_RUN_TEST(furi_hal_i2c_ext_eeprom); MU_RUN_TEST(furi_hal_i2c_ext_eeprom);
} }
int run_minunit_test_furi_hal() { int run_minunit_test_furi_hal(void) {
MU_RUN_SUITE(furi_hal_i2c_int_suite); MU_RUN_SUITE(furi_hal_i2c_int_suite);
MU_RUN_SUITE(furi_hal_i2c_ext_suite); MU_RUN_SUITE(furi_hal_i2c_ext_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_furi_hal)

View File

@@ -1,7 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include "../minunit.h" #include "../test.h"
static const uint8_t key_ctr_1[32] = { static const uint8_t key_ctr_1[32] = {
0x77, 0x6B, 0xEF, 0xF2, 0x85, 0x1D, 0xB0, 0x6F, 0x4C, 0x8A, 0x05, 0x42, 0xC8, 0x69, 0x6F, 0x6C, 0x77, 0x6B, 0xEF, 0xF2, 0x85, 0x1D, 0xB0, 0x6F, 0x4C, 0x8A, 0x05, 0x42, 0xC8, 0x69, 0x6F, 0x6C,
@@ -409,16 +409,16 @@ static const uint8_t tv_gcm_tag_4[16] = {
0x1B, 0x1B,
}; };
static void furi_hal_crypto_ctr_setup() { static void furi_hal_crypto_ctr_setup(void) {
} }
static void furi_hal_crypto_ctr_teardown() { static void furi_hal_crypto_ctr_teardown(void) {
} }
static void furi_hal_crypto_gcm_setup() { static void furi_hal_crypto_gcm_setup(void) {
} }
static void furi_hal_crypto_gcm_teardown() { static void furi_hal_crypto_gcm_teardown(void) {
} }
MU_TEST(furi_hal_crypto_ctr_1) { MU_TEST(furi_hal_crypto_ctr_1) {
@@ -595,8 +595,10 @@ MU_TEST_SUITE(furi_hal_crypto_gcm_test) {
MU_RUN_TEST(furi_hal_crypto_gcm_4); MU_RUN_TEST(furi_hal_crypto_gcm_4);
} }
int run_minunit_test_furi_hal_crypto() { int run_minunit_test_furi_hal_crypto(void) {
MU_RUN_SUITE(furi_hal_crypto_ctr_test); MU_RUN_SUITE(furi_hal_crypto_ctr_test);
MU_RUN_SUITE(furi_hal_crypto_gcm_test); MU_RUN_SUITE(furi_hal_crypto_gcm_test);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_furi_hal_crypto)

View File

@@ -1,5 +1,5 @@
#include <furi.h> #include <furi.h>
#include "../minunit.h" #include "../test.h"
static void test_setup(void) { static void test_setup(void) {
} }
@@ -462,8 +462,10 @@ MU_TEST_SUITE(test_suite) {
MU_RUN_TEST(mu_test_furi_string_utf8); MU_RUN_TEST(mu_test_furi_string_utf8);
} }
int run_minunit_test_furi_string() { int run_minunit_test_furi_string(void) {
MU_RUN_SUITE(test_suite); MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_furi_string)

View File

@@ -2,7 +2,7 @@
#include <flipper_format.h> #include <flipper_format.h>
#include <infrared.h> #include <infrared.h>
#include <common/infrared_common_i.h> #include <common/infrared_common_i.h>
#include "../minunit.h" #include "../test.h"
#define IR_TEST_FILES_DIR EXT_PATH("unit_tests/infrared/") #define IR_TEST_FILES_DIR EXT_PATH("unit_tests/infrared/")
#define IR_TEST_FILE_PREFIX "test_" #define IR_TEST_FILE_PREFIX "test_"
@@ -17,7 +17,7 @@ typedef struct {
static InfraredTest* test; static InfraredTest* test;
static void infrared_test_alloc() { static void infrared_test_alloc(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
test = malloc(sizeof(InfraredTest)); test = malloc(sizeof(InfraredTest));
test->decoder_handler = infrared_alloc_decoder(); test->decoder_handler = infrared_alloc_decoder();
@@ -26,7 +26,7 @@ static void infrared_test_alloc() {
test->file_path = furi_string_alloc(); test->file_path = furi_string_alloc();
} }
static void infrared_test_free() { static void infrared_test_free(void) {
furi_check(test); furi_check(test);
infrared_free_decoder(test->decoder_handler); infrared_free_decoder(test->decoder_handler);
infrared_free_encoder(test->encoder_handler); infrared_free_encoder(test->encoder_handler);
@@ -426,53 +426,53 @@ MU_TEST(infrared_test_decoder_mixed) {
infrared_test_run_decoder(InfraredProtocolSIRC, 3); infrared_test_run_decoder(InfraredProtocolSIRC, 3);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1); infrared_test_run_decoder(InfraredProtocolKaseikyo, 1);
infrared_test_run_decoder(InfraredProtocolRCA, 1); infrared_test_run_decoder(InfraredProtocolRCA, 1);
infrared_test_run_decoder(InfraredProtocolPioneer, 6);
} }
MU_TEST(infrared_test_decoder_nec) { MU_TEST(infrared_test_decoder_nec) {
infrared_test_run_decoder(InfraredProtocolNEC, 1); for(uint32_t i = 1; i <= 3; ++i) {
infrared_test_run_decoder(InfraredProtocolNEC, 2); infrared_test_run_decoder(InfraredProtocolNEC, i);
infrared_test_run_decoder(InfraredProtocolNEC, 3); }
} }
MU_TEST(infrared_test_decoder_unexpected_end_in_sequence) { MU_TEST(infrared_test_decoder_unexpected_end_in_sequence) {
infrared_test_run_decoder(InfraredProtocolNEC, 1); for(uint32_t i = 1; i <= 2; ++i) {
infrared_test_run_decoder(InfraredProtocolNEC, 1); infrared_test_run_decoder(InfraredProtocolNEC, i);
infrared_test_run_decoder(InfraredProtocolNEC, 2); infrared_test_run_decoder(InfraredProtocolNEC, i);
infrared_test_run_decoder(InfraredProtocolNEC, 2); }
} }
MU_TEST(infrared_test_decoder_necext1) { MU_TEST(infrared_test_decoder_necext1) {
infrared_test_run_decoder(InfraredProtocolNECext, 1); for(uint32_t i = 0; i < 2; ++i) {
infrared_test_run_decoder(InfraredProtocolNECext, 1); UNUSED(i);
infrared_test_run_decoder(InfraredProtocolNECext, 1);
}
} }
MU_TEST(infrared_test_decoder_long_packets_with_nec_start) { MU_TEST(infrared_test_decoder_long_packets_with_nec_start) {
infrared_test_run_decoder(InfraredProtocolNEC42ext, 1); for(uint32_t i = 1; i <= 2; ++i) {
infrared_test_run_decoder(InfraredProtocolNEC42ext, 2); infrared_test_run_decoder(InfraredProtocolNEC42ext, i);
}
} }
MU_TEST(infrared_test_encoder_sirc) { MU_TEST(infrared_test_encoder_sirc) {
infrared_test_run_encoder(InfraredProtocolSIRC, 1); for(uint32_t i = 1; i <= 2; ++i) {
infrared_test_run_encoder(InfraredProtocolSIRC, 2); infrared_test_run_encoder(InfraredProtocolSIRC, i);
}
} }
MU_TEST(infrared_test_decoder_sirc) { MU_TEST(infrared_test_decoder_sirc) {
infrared_test_run_decoder(InfraredProtocolSIRC, 3); for(uint32_t i = 1; i <= 5; ++i) {
infrared_test_run_decoder(InfraredProtocolSIRC, 1); infrared_test_run_decoder(InfraredProtocolSIRC, 5);
infrared_test_run_decoder(InfraredProtocolSIRC, 2); }
infrared_test_run_decoder(InfraredProtocolSIRC, 4);
infrared_test_run_decoder(InfraredProtocolSIRC, 5);
} }
MU_TEST(infrared_test_decoder_rc5) { MU_TEST(infrared_test_decoder_rc5) {
infrared_test_run_decoder(InfraredProtocolRC5X, 1); infrared_test_run_decoder(InfraredProtocolRC5X, 1);
infrared_test_run_decoder(InfraredProtocolRC5, 1);
infrared_test_run_decoder(InfraredProtocolRC5, 2); for(uint32_t i = 1; i <= 7; ++i) {
infrared_test_run_decoder(InfraredProtocolRC5, 3); infrared_test_run_decoder(InfraredProtocolRC5, i);
infrared_test_run_decoder(InfraredProtocolRC5, 4); }
infrared_test_run_decoder(InfraredProtocolRC5, 5);
infrared_test_run_decoder(InfraredProtocolRC5, 6);
infrared_test_run_decoder(InfraredProtocolRC5, 7);
} }
MU_TEST(infrared_test_encoder_rc5x) { MU_TEST(infrared_test_encoder_rc5x) {
@@ -492,21 +492,21 @@ MU_TEST(infrared_test_encoder_rc6) {
} }
MU_TEST(infrared_test_decoder_kaseikyo) { MU_TEST(infrared_test_decoder_kaseikyo) {
infrared_test_run_decoder(InfraredProtocolKaseikyo, 1); for(uint32_t i = 1; i <= 6; ++i) {
infrared_test_run_decoder(InfraredProtocolKaseikyo, 2); infrared_test_run_decoder(InfraredProtocolKaseikyo, i);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 3); }
infrared_test_run_decoder(InfraredProtocolKaseikyo, 4);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 5);
infrared_test_run_decoder(InfraredProtocolKaseikyo, 6);
} }
MU_TEST(infrared_test_decoder_rca) { MU_TEST(infrared_test_decoder_rca) {
infrared_test_run_decoder(InfraredProtocolRCA, 1); for(uint32_t i = 1; i <= 6; ++i) {
infrared_test_run_decoder(InfraredProtocolRCA, 2); infrared_test_run_decoder(InfraredProtocolRCA, i);
infrared_test_run_decoder(InfraredProtocolRCA, 3); }
infrared_test_run_decoder(InfraredProtocolRCA, 4); }
infrared_test_run_decoder(InfraredProtocolRCA, 5);
infrared_test_run_decoder(InfraredProtocolRCA, 6); MU_TEST(infrared_test_decoder_pioneer) {
for(uint32_t i = 1; i <= 11; ++i) {
infrared_test_run_decoder(InfraredProtocolPioneer, i);
}
} }
MU_TEST(infrared_test_encoder_decoder_all) { MU_TEST(infrared_test_encoder_decoder_all) {
@@ -520,6 +520,7 @@ MU_TEST(infrared_test_encoder_decoder_all) {
infrared_test_run_encoder_decoder(InfraredProtocolSIRC, 1); infrared_test_run_encoder_decoder(InfraredProtocolSIRC, 1);
infrared_test_run_encoder_decoder(InfraredProtocolKaseikyo, 1); infrared_test_run_encoder_decoder(InfraredProtocolKaseikyo, 1);
infrared_test_run_encoder_decoder(InfraredProtocolRCA, 1); infrared_test_run_encoder_decoder(InfraredProtocolRCA, 1);
infrared_test_run_encoder_decoder(InfraredProtocolPioneer, 1);
} }
MU_TEST_SUITE(infrared_test) { MU_TEST_SUITE(infrared_test) {
@@ -539,11 +540,14 @@ MU_TEST_SUITE(infrared_test) {
MU_RUN_TEST(infrared_test_decoder_necext1); MU_RUN_TEST(infrared_test_decoder_necext1);
MU_RUN_TEST(infrared_test_decoder_kaseikyo); MU_RUN_TEST(infrared_test_decoder_kaseikyo);
MU_RUN_TEST(infrared_test_decoder_rca); MU_RUN_TEST(infrared_test_decoder_rca);
MU_RUN_TEST(infrared_test_decoder_pioneer);
MU_RUN_TEST(infrared_test_decoder_mixed); MU_RUN_TEST(infrared_test_decoder_mixed);
MU_RUN_TEST(infrared_test_encoder_decoder_all); MU_RUN_TEST(infrared_test_encoder_decoder_all);
} }
int run_minunit_test_infrared() { int run_minunit_test_infrared(void) {
MU_RUN_SUITE(infrared_test); MU_RUN_SUITE(infrared_test);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_infrared)

View File

@@ -1,5 +1,5 @@
#include <furi.h> #include <furi.h>
#include "../minunit.h" #include "../test.h"
#include <toolbox/protocols/protocol_dict.h> #include <toolbox/protocols/protocol_dict.h>
#include <lfrfid/protocols/lfrfid_protocols.h> #include <lfrfid/protocols/lfrfid_protocols.h>
#include <toolbox/pulse_protocols/pulse_glue.h> #include <toolbox/pulse_protocols/pulse_glue.h>
@@ -547,7 +547,9 @@ MU_TEST_SUITE(test_lfrfid_protocols_suite) {
MU_RUN_TEST(test_lfrfid_protocol_fdxb_emulate_simple); MU_RUN_TEST(test_lfrfid_protocol_fdxb_emulate_simple);
} }
int run_minunit_test_lfrfid_protocols() { int run_minunit_test_lfrfid_protocols(void) {
MU_RUN_SUITE(test_lfrfid_protocols_suite); MU_RUN_SUITE(test_lfrfid_protocols_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_lfrfid_protocols)

View File

@@ -1,5 +1,5 @@
#include <furi.c> #include <furi.c>
#include "../minunit.h" #include "../test.h"
#include <update_util/resources/manifest.h> #include <update_util/resources/manifest.h>
#define TAG "Manifest" #define TAG "Manifest"
@@ -69,7 +69,9 @@ MU_TEST_SUITE(manifest_suite) {
MU_RUN_TEST(manifest_iteration_test); MU_RUN_TEST(manifest_iteration_test);
} }
int run_minunit_test_manifest() { int run_minunit_test_manifest(void) {
MU_RUN_SUITE(manifest_suite); MU_RUN_SUITE(manifest_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_manifest)

View File

@@ -7,33 +7,72 @@
#include <nfc/nfc_poller.h> #include <nfc/nfc_poller.h>
#include <nfc/nfc_listener.h> #include <nfc/nfc_listener.h>
#include <nfc/protocols/iso14443_3a/iso14443_3a.h> #include <nfc/protocols/iso14443_3a/iso14443_3a.h>
#include <nfc/protocols/iso14443_3a/iso14443_3a_poller.h>
#include <nfc/protocols/iso14443_3a/iso14443_3a_poller_sync.h> #include <nfc/protocols/iso14443_3a/iso14443_3a_poller_sync.h>
#include <nfc/protocols/mf_ultralight/mf_ultralight.h> #include <nfc/protocols/mf_ultralight/mf_ultralight.h>
#include <nfc/protocols/mf_ultralight/mf_ultralight_poller_sync.h> #include <nfc/protocols/mf_ultralight/mf_ultralight_poller_sync.h>
#include <nfc/protocols/mf_classic/mf_classic_poller_sync.h> #include <nfc/protocols/mf_classic/mf_classic_poller_sync.h>
#include <nfc/protocols/mf_classic/mf_classic_poller.h>
#include <nfc/protocols/iso15693_3/iso15693_3_poller.h>
#include <nfc/protocols/slix/slix.h>
#include <nfc/protocols/slix/slix_i.h>
#include <nfc/protocols/slix/slix_poller.h>
#include <nfc/protocols/slix/slix_poller_i.h>
#include <nfc/nfc_poller.h>
#include <toolbox/keys_dict.h> #include <toolbox/keys_dict.h>
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include "../minunit.h" #include "../test.h"
#define TAG "NfcTest" #define TAG "NfcTest"
#define NFC_TEST_NFC_DEV_PATH EXT_PATH("unit_tests/nfc/nfc_device_test.nfc") #define NFC_TEST_NFC_DEV_PATH EXT_PATH("unit_tests/nfc/nfc_device_test.nfc")
#define NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH EXT_PATH("unit_tests/mf_dict.nfc") #define NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH EXT_PATH("unit_tests/mf_dict.nfc")
#define NFC_TEST_FLAG_WORKER_DONE (1)
typedef enum {
NfcTestMfClassicSendFrameTestStateAuth,
NfcTestMfClassicSendFrameTestStateReadBlock,
NfcTestMfClassicSendFrameTestStateFail,
NfcTestMfClassicSendFrameTestStateSuccess,
} NfcTestMfClassicSendFrameTestState;
typedef struct {
NfcTestMfClassicSendFrameTestState state;
BitBuffer* tx_buf;
BitBuffer* rx_buf;
FuriThreadId thread_id;
} NfcTestMfClassicSendFrameTest;
typedef enum {
NfcTestSlixPollerSetPasswordStateGetRandomNumber,
NfcTestSlixPollerSetPasswordStateSetPassword,
} NfcTestSlixPollerSetPasswordState;
typedef struct {
FuriThreadId thread_id;
NfcTestSlixPollerSetPasswordState state;
SlixRandomNumber random_number;
SlixPassword password;
SlixError error;
} NfcTestSlixPollerSetPasswordContext;
typedef struct { typedef struct {
Storage* storage; Storage* storage;
} NfcTest; } NfcTest;
static NfcTest* nfc_test = NULL; static NfcTest* nfc_test = NULL;
static void nfc_test_alloc() { static void nfc_test_alloc(void) {
nfc_test = malloc(sizeof(NfcTest)); nfc_test = malloc(sizeof(NfcTest));
nfc_test->storage = furi_record_open(RECORD_STORAGE); nfc_test->storage = furi_record_open(RECORD_STORAGE);
} }
static void nfc_test_free() { static void nfc_test_free(void) {
furi_check(nfc_test); furi_check(nfc_test);
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@@ -292,7 +331,7 @@ MU_TEST(ntag_213_locked_reader) {
nfc_free(poller); nfc_free(poller);
} }
static void mf_ultralight_write() { static void mf_ultralight_write(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@@ -342,7 +381,7 @@ static void mf_ultralight_write() {
nfc_free(poller); nfc_free(poller);
} }
static void mf_classic_reader() { static void mf_classic_reader(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@@ -368,7 +407,7 @@ static void mf_classic_reader() {
nfc_free(poller); nfc_free(poller);
} }
static void mf_classic_write() { static void mf_classic_write(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@@ -396,7 +435,7 @@ static void mf_classic_write() {
nfc_free(poller); nfc_free(poller);
} }
static void mf_classic_value_block() { static void mf_classic_value_block(void) {
Nfc* poller = nfc_alloc(); Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc(); Nfc* listener = nfc_alloc();
@@ -435,6 +474,109 @@ static void mf_classic_value_block() {
nfc_free(poller); nfc_free(poller);
} }
NfcCommand mf_classic_poller_send_frame_callback(NfcGenericEventEx event, void* context) {
furi_check(event.poller);
furi_check(event.parent_event_data);
furi_check(context);
NfcCommand command = NfcCommandContinue;
MfClassicPoller* instance = event.poller;
NfcTestMfClassicSendFrameTest* frame_test = context;
Iso14443_3aPollerEvent* iso3_event = event.parent_event_data;
MfClassicError error = MfClassicErrorNone;
if(iso3_event->type == Iso14443_3aPollerEventTypeReady) {
if(frame_test->state == NfcTestMfClassicSendFrameTestStateAuth) {
MfClassicKey key = {
.data = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
};
error = mf_classic_poller_auth(instance, 0, &key, MfClassicKeyTypeA, NULL);
frame_test->state = (error == MfClassicErrorNone) ?
NfcTestMfClassicSendFrameTestStateReadBlock :
NfcTestMfClassicSendFrameTestStateFail;
} else if(frame_test->state == NfcTestMfClassicSendFrameTestStateReadBlock) {
do {
const uint8_t read_block_cmd[] = {
0x30,
0x01,
0x8b,
0xb9,
};
bit_buffer_copy_bytes(frame_test->tx_buf, read_block_cmd, sizeof(read_block_cmd));
error = mf_classic_poller_send_encrypted_frame(
instance, frame_test->tx_buf, frame_test->rx_buf, 200000);
if(error != MfClassicErrorNone) break;
if(bit_buffer_get_size_bytes(frame_test->rx_buf) != 18) {
error = MfClassicErrorProtocol;
break;
}
const uint8_t* rx_data = bit_buffer_get_data(frame_test->rx_buf);
const uint8_t rx_data_ref[16] = {0};
if(memcmp(rx_data, rx_data_ref, sizeof(rx_data_ref)) != 0) {
error = MfClassicErrorProtocol;
break;
}
} while(false);
frame_test->state = (error == MfClassicErrorNone) ?
NfcTestMfClassicSendFrameTestStateSuccess :
NfcTestMfClassicSendFrameTestStateFail;
} else if(frame_test->state == NfcTestMfClassicSendFrameTestStateSuccess) {
command = NfcCommandStop;
} else if(frame_test->state == NfcTestMfClassicSendFrameTestStateFail) {
command = NfcCommandStop;
}
} else {
frame_test->state = NfcTestMfClassicSendFrameTestStateFail;
command = NfcCommandStop;
}
if(command == NfcCommandStop) {
furi_thread_flags_set(frame_test->thread_id, NFC_TEST_FLAG_WORKER_DONE);
}
return command;
}
MU_TEST(mf_classic_send_frame_test) {
Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc();
NfcDevice* nfc_device = nfc_device_alloc();
nfc_data_generator_fill_data(NfcDataGeneratorTypeMfClassic4k_7b, nfc_device);
NfcListener* mfc_listener = nfc_listener_alloc(
listener, NfcProtocolMfClassic, nfc_device_get_data(nfc_device, NfcProtocolMfClassic));
nfc_listener_start(mfc_listener, NULL, NULL);
NfcPoller* mfc_poller = nfc_poller_alloc(poller, NfcProtocolMfClassic);
NfcTestMfClassicSendFrameTest context = {
.state = NfcTestMfClassicSendFrameTestStateAuth,
.thread_id = furi_thread_get_current_id(),
.tx_buf = bit_buffer_alloc(32),
.rx_buf = bit_buffer_alloc(32),
};
nfc_poller_start_ex(mfc_poller, mf_classic_poller_send_frame_callback, &context);
uint32_t flag =
furi_thread_flags_wait(NFC_TEST_FLAG_WORKER_DONE, FuriFlagWaitAny, FuriWaitForever);
mu_assert(flag == NFC_TEST_FLAG_WORKER_DONE, "Wrong thread flag");
nfc_poller_stop(mfc_poller);
nfc_poller_free(mfc_poller);
mu_assert(
context.state == NfcTestMfClassicSendFrameTestStateSuccess, "Wrong test state at the end");
bit_buffer_free(context.tx_buf);
bit_buffer_free(context.rx_buf);
nfc_listener_stop(mfc_listener);
nfc_listener_free(mfc_listener);
nfc_device_free(nfc_device);
nfc_free(listener);
nfc_free(poller);
}
MU_TEST(mf_classic_dict_test) { MU_TEST(mf_classic_dict_test) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_common_stat(storage, NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH, NULL) == FSE_OK) { if(storage_common_stat(storage, NFC_APP_MF_CLASSIC_DICT_UNIT_TEST_PATH, NULL) == FSE_OK) {
@@ -504,6 +646,127 @@ MU_TEST(mf_classic_dict_test) {
"Remove test dict failed"); "Remove test dict failed");
} }
MU_TEST(slix_file_with_capabilities_test) {
NfcDevice* nfc_device_missed_cap = nfc_device_alloc();
mu_assert(
nfc_device_load(nfc_device_missed_cap, EXT_PATH("unit_tests/nfc/Slix_cap_missed.nfc")),
"nfc_device_load() failed\r\n");
NfcDevice* nfc_device_default_cap = nfc_device_alloc();
mu_assert(
nfc_device_load(nfc_device_default_cap, EXT_PATH("unit_tests/nfc/Slix_cap_default.nfc")),
"nfc_device_load() failed\r\n");
mu_assert(
nfc_device_is_equal(nfc_device_missed_cap, nfc_device_default_cap),
"nfc_device_is_equal() failed\r\n");
nfc_device_free(nfc_device_default_cap);
nfc_device_free(nfc_device_missed_cap);
}
NfcCommand slix_poller_set_password_callback(NfcGenericEventEx event, void* context) {
furi_check(event.poller);
furi_check(event.parent_event_data);
furi_check(context);
NfcCommand command = NfcCommandContinue;
Iso15693_3PollerEvent* iso15_event = event.parent_event_data;
SlixPoller* poller = event.poller;
NfcTestSlixPollerSetPasswordContext* slix_ctx = context;
if(iso15_event->type == Iso15693_3PollerEventTypeReady) {
iso15693_3_copy(
poller->data->iso15693_3_data, iso15693_3_poller_get_data(poller->iso15693_3_poller));
if(slix_ctx->state == NfcTestSlixPollerSetPasswordStateGetRandomNumber) {
slix_ctx->error = slix_poller_get_random_number(poller, &slix_ctx->random_number);
if(slix_ctx->error != SlixErrorNone) {
furi_thread_flags_set(slix_ctx->thread_id, NFC_TEST_FLAG_WORKER_DONE);
command = NfcCommandStop;
} else {
slix_ctx->state = NfcTestSlixPollerSetPasswordStateSetPassword;
}
} else if(slix_ctx->state == NfcTestSlixPollerSetPasswordStateSetPassword) {
slix_ctx->error = slix_poller_set_password(
poller, SlixPasswordTypeRead, slix_ctx->password, slix_ctx->random_number);
furi_thread_flags_set(slix_ctx->thread_id, NFC_TEST_FLAG_WORKER_DONE);
command = NfcCommandStop;
}
} else {
slix_ctx->error = slix_process_iso15693_3_error(iso15_event->data->error);
furi_thread_flags_set(slix_ctx->thread_id, NFC_TEST_FLAG_WORKER_DONE);
command = NfcCommandStop;
}
return command;
}
static void slix_set_password_test(const char* file_path, SlixPassword pass, bool correct_pass) {
FURI_LOG_I(TAG, "Testing file: %s", file_path);
Nfc* poller = nfc_alloc();
Nfc* listener = nfc_alloc();
NfcDevice* nfc_device = nfc_device_alloc();
mu_assert(nfc_device_load(nfc_device, file_path), "nfc_device_load() failed\r\n");
const SlixData* slix_data = nfc_device_get_data(nfc_device, NfcProtocolSlix);
NfcListener* slix_listener = nfc_listener_alloc(listener, NfcProtocolSlix, slix_data);
nfc_listener_start(slix_listener, NULL, NULL);
SlixCapabilities slix_capabilities = slix_data->capabilities;
NfcPoller* slix_poller = nfc_poller_alloc(poller, NfcProtocolSlix);
NfcTestSlixPollerSetPasswordContext slix_poller_context = {
.thread_id = furi_thread_get_current_id(),
.state = NfcTestSlixPollerSetPasswordStateGetRandomNumber,
.password = pass,
.error = SlixErrorNone,
};
nfc_poller_start_ex(slix_poller, slix_poller_set_password_callback, &slix_poller_context);
uint32_t flag =
furi_thread_flags_wait(NFC_TEST_FLAG_WORKER_DONE, FuriFlagWaitAny, FuriWaitForever);
mu_assert(flag == NFC_TEST_FLAG_WORKER_DONE, "Wrong thread flag\r\n");
nfc_poller_stop(slix_poller);
nfc_poller_free(slix_poller);
nfc_listener_stop(slix_listener);
nfc_listener_free(slix_listener);
mu_assert(
slix_poller_context.state == NfcTestSlixPollerSetPasswordStateSetPassword,
"Poller failed before setting password\r\n");
if((slix_capabilities == SlixCapabilitiesAcceptAllPasswords) || (correct_pass)) {
mu_assert(slix_poller_context.error == SlixErrorNone, "Failed to set password\r\n");
} else {
mu_assert(
slix_poller_context.error == SlixErrorTimeout,
"Must have received SlixErrorTimeout\r\n");
}
nfc_device_free(nfc_device);
nfc_free(listener);
nfc_free(poller);
}
MU_TEST(slix_set_password_default_cap_correct_pass) {
slix_set_password_test(EXT_PATH("unit_tests/nfc/Slix_cap_default.nfc"), 0x00000000, true);
}
MU_TEST(slix_set_password_default_cap_incorrect_pass) {
slix_set_password_test(EXT_PATH("unit_tests/nfc/Slix_cap_default.nfc"), 0x12341234, false);
}
MU_TEST(slix_set_password_access_all_passwords_cap) {
slix_set_password_test(
EXT_PATH("unit_tests/nfc/Slix_cap_accept_all_pass.nfc"), 0x12341234, false);
}
MU_TEST_SUITE(nfc) { MU_TEST_SUITE(nfc) {
nfc_test_alloc(); nfc_test_alloc();
@@ -538,17 +801,24 @@ MU_TEST_SUITE(nfc) {
MU_RUN_TEST(mf_classic_1k_7b_file_test); MU_RUN_TEST(mf_classic_1k_7b_file_test);
MU_RUN_TEST(mf_classic_4k_4b_file_test); MU_RUN_TEST(mf_classic_4k_4b_file_test);
MU_RUN_TEST(mf_classic_4k_7b_file_test); MU_RUN_TEST(mf_classic_4k_7b_file_test);
MU_RUN_TEST(mf_classic_reader);
MU_RUN_TEST(mf_classic_reader);
MU_RUN_TEST(mf_classic_write); MU_RUN_TEST(mf_classic_write);
MU_RUN_TEST(mf_classic_value_block); MU_RUN_TEST(mf_classic_value_block);
MU_RUN_TEST(mf_classic_send_frame_test);
MU_RUN_TEST(mf_classic_dict_test); MU_RUN_TEST(mf_classic_dict_test);
MU_RUN_TEST(slix_file_with_capabilities_test);
MU_RUN_TEST(slix_set_password_default_cap_correct_pass);
MU_RUN_TEST(slix_set_password_default_cap_incorrect_pass);
MU_RUN_TEST(slix_set_password_access_all_passwords_cap);
nfc_test_free(); nfc_test_free();
} }
int run_minunit_test_nfc() { int run_minunit_test_nfc(void) {
MU_RUN_SUITE(nfc); MU_RUN_SUITE(nfc);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_nfc)

View File

@@ -1,6 +1,6 @@
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include "../minunit.h" #include "../test.h"
static void power_test_deinit(void) { static void power_test_deinit(void) {
// Try to reset to default charge voltage limit // Try to reset to default charge voltage limit
@@ -63,7 +63,9 @@ MU_TEST_SUITE(test_power_suite) {
power_test_deinit(); power_test_deinit();
} }
int run_minunit_test_power() { int run_minunit_test_power(void) {
MU_RUN_SUITE(test_power_suite); MU_RUN_SUITE(test_power_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_power)

View File

@@ -1,5 +1,5 @@
#include <furi.h> #include <furi.h>
#include "../minunit.h" #include "../test.h"
#include <toolbox/protocols/protocol_dict.h> #include <toolbox/protocols/protocol_dict.h>
typedef enum { typedef enum {
@@ -18,7 +18,7 @@ typedef struct {
static const uint32_t protocol_0_decoder_result = 0xDEADBEEF; static const uint32_t protocol_0_decoder_result = 0xDEADBEEF;
static void* protocol_0_alloc() { static void* protocol_0_alloc(void) {
void* data = malloc(sizeof(Protocol0Data)); void* data = malloc(sizeof(Protocol0Data));
return data; return data;
} }
@@ -63,7 +63,7 @@ typedef struct {
static const uint64_t protocol_1_decoder_result = 0x1234567890ABCDEF; static const uint64_t protocol_1_decoder_result = 0x1234567890ABCDEF;
static void* protocol_1_alloc() { static void* protocol_1_alloc(void) {
void* data = malloc(sizeof(Protocol1Data)); void* data = malloc(sizeof(Protocol1Data));
return data; return data;
} }
@@ -216,7 +216,9 @@ MU_TEST_SUITE(test_protocol_dict_suite) {
MU_RUN_TEST(test_protocol_dict); MU_RUN_TEST(test_protocol_dict);
} }
int run_minunit_test_protocol_dict() { int run_minunit_test_protocol_dict(void) {
MU_RUN_SUITE(test_protocol_dict_suite); MU_RUN_SUITE(test_protocol_dict_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_protocol_dict)

View File

@@ -17,7 +17,7 @@
#include <lib/toolbox/path.h> #include <lib/toolbox/path.h>
#include <m-list.h> #include <m-list.h>
#include "../minunit.h" #include "../test.h"
#include <protobuf_version.h> #include <protobuf_version.h>
#include <pb.h> #include <pb.h>
@@ -1840,7 +1840,7 @@ MU_TEST_SUITE(test_rpc_session) {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
int run_minunit_test_rpc() { int run_minunit_test_rpc(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
if(storage_sd_status(storage) != FSE_OK) { if(storage_sd_status(storage) != FSE_OK) {
FURI_LOG_E(TAG, "SD card not mounted - skip storage tests"); FURI_LOG_E(TAG, "SD card not mounted - skip storage tests");
@@ -1864,3 +1864,5 @@ int32_t delay_test_app(void* p) {
return 0; return 0;
} }
TEST_API_DEFINE(run_minunit_test_rpc)

View File

@@ -1,4 +1,4 @@
#include "../minunit.h" #include "../test.h"
#include <furi.h> #include <furi.h>
#include <storage/storage.h> #include <storage/storage.h>
@@ -36,7 +36,7 @@ static bool storage_file_create(Storage* storage, const char* path, const char*
return result; return result;
} }
static void storage_file_open_lock_setup() { static void storage_file_open_lock_setup(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
File* file = storage_file_alloc(storage); File* file = storage_file_alloc(storage);
storage_simply_remove(storage, STORAGE_LOCKED_FILE); storage_simply_remove(storage, STORAGE_LOCKED_FILE);
@@ -47,7 +47,7 @@ static void storage_file_open_lock_setup() {
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
} }
static void storage_file_open_lock_teardown() { static void storage_file_open_lock_teardown(void) {
Storage* storage = furi_record_open(RECORD_STORAGE); Storage* storage = furi_record_open(RECORD_STORAGE);
mu_check(storage_simply_remove(storage, STORAGE_LOCKED_FILE)); mu_check(storage_simply_remove(storage, STORAGE_LOCKED_FILE));
furi_record_close(RECORD_STORAGE); furi_record_close(RECORD_STORAGE);
@@ -702,7 +702,7 @@ MU_TEST_SUITE(test_md5_calc_suite) {
MU_RUN_TEST(test_md5_calc); MU_RUN_TEST(test_md5_calc);
} }
int run_minunit_test_storage() { int run_minunit_test_storage(void) {
MU_RUN_SUITE(storage_file); MU_RUN_SUITE(storage_file);
MU_RUN_SUITE(storage_file_64k); MU_RUN_SUITE(storage_file_64k);
MU_RUN_SUITE(storage_dir); MU_RUN_SUITE(storage_dir);
@@ -712,3 +712,5 @@ int run_minunit_test_storage() {
MU_RUN_SUITE(test_md5_calc_suite); MU_RUN_SUITE(test_md5_calc_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_storage)

View File

@@ -4,7 +4,7 @@
#include <toolbox/stream/file_stream.h> #include <toolbox/stream/file_stream.h>
#include <toolbox/stream/buffered_file_stream.h> #include <toolbox/stream/buffered_file_stream.h>
#include <storage/storage.h> #include <storage/storage.h>
#include "../minunit.h" #include "../test.h"
static const char* stream_test_data = "I write differently from what I speak, " static const char* stream_test_data = "I write differently from what I speak, "
"I speak differently from what I think, " "I speak differently from what I think, "
@@ -526,7 +526,9 @@ MU_TEST_SUITE(stream_suite) {
MU_RUN_TEST(stream_buffered_large_file_test); MU_RUN_TEST(stream_buffered_large_file_test);
} }
int run_minunit_test_stream() { int run_minunit_test_stream(void) {
MU_RUN_SUITE(stream_suite); MU_RUN_SUITE(stream_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_stream)

View File

@@ -1,6 +1,6 @@
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include "../minunit.h" #include "../test.h"
#include <lib/subghz/receiver.h> #include <lib/subghz/receiver.h>
#include <lib/subghz/transmitter.h> #include <lib/subghz/transmitter.h>
#include <lib/subghz/subghz_keystore.h> #include <lib/subghz/subghz_keystore.h>
@@ -312,7 +312,7 @@ static LevelDuration subghz_hal_async_tx_test_yield(void* context) {
furi_crash("Yield after reset"); furi_crash("Yield after reset");
} }
} else { } else {
furi_crash("Programming error"); furi_crash();
} }
} }
@@ -902,7 +902,9 @@ MU_TEST_SUITE(subghz) {
subghz_test_deinit(); subghz_test_deinit();
} }
int run_minunit_test_subghz() { int run_minunit_test_subghz(void) {
MU_RUN_SUITE(subghz); MU_RUN_SUITE(subghz);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_subghz)

View File

@@ -0,0 +1,12 @@
#pragma once
// Framework
#include "minunit.h"
#include "test_api.h"
int get_minunit_run(void);
int get_minunit_assert(void);
int get_minunit_status(void);

View File

@@ -0,0 +1,29 @@
#pragma once
#include <flipper_application/flipper_application.h>
#define APPID "UnitTest"
#define API_VERSION (0u)
typedef struct {
int (*run)(void);
int (*get_minunit_run)(void);
int (*get_minunit_assert)(void);
int (*get_minunit_status)(void);
} TestApi;
#define TEST_API_DEFINE(entrypoint) \
const TestApi test_api = { \
.run = entrypoint, \
.get_minunit_run = get_minunit_run, \
.get_minunit_assert = get_minunit_assert, \
.get_minunit_status = get_minunit_status, \
}; \
const FlipperAppPluginDescriptor app_descriptor = { \
.appid = APPID, \
.ep_api_version = API_VERSION, \
.entry_point = &test_api, \
}; \
const FlipperAppPluginDescriptor* get_api(void) { \
return &app_descriptor; \
}

View File

@@ -1,6 +1,8 @@
#include <furi.h> #include <furi.h>
#include <furi_hal.h> #include <furi_hal.h>
#include "../minunit.h"
#include "../test.h"
#include <toolbox/varint.h> #include <toolbox/varint.h>
#include <toolbox/profiler.h> #include <toolbox/profiler.h>
@@ -82,7 +84,9 @@ MU_TEST_SUITE(test_varint_suite) {
MU_RUN_TEST(test_varint_rand_i); MU_RUN_TEST(test_varint_rand_i);
} }
int run_minunit_test_varint() { int run_minunit_test_varint(void) {
MU_RUN_SUITE(test_varint_suite); MU_RUN_SUITE(test_varint_suite);
return MU_EXIT_CODE; return MU_EXIT_CODE;
} }
TEST_API_DEFINE(run_minunit_test_varint)

View File

@@ -0,0 +1,19 @@
#include <flipper_application/api_hashtable/api_hashtable.h>
#include <flipper_application/api_hashtable/compilesort.hpp>
#include "unit_test_api_table_i.h"
static_assert(!has_hash_collisions(unit_tests_api_table), "Detected API method hash collision!");
constexpr HashtableApiInterface unit_tests_hashtable_api_interface{
{
.api_version_major = 0,
.api_version_minor = 0,
.resolver_callback = &elf_resolve_from_hashtable,
},
unit_tests_api_table.cbegin(),
unit_tests_api_table.cend(),
};
extern "C" const ElfApiInterface* const unit_tests_api_interface =
&unit_tests_hashtable_api_interface;

View File

@@ -0,0 +1,29 @@
#include <update_util/resources/manifest.h>
#include <nfc/protocols/slix/slix_i.h>
#include <nfc/protocols/iso15693_3/iso15693_3_poller_i.h>
#include <FreeRTOS.h>
#include <FreeRTOS-Kernel/include/queue.h>
#include <rpc/rpc_i.h>
#include <flipper.pb.h>
static constexpr auto unit_tests_api_table = sort(create_array_t<sym_entry>(
API_METHOD(resource_manifest_reader_alloc, ResourceManifestReader*, (Storage*)),
API_METHOD(resource_manifest_reader_free, void, (ResourceManifestReader*)),
API_METHOD(resource_manifest_reader_open, bool, (ResourceManifestReader*, const char* filename)),
API_METHOD(resource_manifest_reader_next, ResourceManifestEntry*, (ResourceManifestReader*)),
API_METHOD(resource_manifest_reader_previous, ResourceManifestEntry*, (ResourceManifestReader*)),
API_METHOD(slix_process_iso15693_3_error, SlixError, (Iso15693_3Error)),
API_METHOD(iso15693_3_poller_get_data, const Iso15693_3Data*, (Iso15693_3Poller*)),
API_METHOD(rpc_system_storage_get_error, PB_CommandStatus, (FS_Error)),
API_METHOD(xQueueSemaphoreTake, BaseType_t, (QueueHandle_t, TickType_t)),
API_METHOD(vQueueDelete, void, (QueueHandle_t)),
API_METHOD(
xQueueGenericCreate,
QueueHandle_t,
(const UBaseType_t, const UBaseType_t, const uint8_t)),
API_METHOD(
xQueueGenericSend,
BaseType_t,
(QueueHandle_t, const void* const, TickType_t, const BaseType_t)),
API_VARIABLE(PB_Main_msg, PB_Main_msg_t)));

View File

@@ -0,0 +1,21 @@
#include <furi.h>
#include <cli/cli.h>
#include "test_runner.h"
void unit_tests_cli(Cli* cli, FuriString* args, void* context) {
UNUSED(cli);
UNUSED(context);
TestRunner* test_runner = test_runner_alloc(cli, args);
test_runner_run(test_runner);
test_runner_free(test_runner);
}
void unit_tests_on_system_start(void) {
#ifdef SRV_CLI
Cli* cli = furi_record_open(RECORD_CLI);
cli_add_command(cli, "unit_tests", CliCommandFlagParallelSafe, unit_tests_cli, NULL);
furi_record_close(RECORD_CLI);
#endif
}

View File

@@ -55,7 +55,7 @@ uint32_t usb_test_exit(void* context) {
return VIEW_NONE; return VIEW_NONE;
} }
UsbTestApp* usb_test_app_alloc() { UsbTestApp* usb_test_app_alloc(void) {
UsbTestApp* app = malloc(sizeof(UsbTestApp)); UsbTestApp* app = malloc(sizeof(UsbTestApp));
// Gui // Gui

Some files were not shown because too many files have changed in this diff Show More