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

Compare commits

...

524 Commits

Author SHA1 Message Date
MX
e4cdae4922 lfrfid cli help update 2022-10-17 23:33:54 +03:00
MX
c7a67c1308 update changelog and ir assets 2022-10-17 23:27:35 +03:00
MX
fd3e70492d add support for Normstahl, Mutancode, FAAC RC, XT 2022-10-17 22:43:33 +03:00
MX
a4ee73b470 add dtmf dolphin plugin
https://github.com/litui/dtmf_dolphin
2022-10-17 22:40:14 +03:00
MX
8f5cbdc4c2 Merge pull request #113 from TQMatvey/dev
Minesweeper: Set cursor to initial position on death
2022-10-17 21:41:57 +03:00
MX
6d999abb80 Merge pull request #114 from TQMatvey/flappy_patches
Flappy: Border hitboxes, bigger Pilars
2022-10-17 21:41:24 +03:00
MX
89d49fdba7 Merge branch 'dev' into flappy_patches 2022-10-17 21:39:09 +03:00
MX
04d67ca8ae update totp
https://github.com/akopachov/flipper-zero_authenticator
2022-10-17 21:22:34 +03:00
MX
4f7ca617cc Merge branch 'fz-dev' into dev 2022-10-17 21:20:28 +03:00
Travis Montoya
f61a8fda53 Feature/infrared add remote to cli (#1856)
* Initial testing of remote using cli
* More fixes for cli ir remote
* Fixes. Turns off power now
* Finished adding other tv remote commands
* Changed if-else formatting
* Cleaned up unused variables
* Updating cli unviersal remote to accept tv, ac and more modular. Listing signals still does not work properly
* Using mlib dictionary to get unique signals from files for ir universal list
* Fixing progress bar
* Added error checking for invalid signal to stop freezing cli
* Added error checking for arg length
* Api symbols was changed somehow.. changed back and updated the argument check to account for newline
* Fixing string compares and argument length issue
* Freeing InfraredBruteForce in cli brute force signals

Co-authored-by: sqlsquirreltm <sqlsquirreltm>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 03:07:05 +09:00
Astra
5e35e51c57 [FL-2907] Remove the back button from MFC keys list #1878
Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 02:49:00 +09:00
gornekich
dfbe21e720 NFC fixes part 3 (#1885)
* nfc: fix read next key
* nfc: verify new line ending in user dictionary file
* nfc: fix cache save
* nfc: add unit test for dict load
* nfc: fix total key count in dictionary

Co-authored-by: あく <alleteam@gmail.com>
2022-10-18 02:10:41 +09:00
MX
18e7d2eb41 Merge branch 'fz-dev' into dev 2022-10-17 19:27:29 +03:00
Ivan Podogov
e7aaf3dbb2 Enable all view_ methods in SDK (#1884) 2022-10-18 01:17:04 +10:00
MX
d2018dfa1d Merge branch 'fz-dev' into dev 2022-10-17 02:54:39 +03:00
hedger
8ec5527ae4 fbt: fix for cincludes in app's private library definition (#1882) 2022-10-17 03:11:27 +10:00
TQMatvey
3a50021348 Flappy: Allow using UP key to jump 2022-10-15 12:54:00 +07:00
TQMatvey
20c63664ca Flappy: Border hitboxes, bigger Pilars 2022-10-15 12:46:59 +07:00
TQMatvey
9b6abd8ef0 Minesweeper: Set cursor to initial position on death 2022-10-15 10:53:45 +07:00
MX
f96f2e2411 Merge branch 'fz-dev' into dev 2022-10-14 22:25:48 +03:00
MX
6442caa3e4 Revert "fbt - fix flash usb without resources "
This reverts commit ce173fd44c.
2022-10-14 22:25:11 +03:00
あく
f06930e4ae Desktop: fix fap in settings (#1877) 2022-10-14 21:23:06 +03:00
Kevin Kwok
865baed0bb Fix FileNotFoundError in ./fbt flash_usb (#1876)
* Fix FileNotFoundError in ./fbt flash_usb
* scripts: update.py: proper fix for file naming

Co-authored-by: あく <alleteam@gmail.com>
Co-authored-by: hedger <hedger@nanode.su>
2022-10-15 03:07:23 +09:00
Nikolay Minaylov
f81999ea4a Fix number of dolphin_apps (#1874)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-15 02:35:53 +09:00
MX
89a4b77e73 Merge branch 'fz-dev' into dev 2022-10-14 20:23:11 +03:00
gornekich
ead9f134f4 [FL-2623] Add BLE disconnect request #1686
Co-authored-by: LionZXY <nikita@kulikof.ru>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-15 02:21:23 +09:00
Johannes Mittendorfer
9ff29d12b2 Fix typo in fap loader logging (#1875) 2022-10-15 01:54:52 +09:00
MX
5f3637ca44 update discord link with qr code 2022-10-14 19:48:05 +03:00
MX
effcb445ce update minesweeper
https://github.com/panki27/minesweeper
2022-10-14 19:19:44 +03:00
MX
55bad280ee update changelog 2022-10-14 17:59:53 +03:00
nminaylov
b003ede76c Fix number of dolphin_apps 2022-10-14 17:59:09 +03:00
MX
57362b3eab update changelog 2022-10-14 01:53:09 +03:00
MX
cb0d9ec591 add sec+ 1.0/2.0 433mhz in add manually, and run fbt fmt 2022-10-14 01:49:32 +03:00
MX
dad4772bec update minesweeper
https://github.com/panki27/minesweeper
2022-10-14 01:43:57 +03:00
MX
a16542cda6 update readme 2022-10-14 01:36:37 +03:00
MX
a5d22154a9 update changelog 2022-10-14 01:34:12 +03:00
MX
ce173fd44c fbt - fix flash usb without resources
this is not "stolen" from official, bug are present in ofw at current moment
2022-10-14 01:31:44 +03:00
MX
d547307357 Fix DTM Neo encoder 2022-10-14 01:30:20 +03:00
MX
c198a51b1c Merge branch 'fz-dev' into dev 2022-10-14 01:11:00 +03:00
David
d5b239595f Desktop: Set external apps as favorites (#1816)
* MVP
* Display app name and icon in browser
* Pre-select favorites in submenu and browser
* Show animation while external favorite is loading
* A little birdie told me... (Missing record_close)
* DesktopSettings: reset submenu before running dialog

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-14 03:09:37 +09:00
MX
947e44ce86 Merge branch 'fz-dev' into dev 2022-10-13 20:32:05 +03:00
Astra
55f8beef9f [FL-2876] MFC Improvements Part 2/2 (#1868)
* Remove keys incorrectly added by the key cache
* Improve responsiveness while checking for re-used keys and fix skipping keys when card is removed
* Actually check if the card is completely read
* Discard incorrect keys on a lower level
* nfc: clean up

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-10-14 01:23:29 +09:00
Dzhos Oleksii
e46e6f8ee9 Update title for web updater (#1872)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-14 00:34:27 +09:00
MX
ff6c4f9957 Merge branch 'fz-dev' into dev 2022-10-13 18:07:58 +03:00
hedger
8fdee1e460 Scripts: simpler tar format (#1871)
* scriptsL simpler tar format
* scripts: shorter names for files in update bundle
* scripts: limiting max OTA package dir name length to 80
* scripts: resource bundle: checks for file name length
* scripts: made resource packing errors critical
2022-10-14 00:05:07 +09:00
MX
558f85603d update changelog 2022-10-13 18:03:24 +03:00
MX
b909321699 Merge pull request #107 from an4tur0r/feature/fast_pin_lock
Feature: lock device with pin by long pressing up button
2022-10-13 17:54:43 +03:00
MX
ff52f7d9ba Merge branch 'hedger/fbt_tarfix' into dev 2022-10-13 17:48:16 +03:00
hedger
abfe53f156 scripts: made resource packing errors critical 2022-10-13 18:27:21 +04:00
hedger
9a2228bfa4 scripts: resource bundle: checks for file name length 2022-10-13 18:09:04 +04:00
MX
da17adb5ee update tar formats 2022-10-13 17:08:00 +03:00
hedger
7b16de2d6f scripts: limiting max OTA package dir name length to 80 2022-10-13 17:03:11 +03:00
hedger
735056628c scripts: limiting max OTA package dir name length to 80 2022-10-13 18:01:49 +04:00
MX
9941df48bb run fbt format 2022-10-13 17:00:20 +03:00
MX
8e0e4b5e2c update totp plugin
https://github.com/akopachov/flipper-zero_authenticator
2022-10-13 16:57:08 +03:00
hedger
220adf2375 scripts: shorter names for files in update bundle 2022-10-13 16:55:04 +03:00
an4tur0r
39cd10f061 lock device shortcut 2022-10-13 16:54:13 +03:00
hedger
af1fb2018a scripts: shorter names for files in update bundle 2022-10-13 17:38:47 +04:00
MX
3dde6089fc update mfc improvements
OFW PR 1868 by Astrrra
2022-10-13 16:06:34 +03:00
MX
5f28eafcd2 scripts: fix tar format
OFW PR 1871 by hedger
2022-10-13 01:47:03 +03:00
MX
94d2d5c99f tgz is now built by fbt 2022-10-13 00:49:17 +03:00
MX
3a569d4be8 Merge branch 'fz-dev' into dev 2022-10-13 00:42:15 +03:00
hedger
db2f4847ba scriptsL simpler tar format 2022-10-12 23:13:17 +04:00
Luke Williams
50dc2d7389 36-bit AWID (L11601 Lenel) (#1838)
* 36-bit AWID
* Rfid: correct vendor name AWIG -> AWID

Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 01:31:54 +09:00
Thibaut CHARLES
ede3bac799 Badusb: show script errors on screen (#1506)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 01:21:54 +09:00
hedger
eb4ff3c0fd [FL-2832] fbt: more fixes & improvements (#1854)
* github: bundling debug folder with scripts; docs: fixes & updates; fbt: added FAP_EXAMPLES variable to enable building example apps. Disabled by default. fbt: added TERM to list of proxied environment variables
* fbt: better help output; disabled implicit_deps_unchanged; added color to import validator reports
* fbt: moved debug configuration to separate tool
* fbt: proper dependency tracker for SDK source file; renamed linker script for external apps
* fbt: fixed debug elf path
* fbt: packaging sdk archive
* scripts: fixed sconsdist.py
* fbt: reworked sdk packing; docs: updates
* docs: info on cli target; linter fixes
* fbt: moved main code to scripts folder
* scripts: packing update into .tgz
* fbt, scripts: reworked copro_dist to build .tgz
* scripts: fixed naming for archived updater package
* Scripts: fix ぐるぐる回る

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-13 01:12:05 +09:00
gornekich
afff1adf8f [FL-2882] BLE tiktok controller (#1859)
* bt hid: introduce tiktok controller
* assets: add bt tiktok assets
* bt hid: finish tiktok draw
* bt hid: add input process to tiktok view
* bt hid: add tiktok swipe emulation
* bt hid: fix exit from tiktok controller
* ble hid: add delay to emulate double tap
* ble hid: change options order
* bt hid: build as external application
* ble hid: fix naming

Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 00:48:13 +09:00
あく
92a738bf77 Dolphin: add L1_Painting animation (#1863)
Co-authored-by: hedger <hedger@users.noreply.github.com>
2022-10-13 00:39:39 +09:00
Max Andreev
b3d9523322 Github actions on kubernetes runners (#1861)
* Change toolchain path and runner tag
* fix check_submdules.yml
* try to fix errors
* create .ssh directory
* fix toolchain path
* add empty line for test
* testing 3 k8s nodes speed
* Test speed again
* change tag, move reindex job
* bring reindex.yml back
* fix build.yml
* fix reindex.yml

Co-authored-by: あく <alleteam@gmail.com>
2022-10-13 00:31:25 +09:00
MX
155cbeeb11 fix app id for assets 2022-10-12 05:43:22 +03:00
MX
0d273bd15c update assets and changelog 2022-10-12 05:36:40 +03:00
MX
2e047ff411 allow 36-bit AWID (L11601 Lenel)
OFW PR 1838 by ae5au
2022-10-12 05:32:58 +03:00
MX
80a406afd3 BLE tiktok controller - why? :(
OFW PR 1859 by gornekich
2022-10-12 05:31:19 +03:00
MX
6b5631e5b0 MFC Improvements Part 2/2
OFW PR 1868 by Astrrra
2022-10-12 05:29:42 +03:00
MX
80735d4f51 Merge pull request #102 from derskythe/fix-read-in-readraw-crash
flipper_format_free after all and only if we failed with all plans
2022-10-12 05:17:37 +03:00
MX
e1e46b89b1 Merge pull request #103 from derskythe/subghz-improvements
SubGHz improvements
2022-10-12 05:17:08 +03:00
MX
b7bdc4c985 sorry, i added "Mod:", and did fbt format 2022-10-12 05:15:45 +03:00
MX
f429d14ab5 Merge branch 'dev' into subghz-improvements 2022-10-12 05:04:55 +03:00
MX
744b61ca28 include license 2022-10-12 05:03:33 +03:00
MX
8520daf28b addding some great plugins to be preinstalled
and running fbt format, and fixing TOTP printf format
2022-10-12 05:01:37 +03:00
MX
aa9f958f07 Merge branch 'fz-dev' into dev 2022-10-12 04:37:59 +03:00
MX
b3f96306ed oooooops, added forgotten thing 2022-10-12 04:35:36 +03:00
MX
022315e93d Improve keeloq, add JCM support, fix Nice Smilo, MHouse, and more
now manufacturer name is saved into file, and will not change randomly, 
added support for JCM
fixed Nice Smilo, MHouse
2022-10-12 04:18:29 +03:00
DerSkythe
702786078d in PNG waves down 2 px, MHZ in Read screen 2022-10-11 22:38:36 +04:00
DerSkythe
e78d73c35f fix PNG, move waves 2px down and code to correct values 2022-10-11 21:56:00 +04:00
gornekich
2552278a3d [FL-2883] NFC: bank card rework reading (#1858)
* nfc: remove bank card save option
* nfc: remove bank card save from nfc device
* nfc: remove unused function in emv
* nfc: try several times to start emv application
* nfc: add AID display fallback for bank cards

Co-authored-by: あく <alleteam@gmail.com>
2022-10-12 02:13:12 +09:00
DerSkythe
34406f0607 flipper_format_free after all and only if we failed with all plans 2022-10-11 21:09:41 +04:00
Nikolay Minaylov
04f5ad83f8 [FL-2828] Dolphin score points update #1809 2022-10-12 01:54:35 +09:00
derskythe
06c0adfe98 Save in last settings FrequencyAnalyzer last feedback set 2022-10-11 18:45:46 +04:00
derskythe
b0d4146c76 Write full name of preset on Read/ReadRAW screen 2022-10-11 18:26:16 +04:00
MX
be293757c0 update changelog 2022-10-11 04:10:54 +03:00
MX
79e7c87b94 Merge pull request #98 from derskythe/fix-read-in-readraw-crash
Add split RAW files ability
2022-10-11 03:42:12 +03:00
MX
b6dfeac7ca rfid fuzzer fix 2022-10-11 03:39:48 +03:00
MX
349a151330 fix memory leak 2022-10-11 03:29:59 +03:00
MX
40dc80499f Merge pull request #97 from derskythe/subbrute-rev3
SubBrute Rev3
2022-10-11 00:57:08 +03:00
MX
b0c31da36a update name 2022-10-11 00:52:43 +03:00
MX
a76259add9 Merge pull request #99 from derskythe/dev-master
Fix line interval
2022-10-11 00:37:25 +03:00
DerSkythe
3f3ee1822a Update upper buttons 2022-10-10 23:24:10 +04:00
DerSkythe
0714df4a4a Fix line interval 2022-10-10 20:30:28 +04:00
DerSkythe
52361b4adf Add split RAW files ability 2022-10-10 20:20:56 +04:00
Der Skythe
61fe66c178 Merge branch 'DarkFlippers:dev' into subbrute-rev3 2022-10-10 19:26:25 +04:00
MX
016ebd3afc update changelog 2022-10-10 16:51:48 +03:00
MX
82b9d74b38 new animation :)
by @Svaarich
2022-10-10 16:47:15 +03:00
MX
6d1929af25 Merge branch 'fz-dev' into dev 2022-10-10 16:44:29 +03:00
MX
384397c282 fix .fap's debug 2022-10-10 16:43:48 +03:00
MX
0abd54ccc8 fix rfid fuzzer crash 2022-10-10 16:43:31 +03:00
MX
ea833d891f discord removes features without new boosts...
so here is new link that will always be available
2022-10-10 16:42:57 +03:00
DerSkythe
9152299562 Fix max value in BF dump brute 2022-10-10 12:53:33 +04:00
Skorpionm
906124b091 [FL-2886] SubGhz: fix text overlap in read (#1853) 2022-10-10 13:43:15 +09:00
DerSkythe
9c0391a887 minor changes 2022-10-10 04:44:23 +04:00
DerSkythe
7ded162c94 add vibro on stop to in-pocket mode 2022-10-10 03:24:44 +04:00
Der Skythe
382f620aff Merge branch 'DarkFlippers:dev' into subbrute-rev3 2022-10-10 03:03:41 +04:00
DerSkythe
323a56e987 fix saving files 2022-10-10 03:05:51 +04:00
DerSkythe
b65a2e9c94 fix send with dump file 2022-10-10 02:52:32 +04:00
DerSkythe
eed8cd1824 fix problem with sending 2022-10-10 01:44:37 +04:00
DerSkythe
500456b03d Returned to Worker model 2022-10-10 00:35:44 +04:00
MX
4b8221d813 add new icon for uart echo
icon by @Svaarich
2022-10-09 23:32:04 +03:00
MX
c7a454752a Merge pull request #95 from hardcod3dd/dev
Turkish language support
2022-10-09 22:41:46 +03:00
hardcod3d
b1f8073333 Turkish language support 2022-10-09 22:34:37 +03:00
MX
e489c57fc0 update changelog 2022-10-09 21:49:59 +03:00
Der Skythe
b4a3ac468f Merge branch 'DarkFlippers:dev' into subbrute-rev3 2022-10-09 21:39:58 +04:00
MX
877a9202fd fix decode raw bugs (blank screen, broken files) 2022-10-09 19:45:39 +03:00
MX
acbe7a10e2 enable hopping with detect raw, and trying to fix crashes
feature still very unstable, use at your own risk!!!
2022-10-09 14:43:18 +03:00
MX
b6b33a70e9 Merge pull request #93 from UberGuidoZ/patch-1
Slight update for newest dev method
2022-10-09 14:38:20 +03:00
MX
1132653d7a Merge branch 'fz-dev' into dev 2022-10-09 14:37:18 +03:00
UberGuidoZ
3fd30a9132 docs: update on FAP build process (#1852) 2022-10-09 09:20:15 +03:00
UberGuidoZ
50e9f7d3ca Slight update for newest dev method 2022-10-08 22:43:08 -07:00
MX
e7de975885 update changelog 2022-10-09 05:19:57 +03:00
MX
f5a1872db4 Desktop: Set external apps as favorites (& fix forgotten record close)
OFW PR 1816 by @djsime1
2022-10-09 05:18:24 +03:00
MX
409d2e5f05 replace usb mouse with new plugin (see readme and changelog) 2022-10-09 04:37:14 +03:00
MX
91d7a38ca6 update changelog and fix subghz issues 2022-10-09 04:24:51 +03:00
MX
00323892f2 rebranding :) 2022-10-09 02:27:38 +03:00
MX
45840a1146 rise and shine mr freeman... 2022-10-09 00:37:22 +03:00
MX
b0c9af9c06 Merge branch 'fz-dev' into dev 2022-10-08 23:11:16 +03:00
DerSkythe
7643fdad7c Seems we have cross-thread violation 2022-10-08 22:54:30 +04:00
Roland Kammerer
a1ede0a2fc BadUSB: add SYSRQ keys (#1460)
This allows sending of SysRq keys[1]. This then for example allows
sending the well known 'reisub' commands to safely reboot a otherwise
frozen Linux box. Or obviously any of the other magic keys.

The advantage compared to sending it to /proc/sysrq-trigger is that one
does not need a shell and depending on how broken the system is, one
might not even be able to get a new shell. The SysRq keys still work.

The cost is adding a new/"non-standard" keyword, IMO it is worth it.

Example:
DEFAULTDELAY 200
DELAY 1000
SYSRQ r
SYSRQ e
SYSRQ i
SYSRQ s
SYSRQ u
SYSRQ b

If one really wants to test it, I suggest h(elp) or w(ait).

[1] https://en.wikipedia.org/wiki/Magic_SysRq_key

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-09 02:56:56 +09:00
DerSkythe
b86f42e7fb Changed protocol info 2022-10-08 21:53:31 +04:00
Sergey Gavrilov
31c0346adc [FL-976] Removing lambdas (#1849)
* Removing lambdas...
* Wake the fk up, Gordon! We have a citadel to burn!
* Here comes the Nihilanth
* Lambda documentation

Co-authored-by: あく <alleteam@gmail.com>
2022-10-09 02:38:29 +09:00
Der Skythe
9ba7e625ca Merge branch 'Eng1n33r:dev' into subbrute-rev3 2022-10-08 21:00:31 +04:00
Sergey Gavrilov
981f7ff8b0 Elf loader: do not load .ARM.* sections (#1850)
* Elf loader: do not load .ARM sections
* Fix section name
2022-10-09 00:51:51 +09:00
SG
c38c42906f Elf loader: do not load .ARM sections 2022-10-08 17:50:26 +03:00
MX
7c8eacb168 Merge branch 'fz-dev' into dev 2022-10-08 15:14:15 +03:00
あく
c13929330e Gui: fix memory leak in file browser module (#1848) 2022-10-08 19:57:53 +09:00
Yukai Li
88ca267466 music_player: Return to browser instead of exiting on back button (#1846)
* music_player: Return to browser instead of exiting on back button
* music_player: Fix number and dots extraction
2022-10-08 19:13:26 +09:00
DerSkythe
1adf76d54d Revert application.fam 2022-10-08 02:25:22 +04:00
DerSkythe
7ec4cb4b7a Fix compile errors 2022-10-08 02:24:19 +04:00
MX
aedde45de8 Merge pull request #92 from an4tur0r/feature/arkanoid_speed
Feature: allow to set ball speed in Arkanoid
2022-10-08 00:20:14 +03:00
MX
184b467f62 add nfc feature back, bug seems to be fixed 2022-10-08 00:03:06 +03:00
DerSkythe
0c5146e047 Merge branch 'dev-master' into subbrute-rev3 2022-10-08 00:42:57 +04:00
an4tur0r
221ac1ed3b allow to set ball speed in Arkanoid 2022-10-07 23:09:17 +03:00
MX
464c725a48 fix debug logs 2022-10-07 23:05:00 +03:00
MX
3e538a8ade bump ver 2022-10-07 22:51:34 +03:00
MX
ae76f45339 sub brute fixes 2022-10-07 22:13:45 +03:00
MX
4cb585e4b9 fix subghz display bug 2022-10-07 21:34:01 +03:00
MX
16ea8dc568 Merge branch 'fz-dev' into dev 2022-10-07 21:11:40 +03:00
MX
4c9d62a33f adapt plugins to furi stream, fix printf formats 2022-10-07 21:05:16 +03:00
Sergey Gavrilov
d10e16ca3c Snake game: nokia 6110-like sound (#1844)
* Snake game: nokia 6110-like sound
* Snake game: blocking sound notifications
* SnakeGame: flush notification queue with backlight enforce block

Co-authored-by: あく <alleteam@gmail.com>
2022-10-08 02:27:32 +09:00
Sergey Gavrilov
37b5e58a60 More correct elf loader (#1839)
* ELF File: more robust section loader
* ELF File: faster and smaller preinit, init and fini arrays handling
* ELF File: load sections on preload stage
* ELF File: naming
* Furi: fix use after free in thread join

Co-authored-by: あく <alleteam@gmail.com>
2022-10-08 02:06:29 +09:00
MX
b4b3c182c5 fixes for new printf and furistream 2022-10-07 18:32:58 +03:00
MX
bdd052937b Merge branch 'fz-dev' into dev 2022-10-07 17:24:20 +03:00
Nikolay Minaylov
1a1f711897 Signal Generator app: UI update (#1829)
* Signal Generator: UI update
* icons renamed

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-07 22:58:36 +09:00
Sergey Gavrilov
4000f0cac5 [FL-2870] Printf function attributes (#1841)
* Furi strings: printf attribute
* Logs: printf attribute
* Plugins: adapt
* Plugins: accommodate
* Unit tests: accommodate

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 22:35:15 +09:00
Nikolay Minaylov
1f742b611a [FL-2651, FL-2863] App name in CLI loader command, RFID data edit fix #1835
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 21:46:58 +09:00
Sergey Gavrilov
38a82a1907 [FL-2839] Furi stream buffer (#1834)
* Core: stream buffer
* stream buffer: API and usage
* stream buffer: documentation
* stream buffer: more documentation
* Furi: fix spelling

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-07 21:27:11 +09:00
Max Andreev
d1843c0094 Disable PVS-Studio license check (#1840) 2022-10-07 16:56:19 +10:00
Matvey Gerasimov
3367bc6f68 Documentation: AppManifests.md typo fix (#1836) 2022-10-07 10:23:21 +04:00
MX
515e6db69c Merge branch 'fz-dev' into dev 2022-10-07 00:35:01 +03:00
MX
81faca79ee remove duplicate allocs from subghz history 2022-10-07 00:31:29 +03:00
Astra
eaa3adf98a [FL-2868] Remove string_push_uint64 (#1832)
* Remove string_pust_uint64
* Oops, furi strings now
* Remove dead code
* Remove unneeded import

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 03:51:30 +09:00
Björn Kimminich
dde18cd343 Add exit label to keyboard connection screen (#1830)
* Add exit label to keyboard connection screen (resolves #1814)
* BtHid: align baselines on connection screen

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:40:18 +09:00
Georgii Surkov
72b3d7f414 [FL-2620] Infrared error message (#1827)
* Show an error message if the remote could not be saved/renamed

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:25:54 +09:00
Astra
19cb469e4b [FL-2877] Don't turn off the backlight on MFC dict attack #1826
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:19:35 +09:00
gornekich
01f7a3e5b5 [FL-2874] Remove bank card uid emulation (#1823)
* nfc: open bank card info from archive
* nfc: remove emulate uid option from bank cards menu

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:12:45 +09:00
Astra
6dde5586af [FL-2803] Mifare Classic read improvements Part 1 (#1822)
* Reuse found keys when reading a card
* Fix keys not being read if no newline at the end of the file
* Actually read all keys from the dictionary
* Support for furi_string
* Check only for re-used key after the current sector
* Declare the key attack function as static
* nfc: change logs, check worker state

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 02:07:56 +09:00
gornekich
5de2c32c81 [FL-2864] NFC update detect reader (#1820)
* nfc: update detect reader view
* nfc: make detect reader more interractive
* nfc: update icons
* nfc: fix detect reader gui
* nfc: fix gui, fix worker events
* nfc: fix notifications
* nfc: add nfc_worker NULL assert

Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 01:58:17 +09:00
Evgenii Tereshkov
69b9c54b2f Update ac.ir: add Daichi model DA25AVQS1-W (#1819)
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 01:18:23 +09:00
MX
dbf4b65d84 update changelog 2022-10-06 19:18:09 +03:00
MX
2ffb246e69 Merge branch 'fz-dev' into dev 2022-10-06 19:17:56 +03:00
Sergey Gavrilov
e3a5df5959 CLI: log command argument (#1817)
Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-07 01:13:02 +09:00
MX
90eefeb2ed Merge pull request #88 from jd-raymaker/dev
Added norwegian keyboard layout
2022-10-06 18:56:33 +03:00
MX
fda541c7fb update changelog 2022-10-06 18:45:53 +03:00
MX
42494d801f fix merge issue 2022-10-06 18:42:59 +03:00
MX
1253a78dba Merge branch 'fz-dev' into dev 2022-10-06 18:41:48 +03:00
Max Andreev
d07c2dbe54 ".fap" extention in file browser and archive tab (#1812)
* Add .fap extention, and Applications tab
* Using new icon, renaming tab to Apps
* Change tabs order
* Add first ugly implementation of in-app icons in archive browser
* Starting using FAPLoader callback
* Getting all metafata from fap
* add app filename fallback
* using fap_loader_item_callback in archive_list_item_cb
* FAP-Loader: removed minimal allocation
* Removed strange code

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-10-07 00:37:53 +09:00
nminaylov
8f1812655e CLI loader shows app name, rfid edit fix 2022-10-06 18:26:15 +03:00
MX
3802171009 Revert "Merge branch 'fz-dev' into dev"
This reverts commit 03ad1770f8.
2022-10-06 18:23:50 +03:00
MX
03ad1770f8 Merge branch 'fz-dev' into dev 2022-10-06 18:23:44 +03:00
MX
b86756b581 don't include example app in releases 2022-10-06 17:58:18 +03:00
Skorpionm
11681d8ee8 [FL-2866, FL-2865] SubGhz: add frequency analyzer history (#1810)
* SubGhz: frequency analyzer history
* SubGhz: add vibro
* SubGhz: turn on the display when receiving a signal
* SubGhz: add signal reception indicator
* SubGhz: fix indicator
* SubGhz: fix FA history

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 23:48:29 +09:00
Skorpionm
061f53cd3c [FL-2849] SubGhz: read RAW auto generation of names (#1772)
* SubGhz: read RAW auto auto generation of names depending on the date of the entry
* SubGhz: name generation modification RAW-YYYYMMDD-HHMMSS
* SubGhz: replace m-string with FuriString

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 23:43:17 +09:00
MX
4bbeeb19e2 Merge branch 'fz-dev' into dev 2022-10-06 17:31:43 +03:00
Georgii Surkov
61189c3c82 [FL-2847] FFF trailing space fix (#1811)
* Improve whitespace handlilng in FFF
* Add tests for odd fff user input
* Adjust formatting

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 23:18:20 +09:00
hedger
9bf11d9fd2 [FL-2859,2838] fbt: improvements for FAPs (#1813)
* fbt: assets builder for apps WIP
* fbt: automatically building private fap assets
* docs: details on how to use image assets
* fbt: renamed fap_assets -> fap_icons
* fbt: support for fap_extbuild field
* docs: info on fap_extbuild
* fbt: added --proxy-env parame ter
* fbt: made firmware_cdb & updater_cdb targets always available
* fbt: renamed fap_icons -> fap_icon_assets
* fbt: deprecated firmware_* target names for faps; new alias is "fap_APPID"
* fbt: changed intermediate file locations for external apps
* fbt: support for fap_private_libs; docs: updates
* restored mbedtls as global lib
* scripts: lint.py: skip "lib" subfolder
* fbt: Sanity checks for building advanced faps as part of fw
* docs: info on fap_private_libs; fbt: optimized *.fam indexing
* fbt: cleanup; samples: added sample_icons app
* fbt: moved example app to applications/examples
* linter fix
* docs: readme fixes
* added applications/examples/application.fam stub
* docs: more info on private libs

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 22:55:57 +09:00
MX
c76fcf5072 Merge branch 'fz-dev' into dev 2022-10-06 15:50:59 +03:00
MX
007a11d70d upd ofw pr 1832 2022-10-06 15:26:23 +03:00
MX
b61e41163b fix subghz double click after delete, fix rename bug, fix unirf 2022-10-06 15:10:08 +03:00
Nikolay Minaylov
a69e150e2f [FL-2812] RFID: write fix for some protocols #1828
Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 20:36:21 +09:00
Matvey Gerasimov
f16cdd1477 fix: typo badusb demo windows (#1824)
Fix a typo in the badusb demo script for Windows.

Co-authored-by: あく <alleteam@gmail.com>
2022-10-06 20:18:40 +09:00
MX
ac286dfed8 fix subghz bruteforcer, change subghz raw naming 2022-10-06 14:10:56 +03:00
MX
a93008b218 fix rfid fuzzer 2022-10-06 03:09:20 +03:00
MX
31aaa593fc fixes, rfid fuzzer still crashes 2022-10-06 02:30:40 +03:00
MX
5a2719663f fix archive, update changelog 2022-10-06 00:55:26 +03:00
JayDee Raymaker
adccb87499 Added norwegian keyboard layout 2022-10-05 23:26:24 +02:00
MX
693f78e501 update icon naming
OFW PR 1829 by nminaylov
2022-10-05 23:15:14 +03:00
MX
6eb610762e bump api version 2022-10-05 21:40:06 +03:00
MX
3e4d8a41e0 Remove string_push_uint64
OFW PR 1832 by Astrrra
2022-10-05 21:39:40 +03:00
MX
c60bfbf271 oh no 2022-10-05 21:27:13 +03:00
MX
0796263e81 Merge branch 'fz-dev' into dev 2022-10-05 19:27:46 +03:00
Sergey Gavrilov
4bf29827f8 M*LIB: non-inlined strings, FuriString primitive (#1795)
* Quicksave 1
* Header stage complete
* Source stage complete
* Lint & merge fixes
* Includes
* Documentation step 1
* FBT: output free size considering BT STACK
* Documentation step 2
* py lint
* Fix music player plugin
* unit test stage 1: string allocator, mem, getters, setters, appends, compare, search.
* unit test: string equality
* unit test: string replace
* unit test: string start_with, end_with
* unit test: string trim
* unit test: utf-8
* Rename
* Revert fw_size changes
* Simplify CLI backspace handling
* Simplify CLI character insert
* Merge fixes
* Furi: correct filenaming and spelling
* Bt: remove furi string include

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-10-06 00:15:23 +09:00
MX
baf5034817 Merge pull request #87 from derskythe/feat-add-subbrute-frequency
Add CAME 12bit 303MHz to SubBrute
2022-10-05 17:26:02 +03:00
derskythe
04e16970db Add CAME 12bit 303MHz to SubBrute 2022-10-05 17:45:45 +04:00
MX
a8b48771e4 rfid fuzzer, ability to change time delay 2022-10-04 23:43:15 +03:00
MX
1424878d65 update assets and changelog 2022-10-04 21:40:07 +03:00
MX
a37b0d464c Signal Generator app: UI update
OFW PR 1829 by nminaylov
2022-10-04 21:07:10 +03:00
MX
96502e21ae RFID: write fix for some protocols
OFW PR 1828 by nminaylov
2022-10-04 21:06:16 +03:00
MX
b5d6d60535 New notification sequence for Frequency Analyser
PR #86 by @BastienB3
2022-10-04 21:05:09 +03:00
MX
32e64fd29e update changelog 2022-10-04 18:40:57 +03:00
MX
8f9d81b972 Merge pull request #84 from colingrady/wrap_rfid_fuzzer_menu
Allow the RFID protocol menu to wrap
2022-10-04 18:25:29 +03:00
MX
23e0566273 Merge pull request #85 from mvanzanten/adding-on-the-fly-changes-ui-addition
Improve UI for added on-the-fly feature
2022-10-04 18:25:07 +03:00
MX
4141483147 NFC update detect reader
OFW PR 1820 by gornekich
2022-10-04 18:23:11 +03:00
Matt Van Zanten
30e005d5c4 improve UI for added on the fly feature 2022-10-04 08:07:53 -07:00
MX
e3a2711eb3 Remove bank card uid emulation & fix emv info
OFW PR 1823 by gornekich
2022-10-04 18:05:57 +03:00
MX
8569641ce6 Infrared error message
OFW PR 1827 by gsurkov
2022-10-04 18:02:21 +03:00
MX
cafd06c71b Don't turn off the backlight on MFC dict attack
OFW PR 1826 by Astrrra
2022-10-04 17:59:22 +03:00
MX
06a7bda69b block hopping and detect raw at same time
and fix freq analyzer feedback display backlight
2022-10-04 17:58:12 +03:00
Colin Grady
c43ce93936 Allow the RFID protocol menu to wrap 2022-10-04 08:53:58 -06:00
MX
2288855163 update assets and changelog 2022-10-04 03:29:02 +03:00
MX
c0765c1114 rfid fuzzer H10301 support and bug fixes 2022-10-04 03:15:28 +03:00
MX
683c6254da Merge remote-tracking branch 'origin/dev' into dev 2022-10-04 02:36:19 +03:00
MX
2ef515ef56 Merge pull request #83 from mvanzanten/adding-on-the-fly-changes-2
Adding on the fly bit changes
2022-10-04 02:35:57 +03:00
MX
667be798fc rfid fuzzer, fix bugs, improve gui, add PAC/Stanley support
add more example files
2022-10-04 02:33:39 +03:00
MX
0f9598099a fix rfid fuzzer crash, fix bug when dict attack can't be restarted 2022-10-04 01:15:15 +03:00
MX
0d6f729386 CLI: log command argument (log level)
OFW PR 1817 by DrZlo13
2022-10-04 00:48:25 +03:00
MX
b452b6fd32 FFF trailing space fix
OFW PR 1811 by gsurkov
2022-10-04 00:45:09 +03:00
Matt Van Zanten
9403128a03 moving to center nicer 2022-10-03 11:32:10 -07:00
Matt Van Zanten
71589b28a7 removing debug logs 2022-10-03 11:09:51 -07:00
Matt Van Zanten
8b0fa6d0b1 running fbt format 2022-10-03 11:07:16 -07:00
Matt Van Zanten
cf47da0ff4 Merge branch 'dev' into adding-on-the-fly-changes-2 2022-10-03 10:47:17 -07:00
Matt Van Zanten
d6b7fae7e4 working version of the on the fly bit switcher 2022-10-03 10:29:04 -07:00
MX
110dc48b96 Merge remote-tracking branch 'origin/dev' into dev 2022-10-03 18:42:52 +03:00
MX
37c666ddf5 Merge pull request #82 from TQMatvey/pr_temp
SubGhz: Enable backlight on new signal
2022-10-03 18:42:18 +03:00
MX
6ddca568b9 correct notification sequence 2022-10-03 18:41:37 +03:00
MX
8993db56b8 this was not part of previous change 2022-10-03 18:40:22 +03:00
MX
3c1efda1db return carrier test included with non debug builds 2022-10-03 18:36:06 +03:00
MX
b62b7956a6 Merge pull request #80 from derskythe/fix-read-in-readraw-crash
Fix-read-in-readraw-crash
2022-10-03 18:27:54 +03:00
MX
dce5af5c2e hmm 2022-10-03 18:22:09 +03:00
MX
fbacdc5b7b fix critical bug with subghz rpc 2022-10-03 18:21:18 +03:00
MX
8dba4f25ae unused 2022-10-03 18:20:49 +03:00
derskythe
43ef4046ed Add stubs for split 2022-10-03 19:00:35 +04:00
mvanzanten
1e63f57bf7 working version, change bits on the fly 2022-10-02 12:06:06 -07:00
Matt Van Zanten
649887fe0f progress, adding on the fly 2022-10-02 08:18:01 -07:00
derskythe
be42c390f2 Save on SD Card only RAW files 2022-10-02 16:57:32 +04:00
derskythe
cbda5d996f Fix uncommited merge 2022-10-02 16:50:03 +04:00
derskythe
de1ec97512 Merge remote-tracking branch 'refs/remotes/origin/fix-read-in-readraw-crash' into fix-read-in-readraw-crash 2022-10-02 16:20:18 +04:00
MX
8af749c965 enable saving detect raw state via define 2022-10-02 13:50:29 +03:00
MX
4d3f45e911 Don’t show temp history dir in filebrowser 2022-10-02 10:18:31 +03:00
MX
63fee41a1f enable worker back 2022-10-02 09:51:27 +03:00
TQMatvey
f441fed68d SubGhz: Follow system backlight timer 2022-10-02 13:48:06 +07:00
TQMatvey
6e0eeed773 SubGhz: turn on display for new signal 2022-10-02 13:29:16 +07:00
MX
6bf306200e make loading subghz file from favourites a bit faster 2022-10-02 08:50:41 +03:00
MX
e2faf31b45 debug in subghz only when compiled with DEBUG=1 2022-10-02 07:34:39 +03:00
MX
85eb740559 do not save detect raw on/off settings 2022-10-02 06:38:34 +03:00
MX
cea14ae9c5 fix dir creation bug, save files only for RAW
TODO: files are broken when they have more than 512 elements in one line
Split file to 512 element chunks as it done in regular Read RAW
2022-10-02 06:23:09 +03:00
MX
e9a11cfce0 Merge branch 'dev' into fix-read-in-readraw-crash 2022-10-02 04:06:01 +03:00
MX
87a14b96e1 Merge branch 'fz-dev' into dev 2022-10-02 04:05:07 +03:00
derskythe
bbd3f9cf71 Fixed all bugs with saving directly to file, also fixed misspeled if/ifdef in all app 2022-10-02 03:18:30 +04:00
derskythe
230f09dddd enable delete temp files 2022-10-01 08:47:44 +04:00
derskythe
24e744f1d1 Added saving DetectRAW settings, trying to write files on SD instead of memory 2022-10-01 08:39:51 +04:00
derskythe
127b700642 Init work on rev3, but this is not working code 2022-09-30 18:36:56 +04:00
あく
0f9ea925d3 UnitTests: fix thread join test (#1808) 2022-09-30 22:03:57 +09:00
Nikolay Minaylov
836de3df16 [FL-2825] iButton GUI fixes (#1805)
* Ibutton GUI fixes
* Fix memory leak in lfRFID write

Co-authored-by: あく <alleteam@gmail.com>
2022-09-30 21:56:12 +09:00
Sergey Gavrilov
c92217a109 Thread: Clear TLS after thread stop (#1807) 2022-09-30 19:59:11 +09:00
MX
41c93431c8 update changelog, readme, assets 2022-09-30 03:46:06 +03:00
MX
f0ea8f3a84 fix clock am/pm logic 2022-09-29 23:50:49 +03:00
MX
4d8f294e7a Merge pull request #79 from derskythe/subghz-freq-analyzer-long-press
Long press OK button in SubGHz Frequency analyzer switch to Read menu
2022-09-29 23:26:02 +03:00
derskythe
f543753873 Long press OK button in SubGHz Frequency analyzer switch to Read menu with selected frequency 2022-09-29 23:46:54 +04:00
MX
1fb1a68842 iButton GUI fixes
OFW PR 1805 by nminaylov
2022-09-29 20:56:04 +03:00
MX
54fedb9bc8 Merge pull request #78 from alexberkowitz/dev
Increase Sub-GHz remote label line length to 16
2022-09-29 18:34:22 +03:00
MX
8af9c00ddb Merge branch 'fz-dev' into dev 2022-09-29 18:20:05 +03:00
Sergey Gavrilov
5a22803bbc Revert "Revert "Furi Thread: don't use thread pointer after FuriThreadStateStopped callback (#1799)""
This reverts commit 7df70d7c62.
2022-09-29 18:15:02 +03:00
Alex Berkowitz
824f5ea027 Merge branch 'Eng1n33r:dev' into dev 2022-09-29 10:04:21 -05:00
hedger
76d38e832e fbt: reproducible manifest builds & improvements (#1801)
* fbt: reproducible manifest builds, less rebuild on small updates; scripts: assets: using timestamp from commandline af available
* fbt: added app import validation for launch_app & single app build targets
* fbt: COMSTR for app imports validation
* docs: minor fixes
* docs: markdown fix
* vscode: comments for RTOS startup

Co-authored-by: あく <alleteam@gmail.com>
2022-09-29 20:00:22 +09:00
Sergey Gavrilov
aba20b6af8 Furi Thread: fixed furi_thread_join, check if thread has not been started (#1803)
* furi thread: fixed furi_thread_join, check if thread has not been started
* Furi: correct returns in furi_thread_join

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-09-29 19:42:15 +09:00
MX
226f8517f3 update readme and changelog 2022-09-29 11:01:15 +03:00
Sergey Gavrilov
7df70d7c62 Revert "Furi Thread: don't use thread pointer after FuriThreadStateStopped callback (#1799)"
This reverts commit 5883e134d4.
2022-09-29 09:27:03 +03:00
MX
9176387b9f update assets and changelog 2022-09-29 09:14:47 +03:00
MX
972c0dcb4a hide layouts folder in badusb app 2022-09-29 08:20:30 +03:00
MX
62e56e2618 rename apps to make it look a bit better in Apps tab in archive app
now old assets are removed so we can avoid duplicates
2022-09-29 08:20:00 +03:00
MX
f202d27206 Merge branch 'fz-dev' into dev 2022-09-29 05:57:02 +03:00
Mewa
bcfb12bf28 Keyboard: show Uppercase keys when replacing content (#1548)
Co-authored-by: あく <alleteam@gmail.com>
2022-09-29 02:44:24 +09:00
Sergey Gavrilov
5883e134d4 Furi Thread: don't use thread pointer after FuriThreadStateStopped callback (#1799)
* Furi Thread: correct furi_thread_join, do not use thread pointer after FuriThreadStateStopped callback
* Furi: a little bit easier way to do harakiri
* Furi: crash on thread self join attempt

Co-authored-by: あく <alleteam@gmail.com>
2022-09-29 02:37:07 +09:00
hedger
f8b532f063 [FL-2831] Resources cleanup in updater (#1796)
* updater: remove files from existing resources Manifest file before deploying new resources
* toolbox: tar: single file extraction API

Co-authored-by: あく <alleteam@gmail.com>
2022-09-29 02:13:12 +09:00
Vyacheslav Tumanov
e25b424188 Typos fix in some strings/comments #1794
Co-authored-by: あく <alleteam@gmail.com>
2022-09-29 01:52:46 +09:00
Nikolay Minaylov
4241ad24a3 [FL-2797] Signal Generator app (#1793)
* Signal Generator app
* MCO pin initialization in app
* furi_hal_pwm documentation

Co-authored-by: あく <alleteam@gmail.com>
2022-09-29 01:37:24 +09:00
MX
6bcc6f363b add 868.8 mhz for sommer systems 2022-09-28 16:35:40 +03:00
MX
3dcd8a73f1 update changelog 2022-09-28 08:06:47 +03:00
MX
9ad7f7825d update projector asset
by @Amec0e
2022-09-28 07:50:43 +03:00
MX
aa00606d22 remove unnecessary checks from brute plugin, subghz improvements
fix subghz gui in add manually, add BETT protocol in add manually
2022-09-28 07:50:09 +03:00
MX
9c62e1f6ac Merge pull request #77 from derskythe/subghz-save-settings-v2
SubGHz save settings version 2
2022-09-28 07:00:15 +03:00
MX
b934c41ed0 close file 2022-09-28 06:51:13 +03:00
MX
0ebb3f060e add a bit of changes 2022-09-28 06:46:45 +03:00
derskythe
8f2bd3be57 Update list of frequencies and change name of file of settings to not able to run in browser 2022-09-28 07:14:38 +04:00
derskythe
cc02d57857 Merge remote-tracking branch 'origin/subghz-save-settings-v2' into subghz-save-settings-v2
# Conflicts:
#	applications/main/subghz/subghz_last_settings.c
2022-09-28 07:09:58 +04:00
MX
0c5f11f713 return fix 2022-09-28 06:02:23 +03:00
derskythe
006d27ed93 Add removed fixed 2022-09-28 06:53:52 +04:00
MX
746b732034 remove unused code 2022-09-28 05:49:21 +03:00
Der Skythe
2ec9aeeefa Merge branch 'Eng1n33r:dev' into subghz-save-settings-v2 2022-09-28 06:32:54 +04:00
derskythe
8be08093e2 Change name of file to not able to "Run in App" in Browser 2022-09-28 06:28:23 +04:00
derskythe
406247c5d8 Ok button in frequency analyzer will set this frequency to receiver 2022-09-28 06:22:02 +04:00
derskythe
22a87d5707 struct doesn't correct written 2022-09-28 05:49:06 +04:00
MX
4271246d8a Merge branch 'fz-dev' into dev 2022-09-28 04:04:12 +03:00
derskythe
a3db6718c2 fix bug with invalid settings values in config 2022-09-28 04:31:29 +04:00
derskythe
0f0473bee6 fix bug with invalid settings values in config 2022-09-28 03:27:47 +04:00
derskythe
497be7ccb0 Last SubGHz settings is ready 2022-09-28 02:01:09 +04:00
Georgii Surkov
12a6290e91 [FL-2853] Reorganise Universal A/C library (#1792)
* Reorganise A/C universal remote library file
* Refactor infrared brute force code
* Update UniversalRemotes.md

Co-authored-by: あく <alleteam@gmail.com>
2022-09-28 02:11:28 +09:00
Tom Samstag
e6e1e7fe15 Add formatting to DESfire data dump (#1784)
Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-09-28 02:02:18 +09:00
MX
cb14d23108 format, add chamberlain 9bit 300mhz 2022-09-27 04:31:52 +03:00
MX
c4783664c0 subghz bruteforcer plugin: move title a bit 2022-09-27 00:51:36 +03:00
MX
91f3774246 update changelog 2022-09-26 23:55:39 +03:00
MX
1f8a034a71 Merge pull request #76 from derskythe/subbrute-deep-refactor
Fix speed problems with linear and some bugs
2022-09-26 23:09:13 +03:00
MX
8cc3e2f35a remove extra environment alloc 2022-09-26 23:07:53 +03:00
MX
069dd29f08 Revert "some fixes, trying to speed up bruteforce(unsuccessful)"
This reverts commit 61fee8e269.
2022-09-26 22:52:22 +03:00
derskythe
91c06a2168 fix disable env allocation many times 2022-09-26 21:41:49 +04:00
derskythe
545c4349d6 add vibro on finish and main menu set left 2022-09-26 21:26:51 +04:00
derskythe
a40e1a2be2 set big step to 50 2022-09-26 21:15:46 +04:00
derskythe
286300b35b fix disable env allocation many times 2022-09-26 21:15:02 +04:00
derskythe
633145495c fix twice button press in manual mode 2022-09-26 21:10:41 +04:00
derskythe
a0bcbf731d fix error on back when selecting existing dump 2022-09-26 21:01:14 +04:00
MX
60242cd7c4 fix nfc device typo, doesn’t affect resulting keys 2022-09-26 19:46:12 +03:00
Alex Berkowitz
3e9409a1a8 Merge branch 'dev' of https://github.com/alexberkowitz/flipperzero-firmware into dev 2022-09-26 11:43:31 -05:00
MX
a9210b2849 Merge branch 'fz-dev' into dev 2022-09-26 19:37:37 +03:00
derskythe
a58807c57a Add SubGhzTxRxWorker for later use 2022-09-26 20:14:33 +04:00
Sergey Gavrilov
5bb7cabea6 Applications loader: do not use view dispatcher queue #1788 2022-09-27 00:59:28 +09:00
phreakocious
f201062819 Add Hisense A/C IR signals.. (#1773)
* add Hisense A/C IR signals.. note that using any will toggle the power and apply the settings
* re-order the entries to be grouped by function

Co-authored-by: あく <alleteam@gmail.com>
2022-09-27 00:42:29 +09:00
Shane Synan
9f501034c3 Power: Also ask charger if charge done (#1378)
* power: Also ask charger if charge done
* F7: bump API Symbols version
* Lib: remove double include in bq25896.c

Co-authored-by: あく <alleteam@gmail.com>
2022-09-27 00:34:59 +09:00
derskythe
7bd0c8ff2c application.fam revert 2022-09-26 18:30:04 +04:00
derskythe
cdcf80ed05 speed-up linear to 07:10 2022-09-26 18:27:58 +04:00
Georgii Surkov
3e3a167764 [FL-2852] Update Universal Remote documentation (#1786)
* Update Universal Remote documentation
* Change formatting
2022-09-26 22:49:18 +09:00
MX
fa9602bd68 Merge branch 'fz-dev' into dev 2022-09-26 15:27:24 +03:00
hedger
efb09380bd [FL-2836] Fast flash programming mode (#1782)
* updater: lowered logging level for resources unpacking; hal: implemented fast flash write mode
* hal: reworked fast flash programming; clearing most error flags on flash init; changed some flash functions return type from bool to void; scripts: fixed malformed CRC values in update bundles in certain cases;
* hal: flash: larger critical section
* hal: flash: enabling fast write inside critical section
* api_symbols: bump minor version
2022-09-26 20:03:21 +09:00
MX
61fee8e269 some fixes, trying to speed up bruteforce(unsuccessful) 2022-09-26 06:24:47 +03:00
MX
5e30b14d90 update changelog 2022-09-26 02:12:11 +03:00
MX
c07e3a34dd Merge pull request #75 from derskythe/subbrute-deep-refactor
SubBrute deep refactor
2022-09-26 02:08:45 +03:00
MX
be7e11e60f Merge branch 'dev' into subbrute-deep-refactor 2022-09-26 02:06:50 +03:00
MX
e96e414561 Merge branch 'fz-dev' into dev 2022-09-26 02:06:09 +03:00
derskythe
0c99cb52ec free transmitter during subbrute_worker_init_manual_transmit 2022-09-26 02:45:09 +04:00
derskythe
ad9e1ce4df set furi_hal_subghz_set_path to FuriHalSubGhzPathIsolate on each manual iteration 2022-09-26 02:42:39 +04:00
derskythe
22dc5190d1 remove furi_hal_power_suppress_charge_enter/exit from other places 2022-09-26 02:39:17 +04:00
derskythe
f2fd97d9c5 fix memory leaks 2022-09-26 02:36:38 +04:00
derskythe
08084d5763 fix first send signal equals last transferred or 0x00 2022-09-26 02:03:36 +04:00
derskythe
add1ad6949 fix manual select key on max and min values 2022-09-26 01:48:51 +04:00
DerSkythe
87654e60b8 Merge remote-tracking branch 'origin/subbrute-deep-refactor' into subbrute-deep-refactor 2022-09-26 01:10:21 +04:00
DerSkythe
6f92cd645e fixed frame width to scroll 2022-09-26 01:09:00 +04:00
DerSkythe
23f6ea2e05 refactor worker moved it to SubBruteState 2022-09-26 01:07:16 +04:00
David Coles
a6b98ccbbe Preliminary Rust support (#1781)
* Add support for R_ARM_THM_MOVW_ABS_NC/THM_MOVT_ABS

These are sometimes emitted by the Rust LLVM compiler.

Ref: https://github.com/ARM-software/abi-aa/blob/main/aaelf32/aaelf32.rst#56relocation

* Discard LLVM bitcode from extension applications

LLVM-based compilers may include uncompressed bitcode in object files
to help with link-time optimization. However this can bloat binary sizes
from KB to MB.

* Expose alligned_malloc/free functions to applications

This is required to implement a global allocator in Rust.
2022-09-26 07:06:46 +10:00
DerSkythe
ba5f590dab switched to manual transmit 2022-09-26 00:07:14 +04:00
Der Skythe
f1048733d2 Merge branch 'Eng1n33r:dev' into subbrute-deep-refactor 2022-09-25 23:16:27 +04:00
DerSkythe
ea7f68fcab fixed load existing dump 2022-09-25 23:12:31 +04:00
MX
8013aacd94 oops 2022-09-25 21:03:32 +03:00
MX
be8f409098 update changelog 2022-09-25 21:01:12 +03:00
MX
97e6fe8f4e update universal remote assets
by @amec0e
2022-09-25 20:39:22 +03:00
DerSkythe
54757428e6 fix bug with return to main menu when choice file 2022-09-25 21:31:33 +04:00
MX
bd39d81324 Merge branch 'fz-dev' into dev 2022-09-25 19:55:35 +03:00
Chris van Marle
2a2078d9b5 Text input overwrite max size template (#1687) 2022-09-26 01:17:09 +09:00
MX
01ca588488 Merge branch 'fz-dev' into dev 2022-09-25 18:27:58 +03:00
Kowalski Dragon
f86eada292 Remove unused headers (#1751) 2022-09-25 23:39:06 +09:00
Skorpionm
bc777b2eff SubGhz: fix config menu (#1748)
* SubGhz: fix config menu
* SubGhz: fix gui Magellen protocol
* SubGhz: fix gui Transmit SubGhz
* SubGhz: keeloq, new gen manufacture code
* SubGhz: Update keeloq_mfcodes

Co-authored-by: あく <alleteam@gmail.com>
2022-09-25 23:34:52 +09:00
DerSkythe
6f91fa42f0 Added additional graphic decorations 2022-09-25 18:26:10 +04:00
Sergey Gavrilov
e6d22ed147 ELF-Loader: C++ plugin support, loader overhaul. (#1744)
* fap-loader: load all code and data sections
* fap-loader: relocate all code and data sections
* fap-loader: remove old elf loader
* fap-loader: new jmp call relocation
* openocd: resume on detach
* fap-loader: trampoline for big jumps
* fap-loader: rename cache
* fap-loader: init_array support
* fap-loader: untangled flipper_application into separate entities
* fap-loader: fix debug
* fap-loader: optimize section container
* fap-loader: optimize key for section container
* fap-loader: disable debug log
* documentation
* F7: bump api symbols version
* Lib: cleanup elf_file.c

Co-authored-by: あく <alleteam@gmail.com>
2022-09-25 23:11:29 +09:00
MX
436f70b69b Merge branch 'fz-dev' into dev 2022-09-25 16:46:23 +03:00
DerSkythe
ec9ce0cad7 Working prototype, but not yet tested on a real device 2022-09-25 17:05:52 +04:00
Jauder Ho
7e2008095e Bump protobuf from 3.20.1 to 3.20.2 in /scripts (#1774) 2022-09-25 20:56:53 +09:00
Sergey Gavrilov
92e440c77d Core: simplify record container (#1776)
Co-authored-by: あく <alleteam@gmail.com>
2022-09-25 20:48:57 +09:00
DerSkythe
666821e9ce SubBruteMainView is ready 2022-09-25 00:46:43 +04:00
MX
1bca477a43 update install instructions
thanks to @Svaarich !
2022-09-24 22:20:13 +03:00
MX
41571ce9ad SubGHz RAW - datetime in default names (+ format changed)
OFW PR 1772 by Skorpionm / printf text format changed by me
2022-09-24 22:15:06 +03:00
MX
038d098c85 Merge branch 'fz-dev' into dev 2022-09-24 21:56:17 +03:00
DerSkythe
b03cc8ddc3 trying to fix load failure 2022-09-24 22:30:08 +04:00
DerSkythe
c8e3d9b040 fix repeat call of view_dispatcher_alloc 2022-09-24 22:15:09 +04:00
DerSkythe
aeb02500de Deep refactor of SubBrute was made, but it doesn't start. Debug device needed 2022-09-24 21:47:21 +04:00
ghettorce
eadd7801af fbt: exclude user site-packages directory from sys.path (#1778)
* fbt: exclude user site-packages directory from sys.path
* fbt: python path fixes for *nix
* fbt: fixed cli target on Windows

Co-authored-by: hedger <hedger@users.noreply.github.com>
2022-09-24 15:30:19 +04:00
Yoanndp
6d2b0a3b6c Update ReadMe.md (#1766) 2022-09-24 19:36:11 +09:00
Alex Berkowitz
8093721c24 Change Sub-Ghz Remote line length max to 16 2022-09-23 20:37:02 -05:00
MX
32a7642761 remove duplicate function, update changelog 2022-09-22 21:51:47 +03:00
MX
e8bb45496d Merge branch 'fz-dev' into dev 2022-09-22 21:45:26 +03:00
Andrea Sacchi
3846852f2b NFC Fix Mifare Classic (#1769)
* Fix Mifare Classic key str to int conversion: Wrong cast lead to unexpected behavior converting key from str to int.
* Nfc: fix type cast in mf_classic_dict and add basic unit tests

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-09-23 02:35:28 +09:00
Georgii Surkov
17d01f5c29 [FL-2848] Universal Remote fix (#1770)
* Reset BruteForce on exit from Universal Remote
* Reset current button in ButtonPanel
2022-09-23 01:13:00 +09:00
MX
e6bcba6959 update changelog, minor fixes 2022-09-22 18:23:32 +03:00
MX
e13edc2f70 keeeloq update 2022-09-22 18:01:54 +03:00
MX
de6ff1d9c9 update changelog 2022-09-21 23:07:39 +03:00
MX
bea15134ba fix mousejacker gui 2022-09-21 22:29:42 +03:00
MX
28a55bf576 Merge branch 'fz-dev' into dev 2022-09-21 22:02:02 +03:00
gornekich
e70121e20f [FL-2843] NFC fixes (#1764)
* nfc: fix empty desfire card message
* nfc: limit total user keys to list
* nfc: increase popup timeout

Co-authored-by: あく <alleteam@gmail.com>
2022-09-22 00:53:25 +09:00
hedger
432ff41d6a [FL-2844] desktop: removing slideshow file when leaving slideshow view (#1762)
* [FL-2844] desktop: removing slideshow file when leaving slideshow view; vscode: fix for BM port fetcher; fap api: more symbols for LL
* desktop: actually removing slideshow file
* desktop: moved slideshow removal to scene code; fbt: better blackmagic device handling
* fbt: disabled pagination for gdb
* vscode: restored blackmagic command line
* fbt: fixed debug_other target; added debug_other_blackmagic
* furi: added furi_thread_suspend API group; fixed null-pointer deref for thread name; cleaned up RTOS config
* furi: changed thread state check to eTaskGetState
2022-09-21 23:42:59 +09:00
MX
87393a086c fix rfid fuzzer crashes, some new random names 2022-09-21 08:43:07 +03:00
MX
6000d47a0f allow saving only for protocols without encoder 2022-09-21 07:12:09 +03:00
MX
d986ef4104 fix nice flor s crash, fix debug pack for debug builds 2022-09-21 06:52:34 +03:00
MX
f85dc1675d update changelog, rm unused var from clock 2022-09-21 01:00:56 +03:00
MX
7c7ac07e6a Merge pull request #74 from mvanzanten/adding-support-for-hidprox
adding support for HIDProx, updating the UI to switch between protocols
2022-09-20 23:25:45 +03:00
MX
ca02826cfd set time between cards to 6, run fbt format 2022-09-20 23:24:34 +03:00
MX
96ad7f3cef fix nfc list crash, fix magellen gui, fix transmitter gui 2022-09-20 23:13:15 +03:00
Matt Van Zanten
c213ff596a adding support for HIDProx, updating the UI to switch between protocols 2022-09-20 11:45:16 -07:00
MX
b2589698ff Merge branch 'fz-dev' into dev 2022-09-20 21:39:22 +03:00
Max Lapan
3360f818a1 Subghz: Adding checks for get_upload functions (#1704)
* Adding checks for get_upload functions
  Almost in every protocol, function which generates upload might fail and return false.
  But we don't check this result, which might end up sending random memory contents to the air.
* Format sources and fix crash on ivalid bit count in chamberlain

Co-authored-by: あく <alleteam@gmail.com>
2022-09-20 14:29:10 +09:00
Georgii Surkov
066da4080b [FL-2792] AC Universal Remote (#1725)
* Add Universal AC Remote scene
* Implement AC gui
* Basic working implemetation
* Another Universal AC Remote implementation
* Update icons
* Adjust button positions
* Revert old ButtonPanel class
* Update resource manifest
* [FL-2627] Flipper applications: SDK, build and debug system (#1387)
* Update api definitions
* Add UniversalRemotes documentation
* Use more Flipper-friendly signal names

Co-authored-by: SG <who.just.the.doctor@gmail.com>
2022-09-20 14:09:37 +09:00
MX
b2c118f267 fix null pointer dereference in archive -> Info
and fix long path display
2022-09-20 05:52:13 +03:00
MX
a8db46124e update docs & changelog 2022-09-20 04:09:14 +03:00
MX
672e27f258 fix icon name 2022-09-20 03:23:22 +03:00
MX
e762a68265 Merge pull request #72 from RogueMaster/ApplicationsFromArchive
Applications from archive
2022-09-20 03:20:25 +03:00
MX
8659becc9d fix tab name and add new icon
icon by @Svaarich
2022-09-20 03:19:31 +03:00
RogueMaster
82e1e8af6a Enable fap support on Archive app 2022-09-19 18:47:22 -04:00
RogueMaster
a71d05a114 Update archive_browser.h 2022-09-19 18:39:38 -04:00
MX
8d68bf62a5 update changelog 2022-09-19 23:34:31 +03:00
MX
2c85adb270 remove unused icon, update api symbols and unirf 2022-09-19 21:21:31 +03:00
MX
e2123c55bb Merge branch 'fz-dev' into dev 2022-09-19 21:15:04 +03:00
David
f5ff6438d1 NFC user dict list, delete, and de-duplication. (#1533)
* Add MFC user keys list
* Leakey submenu fix
* Set next target for Save/Delete success scenes
* Delete individual user keys
* Update count of total keys
* Fix memory leak
* Check for duplicate keys
* Remove a submodule that I never added?
* Swap and position icons
* Revamp according to design doc
* Rename icons to include size and replace keychain icon with smaller variant
* Fix typos
* Final fixes
* Fufill requested changes
* Cleanup comments
* Merge dev after SD app loading
* Fixing icon names
* Revert merge mistakes and API version
* Scene switching adjustments
* F7: add/change/remove some nfc icons in api_symbols.csv

Co-authored-by: あく <alleteam@gmail.com>
2022-09-20 01:43:53 +09:00
Astra
9f3b80e606 Add new card parsers (#1503)
* Add the "Two cities" parser
* Add plantain and plantain4k parsers
* Add new parsers to the supported list
* United card PoC
* Fix nfc device not sleeping
* Completely read the 4K troika variants
* Correct naming
* Update to reflect upstream changes
* Add support for MfUl info
* Fix parsers
* Card type detection fixes
* Remove debug info
* Fixes for the verification of cards
* nfc: fix verification for supported cards
* nfc: remove unused vars
* Improve card reading reliability and fix plantain
* plantain: change log level

Co-authored-by: gornekich <n.gorbadey@gmail.com>
2022-09-20 01:05:04 +09:00
MX
111656d2c1 Merge branch 'fz-dev' into dev 2022-09-19 18:50:20 +03:00
MX
2045a29d3f lower frame rate in custom anim to save a bit of battery charge 2022-09-19 18:40:50 +03:00
MX
26e46f9267 Merge pull request #71 from TasyDevilsky/patch-1
Update setting_user
2022-09-19 17:47:12 +03:00
Max Lapan
d003db0404 SubGhz: Oregon v2.1 decoder (#1678)
* Oregon v2.1 decoder
* Refactor FSM to switch
* Refactor headers
* Format strings
* Unit tests of oregon2
* Cleanups
* Add oregon2 raw data to random_test_raw.sub
* Adjust count of packets detected on random test
* Format sources

Co-authored-by: あく <alleteam@gmail.com>
2022-09-19 23:24:24 +09:00
MX
5a31e35dc2 Merge branch 'fz-dev' into dev 2022-09-19 17:21:31 +03:00
Patrick Cunningham
c7cd5721ed Picopass: detect and show SE / SIO (#1701)
* detect and show SE / SIO
* fix fault
* remove bad read check

Co-authored-by: あく <alleteam@gmail.com>
2022-09-19 22:37:12 +09:00
Nikolay Minaylov
fb476c29e6 RFID: fix read info screen (#1723)
* RFID: fix read info screen
* Fix line break for long data string
* Protocol data redecoding before write

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-19 22:21:40 +09:00
Nikolay Minaylov
d80329b323 [FL-2815, FL-2821] Dummy mode (#1739)
* Dummy mode implementation
* dumb -> dummy
* F7: Add new api_symbols: game icon
* Starting snake game from dummy mode

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-09-19 22:03:42 +09:00
Astra
3d3c422751 [FL-2674] Show error popup when NFC chip is not init/disconnected (#1722)
* Show error popup when NFC chip is not init/disconnected
* Move to dialogs for the error message
* Fix a memory leak and wrap the hal check
* F7: update api_symbols.csv, add furi_hal_nfc_is_init

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-19 21:46:56 +09:00
hedger
ed385594a3 faploader: more subsystem headers in API table (#1742)
* faploader: more subsystem headers in API table; not counting header entries for SDK version change
* subghz: removed dead function
* Adjusted API version
* hal: removed furi_hal_power_get_system_voltage
* lib: mbedtls: additional flags for .fap linkage
* fbt: rebuilding assets when git commit id changes
* fbt: removed assets rebuild on git commit id change; added explicit dependency for SDK source on compiled assets parts; removed unneeded sdk regeneration runs
* fbt: changed stock plugins to EXTERNAL apps; restored building app as a PLUGIN as a part of main fw as well as a .fap; readme fixes
* fbt: restored certain apps to PLUGIN type
* fbt: app manifests: renamed version->fap_version, added extra fields
* fbt: fixed version processing after rename

Co-authored-by: あく <alleteam@gmail.com>
2022-09-19 21:39:00 +09:00
Astra
787df44c79 [FL-2800] Fix Mifare Classic 4K reading of the last 8 sectors (#1712)
* Fix FURI_BIT_SET

Co-authored-by: gornekich <n.gorbadey@gmail.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
2022-09-19 21:30:18 +09:00
TasmanDevil
f0eedc3243 Update setting_user
Adding the 868.95 frequency for the Sommer device, the `Sommer(fsk476)` protocol was recently added but Flipper could not read it until now.
2022-09-19 08:59:13 +02:00
MX
365d055dc5 update changelog again 2022-09-19 05:55:54 +03:00
MX
650ba8a91f Update HowToInstall.md 2022-09-19 05:53:23 +03:00
MX
654d6dc6ec update changelog 2022-09-19 05:51:10 +03:00
MX
18b70ac6b5 update universal ir assets
by @amec0e
2022-09-19 05:45:58 +03:00
hedger
51369d6219 fbt: removed assets rebuild on git commit id change; added explicit dependency for SDK source on compiled assets parts; removed unneeded sdk regeneration runs 2022-09-19 05:27:21 +03:00
MX
181533df1b fixed bug with power suppress in unirf, removed icon from api 2022-09-19 05:22:50 +03:00
MX
d85731636f move spectrum analyzer into plugins, fix debug builds 2022-09-19 04:59:28 +03:00
MX
6f66f87fab add new frequency to user config 2022-09-18 21:10:08 +03:00
MX
85d4dedb15 update changelog 2022-09-18 05:18:17 +03:00
MX
0a4cddb84c update assets 2022-09-18 01:53:50 +03:00
MX
4e17230290 fix subghz read issues 2022-09-18 01:48:10 +03:00
MX
aa99ac53c7 delete 2022-09-17 20:34:46 +03:00
MX
875f70196b drop setting save feature 2022-09-17 20:33:26 +03:00
MX
1e71d212fe Trying to fix strange bug 2022-09-17 17:53:44 +03:00
MX
269a6ce562 update how to install with animated instructions
sorry for quality, will be fixed later
2022-09-17 03:19:38 +03:00
MX
cd2014c51b Update ReadMe.md 2022-09-17 02:23:33 +03:00
MX
08f80ab645 update changelog 2022-09-17 01:40:35 +03:00
MX
14bd8f2c49 ofw pr: dummy mode
OFW PR 1739 by nminaylov
2022-09-17 00:43:21 +03:00
MX
8ce5fae626 fix config 2022-09-17 00:19:43 +03:00
MX
087bf41392 commented back 2022-09-16 22:47:52 +03:00
MX
d390381d5a Merge branch 'fix-subghz-last-used-settings' into dev 2022-09-16 22:45:43 +03:00
Der Skythe
c3e31663ef Minor changes 2022-09-16 23:08:45 +04:00
MX
c28e4ea733 Merge pull request #69 from h4sh5/random_uid_reader_detect
random uid for detect reader each time NFC app exists and comes back
2022-09-16 22:01:08 +03:00
MX
96a3da24c9 Merge pull request #70 from derskythe/fix-subghz-last-used-settings
Fix SubGHz last used settings
2022-09-16 21:58:24 +03:00
MX
9d4b318357 Merge branch 'dev' into fix-subghz-last-used-settings 2022-09-16 21:55:52 +03:00
MX
ef5d0aa483 fix null pointer dereference 2022-09-16 21:48:03 +03:00
MX
66487abaee disable some logs 2022-09-16 21:37:01 +03:00
MX
d2bb1ef4d3 fix receiver filter set-up 2022-09-16 21:30:53 +03:00
hedger
0e15090629 fbt: rebuilding assets when git commit id changes 2022-09-16 21:16:32 +03:00
MX
1413d7c937 secret
special secret animation by @Svaarich
2022-09-16 21:14:00 +03:00
Der Skythe
d97a3ef161 fix: change SUBGHZ_HISTORY_MAX to 50 according off-firm 2022-09-16 21:35:26 +04:00
MX
870dfd188c ofw pr: picopass se identify
OFW PR 1701 by pcunning
2022-09-16 18:42:12 +03:00
MX
71a6844a5f drop dfu's from releases
qflipper and android app is not allowing to use new update method with custom firmware, so we have 3 methods only
2022-09-16 18:14:28 +03:00
Der Skythe
d67d5da034 fix: SubGhz Read reset setting ReadRAW after using scene ReadRAW 2022-09-16 18:38:08 +04:00
MX
c894948d4f faploader api extension and lib fixes
OFW PR 1742 by hedger

keeping api version the same to allow compatibility 
it might be changed in next releases if api changes are destructive
2022-09-16 17:30:07 +03:00
MX
e25148ce72 update changelog 2022-09-16 03:12:07 +03:00
MX
07301935b5 update universal ac asset
by @amec0e
2022-09-16 02:56:58 +03:00
MX
3a1705bcf9 Merge pull request #68 from derskythe/fixed-archive-app
Fixed archive app
2022-09-16 02:53:15 +03:00
MX
df87b04fa9 disable debug logs to make gui faster 2022-09-16 02:52:43 +03:00
MX
75f5efce03 Merge branch 'dev' into fixed-archive-app 2022-09-16 02:50:24 +03:00
MX
00585fa16a add free back 2022-09-16 02:32:03 +03:00
Der Skythe
30aaae33be Revert "Fix bugs with new model"
This reverts commit 8915c0c66c.
2022-09-16 02:30:42 +03:00
MX
c0e7c2a929 remove merge bug 2022-09-16 02:27:08 +03:00
Der Skythe
286b4876ce Fix bugs with new model 2022-09-16 03:22:53 +04:00
Der Skythe
10c2ae5a05 Merge branch 'fixed-archive-app' of https://github.com/derskythe/flipperzero-firmware-wPlugins into fixed-archive-app 2022-09-16 03:20:45 +04:00
Der Skythe
8915c0c66c Fix bugs with new model 2022-09-16 03:16:46 +04:00
MX
ec7676182a fix null pointer dereference 2022-09-16 02:15:58 +03:00
MX
e23dbb9f99 add new start screen for doom
by @Svaarich
2022-09-16 01:54:17 +03:00
MX
19d201085b reduce max subghz history items to resolve memory issues 2022-09-16 01:23:29 +03:00
Der Skythe
17a4e03656 Fix bugs with new model 2022-09-16 02:21:10 +04:00
Der Skythe
1fd9240481 Add Info to all files, fix file info elements position 2022-09-15 23:33:43 +04:00
MX
fc9996377d fix subghz read mode doesn’t work at all 2022-09-15 22:10:18 +03:00
Der Skythe
7f4b586b13 Init archive app with Rename, normal context menu and file info 2022-09-15 22:00:51 +04:00
MX
72de4af6db change it back temporarily 2022-09-15 19:59:00 +03:00
MX
5bbb13c5c9 Merge branch 'fz-dev' into dev 2022-09-15 19:58:11 +03:00
MX
3efb093125 change app type and category for music players 2022-09-15 19:37:06 +03:00
Astra
60bce7b8d8 [FL-2780] NFC Notifications fix (#1731)
* Show error popup when NFC chip is not init/disconnected
* Move to dialogs for the error message
* NFC notifications fixed to match the intended design
* Revert "Move to dialogs for the error message"
* Revert "Show error popup when NFC chip is not init/disconnected"

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-16 00:49:10 +09:00
Skorpionm
8b05bd1106 [FL-2814] SubGhz: fix display information in the file if the frequency is not available for transmission in the given region (#1724) 2022-09-16 00:42:44 +09:00
MX
668b7857b4 Merge branch 'fz-dev' into dev 2022-09-15 18:28:57 +03:00
MX
8b3b5fa802 fix nrfsniff log spam, add new icons
icons by @Svaarich
2022-09-15 18:27:27 +03:00
Nikolay Minaylov
a6052be0f1 Charging icon update fix (#1733)
* Power: refresh battery indicator on charger plug/unplug

Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-15 23:13:48 +09:00
hedger
007a3d295e [FL-2819] updater: fixed failing backups on /int with empty files in it #1735
Co-authored-by: あく <alleteam@gmail.com>
2022-09-15 22:55:55 +09:00
hedger
28beff1ab6 Fbt: fixed gdb-py path for MacOS, docs: spelling fixes, codeowners (#1736)
* fbt: fixed gdb-py path for MacOS, docs: spelling fixes
* Gtihub: update codeowners

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
2022-09-15 22:40:26 +09:00
MX
9c95562fad enable uart echo and usb mouse apps 2022-09-15 08:17:58 +03:00
MX
83e036da14 update readme & changelog 2022-09-15 07:28:26 +03:00
MX
8fd4225939 fix detect raw bug, fix came atomo 2022-09-15 06:45:19 +03:00
MX
a3234995db make zombiez input faster 2022-09-15 05:17:19 +03:00
MX
98312860a6 resolve merge conflict 2022-09-15 05:09:27 +03:00
MX
9dbcd43e66 Merge branch 'fz-dev' into dev 2022-09-15 05:08:53 +03:00
MX
ffce0aeec9 NFC Notifications fix
OFW PR 1731 by Astrrra
2022-09-15 04:54:18 +03:00
MX
361a239d3e add some games, make DOOM somewhat playable 2022-09-15 04:42:17 +03:00
MX
51ffdcd3bc update api, add icons, fix picopass again 2022-09-15 01:14:55 +03:00
hedger
d47fdce337 updater: fixed failing backups on /int with empty files in it 2022-09-14 21:04:46 +03:00
MX
3fbaad1488 Merge branch 'fz-dev' into dev 2022-09-14 21:04:04 +03:00
SG
b9a766d909 [FL-2627] Flipper applications: SDK, build and debug system (#1387)
* Added support for running applications from SD card (FAPs - Flipper Application Packages)
* Added plugin_dist target for fbt to build FAPs
* All apps of type FlipperAppType.EXTERNAL and FlipperAppType.PLUGIN are built as FAPs by default
* Updated VSCode configuration for new fbt features - re-deploy stock configuration to use them
* Added debugging support for FAPs with fbt debug & VSCode
* Added public firmware API with automated versioning

Co-authored-by: hedger <hedger@users.noreply.github.com>
Co-authored-by: SG <who.just.the.doctor@gmail.com>
Co-authored-by: あく <alleteam@gmail.com>
2022-09-15 02:21:03 +09:00
MX
1b8684eb53 drop games menu, preparing for app loader 2022-09-14 19:32:41 +03:00
MX
7a2b5be137 new clock
timer by GMMan and settings by kowalski7cc
2022-09-14 19:25:31 +03:00
SG
873e1f114b [FL-2627] Flipper applications: SDK, build and debug system (#1387) 2022-09-15 01:11:38 +09:00
MX
abce958db9 Merge pull request #66 from TQMatvey/dev
Arkanoid: rand_range, remove temp number
2022-09-14 17:36:07 +03:00
MX
d4c44d7500 Merge pull request #67 from derskythe/eng1n33r-save-subghz
Save last used SubGHZ config settings
2022-09-14 17:35:54 +03:00
Der Skythe
444035d06a Add missing settings 2022-09-14 18:12:27 +04:00
Der Skythe
c8c75d5f14 Merge remote-tracking branch 'upstream/dev' into eng1n33r-save-subghz 2022-09-14 17:57:00 +04:00
Der Skythe
1fda069579 Save Read and ReadRAW Config settings in subghz/assets/last_used.txt file 2022-09-14 17:41:44 +04:00
MX
fccb99d847 Power: refresh battery indicator on charger plug/unplug
OFW PR 1733 by nminaylov
2022-09-14 16:29:17 +03:00
MX
4a61a28f57 Protocol data redecoding before write
OFW PR 1723 by nminaylov
2022-09-14 16:18:23 +03:00
MX
b00117e02c Detect RAW feature
by perspecdev
2022-09-14 16:01:30 +03:00
Haoxi Tan
6b91c660d4 random uid each time NFC app exists and comes back 2022-09-14 20:10:49 +10:00
TQMatvey
9c3406895c Arkanoid: rand_range, remote temp number 2022-09-14 12:46:40 +07:00
MX
ee6b59ab9d update universal ac asset
by @Amec0e
2022-09-14 02:01:58 +03:00
MX
bd594c7134 update mf classic dict and ir universal remote assets 2022-09-13 16:53:48 +03:00
MX
4417a37a2e update changelog 2022-09-12 02:09:02 +03:00
MX
1b6794ce7c update manifest 2022-09-12 02:06:44 +03:00
MX
c96bfba95a update slideshow images
author - @Svaarich
2022-09-12 01:18:25 +03:00
MX
fe8ad22132 Merge pull request #65 from web-mancha/dev
Added Brazilian Portuguese keyboard layout
2022-09-12 01:09:19 +03:00
Mancha
bcb5af1813 Added Brazilian Portuguese keyboard layout
Created the BadUSB keyboard layout for the Brazilian Portuguese ABNT-2 keyboard layout configuration
2022-09-11 14:40:00 -03:00
1671 changed files with 52806 additions and 13301 deletions

View File

@@ -1,86 +1,191 @@
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignArrayOfStructures: None
AlignConsecutiveMacros: None
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignEscapedNewlines: Left
AlignOperands: true
AlignOperands: Align
AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortEnumsOnASingleLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: true
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: false
AlwaysBreakTemplateDeclarations: Yes
AttributeMacros:
- __capability
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: Never
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeConceptDeclarations: true
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: false
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 99
ColumnLimit: 99
CommentPragmas: '^ IWYU pragma:'
QualifierAlignment: Leave
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
PackConstructorInitializers: BinPack
BasedOnStyle: ''
ConstructorInitializerAllOnOneLineOrOnePerLine: false
AllowAllConstructorInitializersOnNextLine: true
FixNamespaceComments: false
IncludeBlocks: Preserve
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '.*'
Priority: 1
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertTrailingCommas: None
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
MacroBlockBegin: ''
MacroBlockEnd: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
# Taken from git's rules
PenaltyBreakAssignment: 10
PenaltyBreakBeforeFirstCallParameter: 30
PenaltyBreakComment: 10
PenaltyBreakFirstLessLess: 0
PenaltyBreakOpenParenthesis: 0
PenaltyBreakString: 10
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 100
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyIndentedWhitespace: 0
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
PPIndentWidth: -1
ReferenceAlignment: Pointer
ReflowComments: false
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SortIncludes: Never
SortJavaStaticImport: Before
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: Never
SpaceBeforeParensOptions:
AfterControlStatements: false
AfterForeachMacros: false
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: false
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInAngles: Never
SpacesInConditionalStatement: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp03
TabWidth: 4
UseTab: Never
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
Standard: c++03
StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseCRLF: false
UseTab: Never
WhitespaceSensitiveMacros:
- STRINGIZE
- PP_STRINGIZE
- BOOST_PP_STRINGIZE
- NS_SWIFT_NAME
- CF_SWIFT_NAME
...

View File

@@ -28,39 +28,9 @@ steps:
FBT_TOOLS_CUSTOM_LINK:
from_secret: fbt_link
- name: "Bundle resources"
image: kramos/alpine-zip
commands:
- mkdir sd-card
- mkdir -p sd-card/subghz/assets
- mkdir -p sd-card/nfc/assets
- mkdir -p sd-card/infrared/assets
- mkdir -p sd-card/unirf
- mkdir -p sd-card/rfidfuzzer
- mkdir -p sd-card/subplaylist
- mkdir -p sd-card/badusb/layouts
- cp assets/resources/badusb/layouts/* sd-card/badusb/layouts/
- cp assets/resources/subghz/assets/dangerous_settings sd-card/subghz/assets/dangerous_settings
- cp assets/resources/subghz/assets/setting_user sd-card/subghz/assets/setting_user
- cp assets/resources/subghz/assets/keeloq_mfcodes sd-card/subghz/assets/keeloq_mfcodes
- cp assets/resources/nfc/assets/mf_classic_dict.nfc sd-card/nfc/assets/mf_classic_dict.nfc
- cp assets/resources/infrared/assets/tv.ir sd-card/infrared/assets/tv.ir
- cp assets/resources/infrared/assets/ac.ir sd-card/infrared/assets/ac.ir
- cp assets/resources/infrared/assets/fans.ir sd-card/infrared/assets/fans.ir
- cp assets/resources/infrared/assets/projectors.ir sd-card/infrared/assets/projectors.ir
- cp assets/resources/infrared/assets/audio.ir sd-card/infrared/assets/audio.ir
- cp assets/resources/unirf/unirf_map_example.txt sd-card/unirf/unirf_map_example.txt
- cp assets/resources/rfidfuzzer/example_uids.txt sd-card/rfidfuzzer/example_uids.txt
- cp assets/resources/subplaylist/example_playlist.txt sd-card/subplaylist/example_playlist.txt
- cp assets/resources/Manifest sd-card/Manifest
- zip -r artifacts-default/sd-card-${DRONE_TAG}.zip sd-card
- rm -rf sd-card
- ls -laS artifacts-default
- name: "Bundle self-update packages"
image: kramos/alpine-zip
commands:
- tar czpf artifacts-default/flipper-z-f7-update-${DRONE_TAG}.tgz -C artifacts-default f7-update-${DRONE_TAG}
- cp artifacts-default/flipper-z-f7-update-${DRONE_TAG}.tgz .
- zip -r artifacts-default/flipper-z-f7-update-${DRONE_TAG}.zip artifacts-default/f7-update-${DRONE_TAG}
- rm -rf artifacts-default/f7-update-${DRONE_TAG}
@@ -93,7 +63,6 @@ steps:
files:
- artifacts-default/*.tgz
- artifacts-default/*.zip
- artifacts-default/flipper-z-f7-full-${DRONE_TAG}.dfu
title: ${DRONE_TAG}
note: CHANGELOG.md
checksum:
@@ -115,7 +84,7 @@ steps:
Version: {{build.tag}}
[-Github-](https://github.com/Eng1n33r/flipperzero-firmware/releases/tag/${DRONE_TAG})
[-Github-](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/${DRONE_TAG})
[-Install via Web Updater-](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=dev-cfw&version=${DRONE_TAG})"
@@ -135,7 +104,7 @@ steps:
Version: {{build.tag}}
[[Github]](https://github.com/Eng1n33r/flipperzero-firmware/releases/tag/${DRONE_TAG})
[[Github]](https://github.com/DarkFlippers/unleashed-firmware/releases/tag/${DRONE_TAG})
[-Install via Web Updater-](https://my.flipp.dev/?url=https://unleashedflip.com/builds/flipper-z-f7-update-${DRONE_TAG}.tgz&channel=dev-cfw&version=${DRONE_TAG})"

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @xMasterX

View File

@@ -4,5 +4,5 @@ contact_links:
url: https://t.me/flipperzero_unofficial
about: Unofficial Telegram chat
- name: Discord
url: https://discord.gg/58D6E8BtTU
url: https://discord.unleashedflip.com
about: Unofficial Discord Community

3
.gitmodules vendored
View File

@@ -28,3 +28,6 @@
[submodule "lib/mbedtls"]
path = lib/mbedtls
url = https://github.com/Mbed-TLS/mbedtls.git
[submodule "lib/cxxheaderparser"]
path = lib/cxxheaderparser
url = https://github.com/robotpy/cxxheaderparser.git

View File

@@ -9,6 +9,10 @@
"type": "command",
"command": "shellCommand.execute",
"args": {
"useSingleResult": true,
"env": {
"PATH": "${workspaceFolder};${env:PATH}"
},
"command": "./fbt get_blackmagic",
"description": "Get Blackmagic device",
}
@@ -24,14 +28,18 @@
"servertype": "openocd",
"device": "stlink",
"svdFile": "./debug/STM32WB55_CM4.svd",
// If you're debugging early in the boot process, before OS scheduler is running,
// you have to comment out the following line.
"rtos": "FreeRTOS",
"configFiles": [
"interface/stlink.cfg",
"./debug/stm32wbx.cfg",
],
"postAttachCommands": [
// "attach 1",
"compare-sections",
// "compare-sections",
"source debug/flipperapps.py",
// "source debug/FreeRTOS/FreeRTOS.py",
// "svd_load debug/STM32WB55_CM4.svd"
]
// "showDevDebugOutput": "raw",
},
@@ -50,7 +58,8 @@
"attach 1",
"set confirm off",
"set mem inaccessible-by-default off",
"compare-sections",
"source debug/flipperapps.py",
// "compare-sections",
]
// "showDevDebugOutput": "raw",
},
@@ -65,6 +74,9 @@
"device": "STM32WB55RG",
"svdFile": "./debug/STM32WB55_CM4.svd",
"rtos": "FreeRTOS",
"postAttachCommands": [
"source debug/flipperapps.py",
]
// "showDevDebugOutput": "raw",
},
{
@@ -73,7 +85,7 @@
"request": "launch",
"program": "./lib/scons/scripts/scons.py",
"args": [
"sdk"
"plugin_dist"
]
},
{

View File

@@ -12,6 +12,9 @@
"cortex-debug.openocdPath.windows": "${workspaceFolder}/toolchain/i686-windows/openocd/bin/openocd.exe",
"cortex-debug.openocdPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/openocd/bin/openocd",
"cortex-debug.openocdPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/openocd/bin/openocd",
"cortex-debug.gdbPath.windows": "${workspaceFolder}/toolchain/i686-windows/bin/arm-none-eabi-gdb-py.bat",
"cortex-debug.gdbPath.linux": "${workspaceFolder}/toolchain/x86_64-linux/bin/arm-none-eabi-gdb-py",
"cortex-debug.gdbPath.osx": "${workspaceFolder}/toolchain/x86_64-darwin/bin/arm-none-eabi-gdb-py",
"editor.formatOnSave": true,
"files.associations": {
"*.scons": "python",
@@ -19,4 +22,4 @@
"SConstruct": "python",
"*.fam": "python",
}
}
}

View File

@@ -93,11 +93,41 @@
"type": "shell",
"command": "./fbt FIRMWARE_APP_SET=unit_tests FORCE=1 flash_usb"
},
{
"label": "[Debug] Flash (USB, with resources)",
"group": "build",
"type": "shell",
"command": "./fbt FORCE=1 flash_usb_full"
},
{
"label": "[Release] Flash (USB, with resources)",
"group": "build",
"type": "shell",
"command": "./fbt COMPACT=1 DEBUG=0 FORCE=1 flash_usb_full"
},
{
"label": "[Debug] Build FAPs",
"group": "build",
"type": "shell",
"command": "./fbt plugin_dist"
},
{
"label": "[Release] Build FAPs",
"group": "build",
"type": "shell",
"command": "./fbt COMPACT=1 DEBUG=0 plugin_dist"
},
{
"label": "[Debug] Launch App on Flipper",
"group": "build",
"type": "shell",
"command": "./fbt launch_app APPSRC=${relativeFileDirname}"
},
{
"label": "[Release] Launch App on Flipper",
"group": "build",
"type": "shell",
"command": "./fbt COMPACT=1 DEBUG=0 launch_app APPSRC=${relativeFileDirname}"
}
]
}

View File

@@ -1,14 +1,36 @@
### New changes
* Fix Custom flipper names
* Arkanoid: Fix - dont allow user to jump after start (PR 64 / by @TQMatvey)
* Fix subghz starline protocol
* SubGHz: Keeloq - added support for FAAC RC,XT, Mutancode, Normstahl
* LFRFID: CLI - Add raw_analyze to usage help
* PR -> Plugins: Minesweeper: Set cursor to initial position on death (by @TQMatvey | PR #113)
* PR -> Plugins: Flappy bird: Border hitboxes, bigger Pilars (by @TQMatvey | PR #114)
* Plugins: Updated Minesweeper [(by panki27)](https://github.com/panki27/minesweeper)
* Plugins: Added DTMF Dolphin [(by litui)](https://github.com/litui/dtmf_dolphin)
* Plugins: Updated TOTP (Authenticator) [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator)
* Infrared: Updated universal remote assets (by @Amec0e)
* OFW: Feature: infrared add remote to cli
* OFW: Remove the back button from MFC keys list
* OFW: NFC fixes part 3
* OFW: Enable all `view_` methods in SDK
* OFW: fbt: fix for cincludes in app's private library definition
* OFW: Desktop: fix fap in settings
* OFW: Add BLE disconnect request
**Note: To avoid issues prefer installing using web updater or by self update package, all needed assets will be installed**
#### [🎲 Download extra apps pack](https://download-directory.github.io/?url=https://github.com/UberGuidoZ/Flipper/tree/main/Applications/Unleashed)
Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip` or `.tgz` for iOS mobile app
[-> How to install firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
DFU for update using qFlipper - `flipper-z-f7-full-(version).dfu`
[-> Download qFlipper 1.2.1 (allows .tgz installation) (official link)](https://update.flipperzero.one/builds/qFlipper/1.2.1/)
If using DFU update method, download this archive and unpack it to your microSD, replacing all files except files you have edited manually -
`sd-card-(version).zip`
## Please support development of the project
* Boosty: https://boosty.to/mmxdev
* ETH/BSC/ERC20-Tokens: `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`
* BTC: `bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`
* DOGE: `D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`
* LTC: `ltc1q3ex4ejkl0xpx3znwrmth4lyuadr5qgv8tmq8z9`
**Note: To avoid issues with .dfu, prefer installing using .tgz with qFlipper, web updater or by self update package, all needed assets will be installed**
Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip` or download `.tgz` for iOS mobile app / qFlipper
Update using qFlipper (1.2.0+) is now possible with `.tgz` update package! Also you can use Web Updater or self-update package.

View File

@@ -1,5 +1,5 @@
<h3 align="center">
<a href="https://github.com/Eng1n33r/flipperzero-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">
</a>
</h3>
@@ -16,7 +16,7 @@ Please help us implement emulation for all subghz dynamic (rolling code) protoco
<br>
Our Discord Community:
<br>
<a href="https://discord.gg/flipperzero-unofficial"><img src="https://discordapp.com/api/guilds/937479784148115456/widget.png?style=banner4" alt="Unofficial Discord Community"></a>
<a href="https://discord.unleashedflip.com"><img src="https://discordapp.com/api/guilds/937479784148115456/widget.png?style=banner4" alt="Unofficial Discord Community"></a>
<br>
<br>
@@ -36,22 +36,33 @@ Our Discord Community:
* Universal remote for Projectors, Fans, A/Cs and Audio(soundbars, etc.)
* BadUSB keyboard layouts
* Customizable Flipper name
* SubGHz -> Press OK in frequency analyzer to use detected frequency in Read modes
* SubGHz -> Long press OK button in SubGHz Frequency analyzer to switch to Read menu
* Other small fixes and changes throughout
* See other changes in changelog and in readme below
See changelog in releases for latest updates!
Also check changelog in releases for latest updates!
### Current modified and new SubGHz protocols list:
- HCS101
- An-Motors
- Keeloq [Not ALL systems supported for decode or emulation yet!] - [Supported manufacturers list](https://0bin.net/paste/VwR2lNJY#WH9vnPgvcp7w6zVKucFCuNREKAcOij8KsJ6vqLfMn3b)
- Keeloq: HCS101
- Keeloq: AN-Motors
- Keeloq: JCM Tech
- Keeloq: MHouse
- Keeloq: Nice Smilo
- Keeloq: DTM Neo
- Keeloq: FAAC RC,XT
- Keeloq: Mutancode
- Keeloq: Normstahl
- CAME Atomo
- FAAC SLH (Spa) [External seed calculation required]
- BFT Mitto [External seed calculation required]
- Keeloq [Not ALL systems supported yet!]
- Nice Flor S
- FAAC SLH (Spa) [External seed calculation required (For info conatct me in Discord: Nano#8998)]
- BFT Mitto [External seed calculation required (For info conatct me in Discord: Nano#8998)]
- Security+ v1 & v2
- Star Line
- Star Line (saving only)
## Support us so we can buy equipment and develop new features
* Boosty: https://boosty.to/mmxdev
* ETH/BSC/ERC20-Tokens: `0xFebF1bBc8229418FF2408C07AF6Afa49152fEc6a`
* BTC: `bc1q0np836jk9jwr4dd7p6qv66d04vamtqkxrecck9`
* DOGE: `D6R6gYgBn5LwTNmPyvAQR6bZ9EtGgFCpvv`
@@ -59,45 +70,63 @@ See changelog in releases for latest updates!
### Community apps included:
- RFID Fuzzer plugin [(by Ganapati)](https://github.com/Eng1n33r/flipperzero-firmware/pull/54) with some changes by xMasterX
- Sub-GHz bruteforce plugin [(by Ganapati & xMasterX)](https://github.com/Eng1n33r/flipperzero-firmware/pull/57)
- Sub-GHz playlist plugin [(by darmiel)](https://github.com/Eng1n33r/flipperzero-firmware/pull/62)
- RFID Fuzzer plugin [(by Ganapati)](https://github.com/DarkFlippers/unleashed-firmware/pull/54) with changes by @xMasterX & New protocols by @mvanzanten
- Sub-GHz bruteforce plugin [(by Ganapati & xMasterX)](https://github.com/DarkFlippers/unleashed-firmware/pull/57) & Refactored by @derskythe
- Sub-GHz playlist plugin [(by darmiel)](https://github.com/DarkFlippers/unleashed-firmware/pull/62)
- ESP8266 Deauther plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-Wifi-ESP8266-Deauther-Module)
- WiFi Scanner plugin [(by SequoiaSan)](https://github.com/SequoiaSan/FlipperZero-WiFi-Scanner_Module)
- MultiConverter plugin [(by theisolinearchip)](https://github.com/theisolinearchip/flipperzero_stuff)
- USB Keyboard plugin [(by huuck)](https://github.com/huuck/FlipperZeroUSBKeyboard)
- WAV player plugin (fixed) [(OFW: DrZlo13)](https://github.com/flipperdevices/flipperzero-firmware/tree/zlo/wav-player)
- UPC-A Barcode generator plugin [(by McAzzaMan)](https://github.com/McAzzaMan/flipperzero-firmware/tree/UPC-A_Barcode_Generator/applications/barcode_generator)
- GPIO: Sentry Safe plugin [(by H4ckd4ddy)](https://github.com/H4ckd4ddy/flipperzero-sentry-safe-plugin)
- ESP32: WiFi Marauder companion plugin [(by 0xchocolate)](https://github.com/0xchocolate/flipperzero-firmware-with-wifi-marauder-companion)
- NRF24: Sniffer & MouseJacker (with changes) [(by mothball187)](https://github.com/mothball187/flipperzero-nrf24/tree/main/mousejacker)
- Simple Clock (fixed) [(Original by CompaqDisc)](https://gist.github.com/CompaqDisc/4e329c501bd03c1e801849b81f48ea61)
- Simple Clock (timer by GMMan / settings by kowalski7cc) [(Original by CompaqDisc)](https://gist.github.com/CompaqDisc/4e329c501bd03c1e801849b81f48ea61)
- UniversalRF Remix / Sub-GHz Remote [(by ESurge)](https://github.com/ESurge/flipperzero-firmware-unirfremix)[(updated and all protocol support added by darmiel & xMasterX)](https://github.com/darmiel/flipper-playlist/tree/feat/unirf-protocols)
- Tetris (with fixes) [(by jeffplang)](https://github.com/jeffplang/flipperzero-firmware/tree/tetris_game/applications/tetris_game)
- Spectrum Analyzer (with changes) [(by jolcese)](https://github.com/jolcese/flipperzero-firmware/tree/spectrum/applications/spectrum_analyzer) - [Ultra Narrow mode & scan channels non-consecutively](https://github.com/theY4Kman/flipperzero-firmware/commits?author=theY4Kman)
- Arkanoid (with fixes) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
- Tic Tac Toe (with fixes) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
- Metronome [(by panki27)](https://github.com/panki27/Metronome)
- DTMF Dolphin [(by litui)](https://github.com/litui/dtmf_dolphin)
- **TOTP (Authenticator)** [(by akopachov)](https://github.com/akopachov/flipper-zero_authenticator)
Games:
- DOOM (fixed) [(By p4nic4ttack)](https://github.com/p4nic4ttack/doom-flipper-zero/)
- Zombiez [(Reworked By DevMilanIan)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/240) [(Original By Dooskington)](https://github.com/Dooskington/flipperzero-zombiez)
- Flappy Bird [(By DroomOne)](https://github.com/DroomOne/flipperzero-firmware/tree/dev/applications/flappy_bird)
- Arkanoid (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
- Tic Tac Toe (refactored by xMasterX) [(by gotnull)](https://github.com/gotnull/flipperzero-firmware-wPlugins)
- Tetris (with fixes) [(by jeffplang)](https://github.com/jeffplang/flipperzero-firmware/tree/tetris_game/applications/tetris_game)
- Minesweeper [(by panki27)](https://github.com/panki27/minesweeper)
### Other changes
- BadUSB Keyboard layouts [(by rien > dummy-decoy)](https://github.com/dummy-decoy/flipperzero-firmware/tree/dummy_decoy/bad_usb_keyboard_layout)
- New frequency analyzer - [(by ClusterM)](https://github.com/ClusterM)
- BadUSB -> Keyboard layouts [(by rien > dummy-decoy)](https://github.com/dummy-decoy/flipperzero-firmware/tree/dummy_decoy/bad_usb_keyboard_layout)
- SubGHz -> New frequency analyzer - [(by ClusterM)](https://github.com/DarkFlippers/unleashed-firmware/pull/43)
- SubGHz -> Detect RAW feature - [(by perspecdev)](https://github.com/RogueMaster/flipperzero-firmware-wPlugins/pull/152)
- SubGHz -> Save last used frequency and moduluation [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77)
- SubGHz -> Press OK in frequency analyzer to use detected frequency in Read modes [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/77)
- SubGHz -> Long press OK button in SubGHz Frequency analyzer to switch to Read menu [(by derskythe)](https://github.com/DarkFlippers/unleashed-firmware/pull/79)
# Instructions
## [- How to install firmware](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/HowToInstall.md)
## [- How to install firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToInstall.md)
## [- How to build firmware](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/HowToBuild.md)
## [- How to build firmware](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/HowToBuild.md)
## [- BadUSB: how to add new keyboard layouts](https://github.com/dummy-decoy/flipperzero_badusb_kl)
## [- How to change Flipper name](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/CustomFlipperName.md)
## [- How to change Flipper name](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/CustomFlipperName.md)
### **Plugins**
## [- Configure Sub-GHz Remote App](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/SubGHzRemotePlugin.md)
## [- 🎲 Download Extra plugins for Unleashed](https://github.com/UberGuidoZ/Flipper/tree/main/Applications/Unleashed)
## [- Barcode Generator](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/BarcodeGenerator.md)
## [- Configure Sub-GHz Remote App](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzRemotePlugin.md)
## [- Multi Converter](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/MultiConverter.md)
## [- TOTP (Authenticator) config description](https://github.com/akopachov/flipper-zero_authenticator/blob/master/.github/conf-file_description.md)
## [- Barcode Generator](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/BarcodeGenerator.md)
## [- Multi Converter](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/MultiConverter.md)
## [- WAV Player sample files & how to convert](https://github.com/UberGuidoZ/Flipper/tree/main/Wav_Player#readme)
@@ -105,7 +134,7 @@ See changelog in releases for latest updates!
### **Plugins that works with external hardware**
## [- How to use: [NRF24] plugins](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/NRF24.md)
## [- How to use: [NRF24] plugins](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/NRF24.md)
## [- How to use: [WiFi] Scanner](https://github.com/SequoiaSan/FlipperZero-WiFi-Scanner_Module#readme)
@@ -119,28 +148,29 @@ See changelog in releases for latest updates!
## [- Windows: How to Upload .bin to ESP32/ESP8266](https://github.com/SequoiaSan/Guide-How-To-Upload-bin-to-ESP8266-ESP32)
## [- How to use: [GPIO] SentrySafe plugin](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/SentrySafe.md)
## [- How to use: [GPIO] SentrySafe plugin](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SentrySafe.md)
### **SubGHz**
## [- Transmission is blocked? - How to extend SubGHz frequency range](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/DangerousSettings.md)
## [- Transmission is blocked? - How to extend SubGHz frequency range](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/DangerousSettings.md)
## [- How to add extra SubGHz frequencies](https://github.com/Eng1n33r/flipperzero-firmware/blob/dev/documentation/SubGHzSettings.md)
## [- How to add extra SubGHz frequencies](https://github.com/DarkFlippers/unleashed-firmware/blob/dev/documentation/SubGHzSettings.md)
<br>
<br>
# Where I can find IR, SubGhz, ... files, DBs, and other stuff?
## [Awesome Flipper Zero - Github](https://github.com/djsime1/awesome-flipperzero)
## [UberGuidoZ Playground - Large collection of files - Github](https://github.com/UberGuidoZ/Flipper)
## [Awesome Flipper Zero - Github](https://github.com/djsime1/awesome-flipperzero)
## [CAME-12bit, NICE-12bit, Linear-10bit, PT-2240 - SubGHz fixed code bruteforce](https://github.com/tobiabocchi/flipperzero-bruteforce)
## [SMC5326, UNILARM - SubGHz fixed code bruteforce](https://github.com/Hong5489/flipperzero-gate-bruteforce)
<br>
<br>
# Links
* Unofficial Discord: [discord.gg/flipperzero-unofficial](https://discord.gg/flipperzero-unofficial)
* Unofficial Discord: [discord.unleashedflip.com](https://discord.unleashedflip.com)
* Docs by atmanos / How to write your own app (outdated API): [https://flipper.atmanos.com/docs/overview/intro](https://flipper.atmanos.com/docs/overview/intro)
* Official Docs: [http://docs.flipperzero.one](http://docs.flipperzero.one)
@@ -158,4 +188,4 @@ See changelog in releases for latest updates!
- `site_scons` - Build helpers
- `scripts` - Supplementary scripts and python libraries home
Also pay attention to `ReadMe.md` files inside of those directories.
Also pay attention to `ReadMe.md` files inside those directories.

View File

@@ -7,24 +7,29 @@
# construction of certain targets behind command-line options.
import os
import subprocess
DefaultEnvironment(tools=[])
EnsurePythonVersion(3, 8)
DefaultEnvironment(tools=[])
# Progress(["OwO\r", "owo\r", "uwu\r", "owo\r"], interval=15)
# This environment is created only for loading options & validating file/dir existence
fbt_variables = SConscript("site_scons/commandline.scons")
cmd_environment = Environment(tools=[], variables=fbt_variables)
Help(fbt_variables.GenerateHelpText(cmd_environment))
cmd_environment = Environment(
toolpath=["#/scripts/fbt_tools"],
tools=[
("fbt_help", {"vars": fbt_variables}),
],
variables=fbt_variables,
)
# Building basic environment - tools, utility methods, cross-compilation
# settings, gcc flags for Cortex-M4, basic builders and more
coreenv = SConscript(
"site_scons/environ.scons",
exports={"VAR_ENV": cmd_environment},
toolpath=["#/scripts/fbt_tools"],
)
SConscript("site_scons/cc.scons", exports={"ENV": coreenv})
@@ -34,37 +39,13 @@ coreenv["ROOT_DIR"] = Dir(".")
# Create a separate "dist" environment and add construction envs to it
distenv = coreenv.Clone(
tools=["fbt_dist", "openocd", "blackmagic", "jflash"],
OPENOCD_GDB_PIPE=[
"|openocd -c 'gdb_port pipe; log_output debug/openocd.log' ${[SINGLEQUOTEFUNC(OPENOCD_OPTS)]}"
tools=[
"fbt_dist",
"fbt_debugopts",
"openocd",
"blackmagic",
"jflash",
],
GDBOPTS_BASE=[
"-ex",
"target extended-remote ${GDBREMOTE}",
"-ex",
"set confirm off",
],
GDBOPTS_BLACKMAGIC=[
"-ex",
"monitor swdp_scan",
"-ex",
"monitor debug_bmp enable",
"-ex",
"attach 1",
"-ex",
"set mem inaccessible-by-default off",
],
GDBPYOPTS=[
"-ex",
"source debug/FreeRTOS/FreeRTOS.py",
"-ex",
"source debug/PyCortexMDebug/PyCortexMDebug.py",
"-ex",
"svd_load ${SVD_FILE}",
"-ex",
"compare-sections",
],
JFLASHPROJECT="${ROOT_DIR.abspath}/debug/fw.jflash",
ENV=os.environ,
)
@@ -160,11 +141,34 @@ if GetOption("fullenv") or any(
basic_dist = distenv.DistCommand("fw_dist", distenv["DIST_DEPENDS"])
distenv.Default(basic_dist)
dist_dir = distenv.GetProjetDirName()
fap_dist = [
distenv.Install(
f"#/dist/{dist_dir}/apps/debug_elf",
firmware_env["FW_EXTAPPS"]["debug"].values(),
),
*(
distenv.Install(f"#/dist/{dist_dir}/apps/{dist_entry[0]}", dist_entry[1])
for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
),
]
Depends(fap_dist, firmware_env["FW_EXTAPPS"]["validators"].values())
Alias("fap_dist", fap_dist)
# distenv.Default(fap_dist)
plugin_resources_dist = list(
distenv.Install(f"#/assets/resources/apps/{dist_entry[0]}", dist_entry[1])
for dist_entry in firmware_env["FW_EXTAPPS"]["dist"].values()
)
distenv.Depends(firmware_env["FW_RESOURCES"], plugin_resources_dist)
# Target for bundling core2 package for qFlipper
copro_dist = distenv.CoproBuilder(
distenv.Dir("assets/core2_firmware"),
"#/build/core2_firmware.tgz",
[],
)
distenv.AlwaysBuild(copro_dist)
distenv.Alias("copro_dist", copro_dist)
firmware_flash = distenv.AddOpenOCDFlashTarget(firmware_env)
@@ -209,10 +213,19 @@ distenv.PhonyTarget(
distenv.PhonyTarget(
"debug_other",
"${GDBPYCOM}",
GDBPYOPTS='-ex "source debug/PyCortexMDebug/PyCortexMDebug.py" ',
GDBOPTS="${GDBOPTS_BASE}",
GDBREMOTE="${OPENOCD_GDB_PIPE}",
GDBPYOPTS='-ex "source debug/PyCortexMDebug/PyCortexMDebug.py" ',
)
distenv.PhonyTarget(
"debug_other_blackmagic",
"${GDBPYCOM}",
GDBOPTS="${GDBOPTS_BASE} ${GDBOPTS_BLACKMAGIC}",
GDBREMOTE="$${BLACKMAGIC_ADDR}",
)
# Just start OpenOCD
distenv.PhonyTarget(
"openocd",
@@ -240,7 +253,6 @@ firmware_env.Append(
"site_scons",
"scripts",
# Extra files
"applications/extapps.scons",
"SConstruct",
"firmware.scons",
"fbt_options.py",

View File

@@ -1,38 +1,89 @@
# Structure
- `about` - Small About application that shows flipper info
- `accessor` - Wiegand server
## debug
Applications for factory testing the Flipper.
- `accessor` - Wiegand server
- `battery_test_app` - Battery debug app
- `blink_test` - LED blinker
- `bt_debug_app` - BT test app. Requires full BT stack installed
- `display_test` - Various display tests & tweaks
- `file_browser_test` - Test UI for file picker
- `keypad_test` - Keypad test
- `lfrfid_debug` - LF RFID debug tool
- `text_box_test` - UI tests
- `uart_echo` - UART mode test
- `unit_tests` - Unit tests
- `usb_mouse` - USB HID test
- `usb_test` - Other USB tests
- `vibro_test` - Vibro test
## main
Applications for main Flipper menu.
- `archive` - Archive and file manager
- `bad_usb` - Bad USB application
- `fap_loader` - External applications loader
- `gpio` - GPIO application: includes USART bridge and GPIO control
- `ibutton` - iButton application, onewire keys and more
- `infrared` - Infrared application, controls your IR devices
- `lfrfid` - LF RFID application
- `nfc` - NFC application, HF rfid, EMV and etc
- `subghz` - SubGhz application, 433 fobs and etc
- `u2f` - U2F Application
## plugins
Extra apps for Plugins & App Loader menus.
- `bt_hid_app` - BT Remote controller
- `music_player` - Music player app (demo)
- `picopass` - Picopass tool
- `snake_game` - Snake game application
## services
Background services providing system APIs to applications.
- `applications.h` - Firmware application list header
- `bt` - BLE service and application
- `cli` - Console service and API
- `crypto` - Crypto cli tools
- `debug_tools` - Different tools that we use for debug
- `desktop` - Desktop service
- `dialogs` - Dialogs service: GUI Dialogs for your app
- `dolphin` - Dolphin service and supplementary apps
- `gpio` - GPIO application: includes USART bridge and GPIO control
- `gui` - GUI service and API
- `ibutton` - iButton application, onewire keys and more
- `input` - Input service
- `infrared` - Infrared application, controls your IR devices
- `lfrfid` - LF RFID application
- `lfrfid_debug` - LF RFID debug tool
- `loader` - Application loader service
- `music_player` - Music player app (demo)
- `nfc` - NFC application, HF rfid, EMV and etc
- `notification` - Notification service
- `power` - Power service
- `power_observer` - Power debug tool
- `rpc` - RPC service and API
- `scened_app_example` - C++ application example
- `snake_game` - Snake game application
- `storage` - Storage service, internal + sdcard
- `storage_settings` - Storage settings app
- `subghz` - SubGhz application, 433 fobs and etc
- `system` - System settings, tools and API
- `tests` - Unit tests and etc
- `u2f` - U2F Application
- `updater` - Update service & application
- `application.h` - Firmware application list header
## settings
Small applications providing configuration for basic firmware and its services.
- `about` - Small About application that shows flipper info
- `bt_settings_app` - Bluetooth options
- `desktop_settings` - Desktop configuration
- `dolphin_passport` - Dolphin passport app
- `notification_settings` - LCD brightness, sound volume, etc configuration
- `power_settings_app` - Basic power options
- `storage_settings` - Storage settings app
- `system` - System settings
## system
Utility apps not visible in other menus.
- `storage_move_to_sd` - Data migration tool for internal storage
- `updater` - Update service & application

View File

@@ -1,79 +0,0 @@
#include "archive_i.h"
#include "m-string.h"
bool archive_custom_event_callback(void* context, uint32_t event) {
furi_assert(context);
ArchiveApp* archive = (ArchiveApp*)context;
return scene_manager_handle_custom_event(archive->scene_manager, event);
}
bool archive_back_event_callback(void* context) {
furi_assert(context);
ArchiveApp* archive = (ArchiveApp*)context;
return scene_manager_handle_back_event(archive->scene_manager);
}
ArchiveApp* archive_alloc() {
ArchiveApp* archive = malloc(sizeof(ArchiveApp));
archive->gui = furi_record_open(RECORD_GUI);
archive->text_input = text_input_alloc();
string_init(archive->fav_move_str);
archive->view_dispatcher = view_dispatcher_alloc();
archive->scene_manager = scene_manager_alloc(&archive_scene_handlers, archive);
view_dispatcher_enable_queue(archive->view_dispatcher);
view_dispatcher_attach_to_gui(
archive->view_dispatcher, archive->gui, ViewDispatcherTypeFullscreen);
view_dispatcher_set_event_callback_context(archive->view_dispatcher, archive);
view_dispatcher_set_custom_event_callback(
archive->view_dispatcher, archive_custom_event_callback);
view_dispatcher_set_navigation_event_callback(
archive->view_dispatcher, archive_back_event_callback);
archive->browser = browser_alloc();
view_dispatcher_add_view(
archive->view_dispatcher, ArchiveViewBrowser, archive_browser_get_view(archive->browser));
view_dispatcher_add_view(
archive->view_dispatcher, ArchiveViewTextInput, text_input_get_view(archive->text_input));
archive->widget = widget_alloc();
view_dispatcher_add_view(
archive->view_dispatcher, ArchiveViewWidget, widget_get_view(archive->widget));
return archive;
}
void archive_free(ArchiveApp* archive) {
furi_assert(archive);
view_dispatcher_remove_view(archive->view_dispatcher, ArchiveViewBrowser);
view_dispatcher_remove_view(archive->view_dispatcher, ArchiveViewTextInput);
view_dispatcher_remove_view(archive->view_dispatcher, ArchiveViewWidget);
widget_free(archive->widget);
view_dispatcher_free(archive->view_dispatcher);
scene_manager_free(archive->scene_manager);
browser_free(archive->browser);
string_clear(archive->fav_move_str);
text_input_free(archive->text_input);
furi_record_close(RECORD_GUI);
archive->gui = NULL;
free(archive);
}
int32_t archive_app(void* p) {
UNUSED(p);
ArchiveApp* archive = archive_alloc();
scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser);
view_dispatcher_run(archive->view_dispatcher);
archive_free(archive);
return 0;
}

View File

@@ -1,89 +0,0 @@
#include "../archive_i.h"
#include "../helpers/archive_favorites.h"
#include "../helpers/archive_files.h"
#include "../helpers/archive_browser.h"
#include "archive/views/archive_browser_view.h"
#include "toolbox/path.h"
#define SCENE_RENAME_CUSTOM_EVENT (0UL)
#define MAX_TEXT_INPUT_LEN 22
void archive_scene_rename_text_input_callback(void* context) {
ArchiveApp* archive = (ArchiveApp*)context;
view_dispatcher_send_custom_event(archive->view_dispatcher, SCENE_RENAME_CUSTOM_EVENT);
}
void archive_scene_rename_on_enter(void* context) {
ArchiveApp* archive = (ArchiveApp*)context;
TextInput* text_input = archive->text_input;
ArchiveFile_t* current = archive_get_current_file(archive->browser);
string_t filename;
string_init(filename);
path_extract_filename(current->path, filename, true);
strlcpy(archive->text_store, string_get_cstr(filename), MAX_NAME_LEN);
path_extract_extension(current->path, archive->file_extension, MAX_EXT_LEN);
text_input_set_header_text(text_input, "Rename:");
text_input_set_result_callback(
text_input,
archive_scene_rename_text_input_callback,
archive,
archive->text_store,
MAX_TEXT_INPUT_LEN,
false);
ValidatorIsFile* validator_is_file = validator_is_file_alloc_init(
string_get_cstr(archive->browser->path), archive->file_extension, "");
text_input_set_validator(text_input, validator_is_file_callback, validator_is_file);
string_clear(filename);
view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewTextInput);
}
bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) {
ArchiveApp* archive = (ArchiveApp*)context;
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
if(event.event == SCENE_RENAME_CUSTOM_EVENT) {
Storage* fs_api = furi_record_open(RECORD_STORAGE);
const char* path_src = archive_get_name(archive->browser);
ArchiveFile_t* file = archive_get_current_file(archive->browser);
string_t path_dst;
string_init(path_dst);
path_extract_dirname(path_src, path_dst);
string_cat_printf(path_dst, "/%s%s", archive->text_store, known_ext[file->type]);
storage_common_rename(fs_api, path_src, string_get_cstr(path_dst));
furi_record_close(RECORD_STORAGE);
if(file->fav) {
archive_favorites_rename(path_src, string_get_cstr(path_dst));
}
string_clear(path_dst);
scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser);
consumed = true;
}
}
return consumed;
}
void archive_scene_rename_on_exit(void* context) {
ArchiveApp* archive = (ArchiveApp*)context;
// Clear view
void* validator_context = text_input_get_validator_callback_context(archive->text_input);
text_input_set_validator(archive->text_input, NULL, NULL);
validator_is_file_free(validator_context);
text_input_reset(archive->text_input);
}

View File

@@ -1,66 +0,0 @@
App(
appid="bt",
name="BtSrv",
apptype=FlipperAppType.SERVICE,
entry_point="bt_srv",
cdefines=["SRV_BT"],
requires=[
"cli",
"dialogs",
],
provides=[
"bt_start",
"bt_settings",
#"bt_debug",
],
stack_size=1 * 1024,
order=20,
)
App(
appid="bt_start",
apptype=FlipperAppType.STARTUP,
entry_point="bt_on_system_start",
order=70,
)
App(
appid="bt_settings",
name="Bluetooth",
apptype=FlipperAppType.SETTINGS,
entry_point="bt_settings_app",
stack_size=1 * 1024,
requires=[
"bt",
"gui",
],
order=10,
)
App(
appid="bt_debug",
name="Bluetooth Debug",
apptype=FlipperAppType.DEBUG,
entry_point="bt_debug_app",
stack_size=1 * 1024,
requires=[
"bt",
"gui",
"dialogs",
],
order=110,
)
App(
appid="bt_hid",
name="Bluetooth Remote",
apptype=FlipperAppType.PLUGIN,
entry_point="bt_hid_app",
stack_size=1 * 1024,
cdefines=["APP_BLE_HID"],
requires=[
"bt",
"gui",
],
order=10,
)

View File

@@ -1,5 +0,0 @@
#pragma once
#include "cli_i.h"
void cli_command_gpio(Cli* cli, string_t args, void* context);

View File

@@ -1,11 +0,0 @@
App(
appid="clock",
name="Clock",
apptype=FlipperAppType.APP,
entry_point="clock_app",
cdefines=["APP_CLOCK"],
requires=["gui"],
icon="A_Clock_14",
stack_size=2 * 1024,
order=9,
)

View File

@@ -1,146 +0,0 @@
#include <furi.h>
#include <furi_hal.h>
#include <gui/elements.h>
#include <gui/gui.h>
#include <input/input.h>
#define TAG "Clock"
#define CLOCK_DATE_FORMAT "%.4d-%.2d-%.2d"
#define CLOCK_TIME_FORMAT "%.2d:%.2d:%.2d"
typedef enum {
EventTypeTick,
EventTypeKey,
} EventType;
typedef struct {
EventType type;
InputEvent input;
} PluginEvent;
typedef struct {
FuriHalRtcDateTime datetime;
} ClockState;
static void clock_input_callback(InputEvent* input_event, FuriMessageQueue* event_queue) {
furi_assert(event_queue);
PluginEvent event = {.type = EventTypeKey, .input = *input_event};
furi_message_queue_put(event_queue, &event, FuriWaitForever);
}
static void clock_render_callback(Canvas* const canvas, void* ctx) {
canvas_clear(canvas);
canvas_set_color(canvas, ColorBlack);
ClockState* state = (ClockState*)acquire_mutex((ValueMutex*)ctx, 25);
char strings[2][20];
snprintf(
strings[0],
sizeof(strings[0]),
CLOCK_DATE_FORMAT,
state->datetime.year,
state->datetime.month,
state->datetime.day);
snprintf(
strings[1],
sizeof(strings[1]),
CLOCK_TIME_FORMAT,
state->datetime.hour,
state->datetime.minute,
state->datetime.second);
release_mutex((ValueMutex*)ctx, state);
canvas_set_font(canvas, FontBigNumbers);
canvas_draw_str_aligned(canvas, 64, 42 - 16, AlignCenter, AlignCenter, strings[1]);
canvas_set_font(canvas, FontSecondary);
canvas_draw_str_aligned(canvas, 64, 52 - 8, AlignCenter, AlignTop, strings[0]);
}
static void clock_state_init(ClockState* const state) {
furi_hal_rtc_get_datetime(&state->datetime);
}
// Runs every 1000ms by default
static void clock_tick(void* ctx) {
furi_assert(ctx);
FuriMessageQueue* event_queue = ctx;
PluginEvent event = {.type = EventTypeTick};
// It's OK to loose this event if system overloaded
furi_message_queue_put(event_queue, &event, 0);
}
int32_t clock_app(void* p) {
UNUSED(p);
FuriMessageQueue* event_queue = furi_message_queue_alloc(8, sizeof(PluginEvent));
ClockState* plugin_state = malloc(sizeof(ClockState));
clock_state_init(plugin_state);
ValueMutex state_mutex;
if(!init_mutex(&state_mutex, plugin_state, sizeof(ClockState))) {
FURI_LOG_E(TAG, "cannot create mutex\r\n");
furi_message_queue_free(event_queue);
free(plugin_state);
return 255;
}
// Set system callbacks
ViewPort* view_port = view_port_alloc();
view_port_draw_callback_set(view_port, clock_render_callback, &state_mutex);
view_port_input_callback_set(view_port, clock_input_callback, event_queue);
FuriTimer* timer = furi_timer_alloc(clock_tick, FuriTimerTypePeriodic, event_queue);
furi_timer_start(timer, furi_kernel_get_tick_frequency());
// Open GUI and register view_port
Gui* gui = furi_record_open(RECORD_GUI);
gui_add_view_port(gui, view_port, GuiLayerFullscreen);
// Main loop
PluginEvent event;
for(bool processing = true; processing;) {
FuriStatus event_status = furi_message_queue_get(event_queue, &event, 100);
ClockState* plugin_state = (ClockState*)acquire_mutex_block(&state_mutex);
if(event_status == FuriStatusOk) {
// press events
if(event.type == EventTypeKey) {
if(event.input.type == InputTypeShort || event.input.type == InputTypeRepeat) {
switch(event.input.key) {
case InputKeyUp:
case InputKeyDown:
case InputKeyRight:
case InputKeyLeft:
case InputKeyOk:
break;
case InputKeyBack:
// Exit the plugin
processing = false;
break;
}
}
} else if(event.type == EventTypeTick) {
furi_hal_rtc_get_datetime(&plugin_state->datetime);
}
} else {
FURI_LOG_D(TAG, "furi_message_queue: event timeout");
// event timeout
}
view_port_update(view_port);
release_mutex(&state_mutex, plugin_state);
}
furi_timer_free(timer);
view_port_enabled_set(view_port, false);
gui_remove_view_port(gui, view_port);
furi_record_close(RECORD_GUI);
view_port_free(view_port);
furi_message_queue_free(event_queue);
delete_mutex(&state_mutex);
return 0;
}

View File

@@ -7,4 +7,5 @@ App(
requires=["gui"],
stack_size=4 * 1024,
order=40,
fap_category="Debug",
)

View File

@@ -0,0 +1,16 @@
App(
appid="debug_apps",
name="Basic debug apps bundle",
apptype=FlipperAppType.METAPACKAGE,
provides=[
"blink_test",
"vibro_test",
"keypad_test",
"usb_test",
"USB_Mouse",
"UART_Echo",
"display_test",
"text_box_test",
"file_browser_test",
],
)

View File

@@ -0,0 +1,14 @@
App(
appid="battery_test",
name="Battery Test",
apptype=FlipperAppType.DEBUG,
entry_point="battery_test_app",
cdefines=["APP_BATTERY_TEST"],
requires=[
"gui",
"power",
],
stack_size=1 * 1024,
order=130,
fap_category="Debug",
)

View File

@@ -27,7 +27,7 @@ static void battery_test_battery_info_update_model(void* context) {
.charge = app->info.charge,
.health = app->info.health,
};
battery_info_set_data(app->batery_info, &battery_info_data);
battery_info_set_data(app->battery_info, &battery_info_data);
notification_message(app->notifications, &sequence_display_backlight_on);
}
@@ -48,13 +48,13 @@ BatteryTestApp* battery_test_alloc() {
view_dispatcher_attach_to_gui(app->view_dispatcher, app->gui, ViewDispatcherTypeFullscreen);
// Views
app->batery_info = battery_info_alloc();
app->battery_info = battery_info_alloc();
view_set_previous_callback(
battery_info_get_view(app->batery_info), battery_test_exit_confirm_view);
battery_info_get_view(app->battery_info), battery_test_exit_confirm_view);
view_dispatcher_add_view(
app->view_dispatcher,
BatteryTestAppViewBatteryInfo,
battery_info_get_view(app->batery_info));
battery_info_get_view(app->battery_info));
app->dialog = dialog_ex_alloc();
dialog_ex_set_header(app->dialog, "Close Battery Test?", 64, 12, AlignCenter, AlignTop);
@@ -76,7 +76,7 @@ void battery_test_free(BatteryTestApp* app) {
// Views
view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewBatteryInfo);
battery_info_free(app->batery_info);
battery_info_free(app->battery_info);
view_dispatcher_remove_view(app->view_dispatcher, BatteryTestAppViewExitDialog);
dialog_ex_free(app->dialog);
// View dispatcher

View File

@@ -6,14 +6,15 @@
#include <notification/notification.h>
#include <gui/modules/dialog_ex.h>
#include <power/power_settings_app/views/battery_info.h>
// FIXME
#include "../settings/power_settings_app/views/battery_info.h"
typedef struct {
Power* power;
Gui* gui;
NotificationApp* notifications;
ViewDispatcher* view_dispatcher;
BatteryInfo* batery_info;
BatteryInfo* battery_info;
DialogEx* dialog;
PowerInfo info;
} BatteryTestApp;

View File

@@ -0,0 +1,11 @@
App(
appid="blink_test",
name="Blink Test",
apptype=FlipperAppType.DEBUG,
entry_point="blink_test_app",
cdefines=["APP_BLINK"],
requires=["gui"],
stack_size=1 * 1024,
order=10,
fap_category="Debug",
)

View File

@@ -0,0 +1,18 @@
App(
appid="bt_debug",
name="Bluetooth Debug",
apptype=FlipperAppType.DEBUG,
entry_point="bt_debug_app",
cdefines=["SRV_BT"],
requires=[
"bt",
"gui",
"dialogs",
],
provides=[
"bt_debug",
],
stack_size=1 * 1024,
order=110,
fap_category="Debug",
)

View File

@@ -9,7 +9,7 @@
#include <gui/modules/submenu.h>
#include "views/bt_carrier_test.h"
#include "views/bt_packet_test.h"
#include "../bt_settings.h"
#include <bt/bt_settings.h>
typedef struct {
BtSettings settings;

View File

@@ -3,14 +3,13 @@
#include <gui/canvas.h>
#include <gui/elements.h>
#include <m-array.h>
#include <m-string.h>
#include <furi.h>
#include <stdint.h>
struct BtTestParam {
const char* label;
uint8_t current_value_index;
string_t current_value_text;
FuriString* current_value_text;
uint8_t values_count;
BtTestParamChangeCallback change_callback;
void* context;
@@ -85,7 +84,8 @@ static void bt_test_draw_callback(Canvas* canvas, void* _model) {
canvas_draw_str(canvas, 50, param_text_y, "<");
}
canvas_draw_str(canvas, 61, param_text_y, string_get_cstr(param->current_value_text));
canvas_draw_str(
canvas, 61, param_text_y, furi_string_get_cstr(param->current_value_text));
if(param->current_value_index < (param->values_count - 1)) {
canvas_draw_str(canvas, 113, param_text_y, ">");
@@ -154,7 +154,9 @@ static bool bt_test_input_callback(InputEvent* event, void* context) {
void bt_test_process_up(BtTest* bt_test) {
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
uint8_t params_on_screen = 3;
if(model->position > 0) {
model->position--;
@@ -168,13 +170,15 @@ void bt_test_process_up(BtTest* bt_test) {
model->window_position = model->position - (params_on_screen - 1);
}
}
return true;
});
},
true);
}
void bt_test_process_down(BtTest* bt_test) {
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
uint8_t params_on_screen = 3;
if(model->position < (BtTestParamArray_size(model->params) - 1)) {
model->position++;
@@ -187,8 +191,8 @@ void bt_test_process_down(BtTest* bt_test) {
model->position = 0;
model->window_position = 0;
}
return true;
});
},
true);
}
BtTestParam* bt_test_get_selected_param(BtTestModel* model) {
@@ -213,7 +217,9 @@ BtTestParam* bt_test_get_selected_param(BtTestModel* model) {
void bt_test_process_left(BtTest* bt_test) {
BtTestParam* param;
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
param = bt_test_get_selected_param(model);
if(param->current_value_index > 0) {
param->current_value_index--;
@@ -225,8 +231,8 @@ void bt_test_process_left(BtTest* bt_test) {
model->packets_num_tx = 0;
}
}
return true;
});
},
true);
if(param->change_callback) {
param->change_callback(param);
}
@@ -235,7 +241,9 @@ void bt_test_process_left(BtTest* bt_test) {
void bt_test_process_right(BtTest* bt_test) {
BtTestParam* param;
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
param = bt_test_get_selected_param(model);
if(param->current_value_index < (param->values_count - 1)) {
param->current_value_index++;
@@ -247,8 +255,8 @@ void bt_test_process_right(BtTest* bt_test) {
model->packets_num_tx = 0;
}
}
return true;
});
},
true);
if(param->change_callback) {
param->change_callback(param);
}
@@ -257,7 +265,9 @@ void bt_test_process_right(BtTest* bt_test) {
void bt_test_process_ok(BtTest* bt_test) {
BtTestState state;
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
if(model->state == BtTestStateStarted) {
model->state = BtTestStateStopped;
model->message = BT_TEST_START_MESSAGE;
@@ -269,8 +279,8 @@ void bt_test_process_ok(BtTest* bt_test) {
model->message = BT_TEST_STOP_MESSAGE;
}
state = model->state;
return true;
});
},
true);
if(bt_test->change_state_callback) {
bt_test->change_state_callback(state, bt_test->context);
}
@@ -278,13 +288,15 @@ void bt_test_process_ok(BtTest* bt_test) {
void bt_test_process_back(BtTest* bt_test) {
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
model->state = BtTestStateStopped;
model->rssi = 0.0f;
model->packets_num_rx = 0;
model->packets_num_tx = 0;
return false;
});
},
false);
if(bt_test->back_callback) {
bt_test->back_callback(bt_test->context);
}
@@ -299,7 +311,9 @@ BtTest* bt_test_alloc() {
view_set_input_callback(bt_test->view, bt_test_input_callback);
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
model->state = BtTestStateStopped;
model->message = "Ok - Start";
BtTestParamArray_init(model->params);
@@ -308,8 +322,8 @@ BtTest* bt_test_alloc() {
model->rssi = 0.0f;
model->packets_num_tx = 0;
model->packets_num_rx = 0;
return true;
});
},
true);
return bt_test;
}
@@ -318,15 +332,17 @@ void bt_test_free(BtTest* bt_test) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
BtTestParamArray_it_t it;
for(BtTestParamArray_it(it, model->params); !BtTestParamArray_end_p(it);
BtTestParamArray_next(it)) {
string_clear(BtTestParamArray_ref(it)->current_value_text);
furi_string_free(BtTestParamArray_ref(it)->current_value_text);
}
BtTestParamArray_clear(model->params);
return false;
});
},
false);
view_free(bt_test->view);
free(bt_test);
}
@@ -347,16 +363,18 @@ BtTestParam* bt_test_param_add(
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
bt_test->view,
BtTestModel * model,
{
param = BtTestParamArray_push_new(model->params);
param->label = label;
param->values_count = values_count;
param->change_callback = change_callback;
param->context = context;
param->current_value_index = 0;
string_init(param->current_value_text);
return true;
});
param->current_value_text = furi_string_alloc();
},
true);
return param;
}
@@ -364,28 +382,19 @@ BtTestParam* bt_test_param_add(
void bt_test_set_rssi(BtTest* bt_test, float rssi) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
model->rssi = rssi;
return true;
});
bt_test->view, BtTestModel * model, { model->rssi = rssi; }, true);
}
void bt_test_set_packets_tx(BtTest* bt_test, uint32_t packets_num) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
model->packets_num_tx = packets_num;
return true;
});
bt_test->view, BtTestModel * model, { model->packets_num_tx = packets_num; }, true);
}
void bt_test_set_packets_rx(BtTest* bt_test, uint32_t packets_num) {
furi_assert(bt_test);
with_view_model(
bt_test->view, (BtTestModel * model) {
model->packets_num_rx = packets_num;
return true;
});
bt_test->view, BtTestModel * model, { model->packets_num_rx = packets_num; }, true);
}
void bt_test_set_change_state_callback(BtTest* bt_test, BtTestChangeStateCallback callback) {
@@ -410,7 +419,7 @@ void bt_test_set_current_value_index(BtTestParam* param, uint8_t current_value_i
}
void bt_test_set_current_value_text(BtTestParam* param, const char* current_value_text) {
string_set_str(param->current_value_text, current_value_text);
furi_string_set(param->current_value_text, current_value_text);
}
uint8_t bt_test_get_current_value_index(BtTestParam* param) {

View File

@@ -0,0 +1,11 @@
App(
appid="display_test",
name="Display Test",
apptype=FlipperAppType.DEBUG,
entry_point="display_test_app",
cdefines=["APP_DISPLAY_TEST"],
requires=["gui"],
stack_size=1 * 1024,
order=120,
fap_category="Debug",
)

View File

@@ -113,11 +113,11 @@ static void display_config_set_regulation_ratio(VariableItem* item) {
static void display_config_set_contrast(VariableItem* item) {
DisplayTest* instance = variable_item_get_context(item);
uint8_t index = variable_item_get_current_value_index(item);
string_t temp;
string_init(temp);
string_cat_printf(temp, "%d", index);
variable_item_set_current_value_text(item, string_get_cstr(temp));
string_clear(temp);
FuriString* temp;
temp = furi_string_alloc();
furi_string_cat_printf(temp, "%d", index);
variable_item_set_current_value_text(item, furi_string_get_cstr(temp));
furi_string_free(temp);
instance->config_contrast = index;
display_test_reload_config(instance);
}

View File

@@ -110,7 +110,9 @@ static bool view_display_test_input_callback(InputEvent* event, void* context) {
bool consumed = false;
if(event->type == InputTypeShort || event->type == InputTypeRepeat) {
with_view_model(
instance->view, (ViewDisplayTestModel * model) {
instance->view,
ViewDisplayTestModel * model,
{
if(event->key == InputKeyLeft && model->test > 0) {
model->test--;
consumed = true;
@@ -129,8 +131,8 @@ static bool view_display_test_input_callback(InputEvent* event, void* context) {
model->flip_flop = !model->flip_flop;
consumed = true;
}
return consumed;
});
},
consumed);
}
return consumed;
@@ -149,10 +151,7 @@ static void view_display_test_exit(void* context) {
static void view_display_test_timer_callback(void* context) {
ViewDisplayTest* instance = context;
with_view_model(
instance->view, (ViewDisplayTestModel * model) {
model->counter++;
return true;
});
instance->view, ViewDisplayTestModel * model, { model->counter++; }, true);
}
ViewDisplayTest* view_display_test_alloc() {

View File

@@ -0,0 +1,11 @@
App(
appid="file_browser_test",
name="File Browser Test",
apptype=FlipperAppType.DEBUG,
entry_point="file_browser_app",
cdefines=["APP_FILE_BROWSER_TEST"],
requires=["gui"],
stack_size=2 * 1024,
order=150,
fap_category="Debug",
)

View File

@@ -1,7 +1,6 @@
#include "assets_icons.h"
#include "file_browser_app_i.h"
#include "gui/modules/file_browser.h"
#include "m-string.h"
#include <furi.h>
#include <furi_hal.h>
#include <storage/storage.h>
@@ -47,7 +46,7 @@ FileBrowserApp* file_browser_app_alloc(char* arg) {
app->widget = widget_alloc();
string_init(app->file_path);
app->file_path = furi_string_alloc();
app->file_browser = file_browser_alloc(app->file_path);
file_browser_configure(app->file_browser, "*", true, &I_badusb_10px, true);
@@ -84,7 +83,7 @@ void file_browser_app_free(FileBrowserApp* app) {
furi_record_close(RECORD_NOTIFICATION);
furi_record_close(RECORD_DIALOGS);
string_clear(app->file_path);
furi_string_free(app->file_path);
free(app);
}

View File

@@ -22,7 +22,7 @@ struct FileBrowserApp {
Widget* widget;
FileBrowser* file_browser;
string_t file_path;
FuriString* file_path;
};
typedef enum {

View File

@@ -1,8 +1,5 @@
#include "../file_browser_app_i.h"
#include <core/check.h>
#include <core/log.h>
#include "furi_hal.h"
#include "m-string.h"
#include <furi.h>
#define DEFAULT_PATH "/"
#define EXTENSION "*"

View File

@@ -1,6 +1,5 @@
#include "../file_browser_app_i.h"
#include "furi_hal.h"
#include "m-string.h"
#include <furi.h>
void file_browser_scene_result_ok_callback(InputType type, void* context) {
furi_assert(context);
@@ -24,7 +23,13 @@ void file_browser_scene_result_on_enter(void* context) {
FileBrowserApp* app = context;
widget_add_string_multiline_element(
app->widget, 64, 10, AlignCenter, AlignTop, FontSecondary, string_get_cstr(app->file_path));
app->widget,
64,
10,
AlignCenter,
AlignTop,
FontSecondary,
furi_string_get_cstr(app->file_path));
view_dispatcher_switch_to_view(app->view_dispatcher, FileBrowserAppViewResult);
}

View File

@@ -19,7 +19,7 @@ bool file_browser_scene_start_on_event(void* context, SceneManagerEvent event) {
bool consumed = false;
if(event.type == SceneManagerEventTypeCustom) {
string_set_str(app->file_path, ANY_PATH("badusb/demo_windows.txt"));
furi_string_set(app->file_path, ANY_PATH("badusb/demo_windows.txt"));
scene_manager_next_scene(app->scene_manager, FileBrowserSceneBrowser);
consumed = true;
} else if(event.type == SceneManagerEventTypeTick) {

View File

@@ -0,0 +1,11 @@
App(
appid="keypad_test",
name="Keypad Test",
apptype=FlipperAppType.DEBUG,
entry_point="keypad_test_app",
cdefines=["APP_KEYPAD_TEST"],
requires=["gui"],
stack_size=1 * 1024,
order=30,
fap_category="Debug",
)

View File

@@ -5,8 +5,11 @@ App(
entry_point="lfrfid_debug_app",
requires=[
"gui",
"lfrfid",
],
provides=[
"lfrfid_debug",
],
stack_size=1 * 1024,
order=100,
fap_category="Debug",
)

View File

@@ -9,9 +9,8 @@
#include <gui/modules/submenu.h>
#include <lfrfid_debug/views/lfrfid_debug_view_tune.h>
#include <lfrfid_debug/scenes/lfrfid_debug_scene.h>
#include "views/lfrfid_debug_view_tune.h"
#include "scenes/lfrfid_debug_scene.h"
typedef struct LfRfidDebug LfRfidDebug;

View File

@@ -52,23 +52,29 @@ static void lfrfid_debug_view_tune_draw_callback(Canvas* canvas, void* _model) {
static void lfrfid_debug_view_tune_button_up(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos > 0) model->pos--;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_down(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos < 1) model->pos++;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_left(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos == 0) {
if(model->fine) {
model->ARR -= 1;
@@ -84,13 +90,15 @@ static void lfrfid_debug_view_tune_button_left(LfRfidTuneView* tune_view) {
}
model->dirty = true;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_right(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
if(model->pos == 0) {
if(model->fine) {
model->ARR += 1;
@@ -106,16 +114,13 @@ static void lfrfid_debug_view_tune_button_right(LfRfidTuneView* tune_view) {
}
model->dirty = true;
return true;
});
},
true);
}
static void lfrfid_debug_view_tune_button_ok(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
model->fine = !model->fine;
return true;
});
tune_view->view, LfRfidTuneViewModel * model, { model->fine = !model->fine; }, true);
}
static bool lfrfid_debug_view_tune_input_callback(InputEvent* event, void* context) {
@@ -158,14 +163,16 @@ LfRfidTuneView* lfrfid_debug_view_tune_alloc() {
view_allocate_model(tune_view->view, ViewModelTypeLocking, sizeof(LfRfidTuneViewModel));
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
model->dirty = true;
model->fine = false;
model->ARR = 511;
model->CCR = 255;
model->pos = 0;
return true;
});
},
true);
view_set_draw_callback(tune_view->view, lfrfid_debug_view_tune_draw_callback);
view_set_input_callback(tune_view->view, lfrfid_debug_view_tune_input_callback);
@@ -184,24 +191,28 @@ View* lfrfid_debug_view_tune_get_view(LfRfidTuneView* tune_view) {
void lfrfid_debug_view_tune_clean(LfRfidTuneView* tune_view) {
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
model->dirty = true;
model->fine = false;
model->ARR = 511;
model->CCR = 255;
model->pos = 0;
return true;
});
},
true);
}
bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view) {
bool result = false;
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
tune_view->view,
LfRfidTuneViewModel * model,
{
result = model->dirty;
model->dirty = false;
return false;
});
},
false);
return result;
}
@@ -209,10 +220,7 @@ bool lfrfid_debug_view_tune_is_dirty(LfRfidTuneView* tune_view) {
uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view) {
uint32_t result = false;
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
result = model->ARR;
return false;
});
tune_view->view, LfRfidTuneViewModel * model, { result = model->ARR; }, false);
return result;
}
@@ -220,10 +228,7 @@ uint32_t lfrfid_debug_view_tune_get_arr(LfRfidTuneView* tune_view) {
uint32_t lfrfid_debug_view_tune_get_ccr(LfRfidTuneView* tune_view) {
uint32_t result = false;
with_view_model(
tune_view->view, (LfRfidTuneViewModel * model) {
result = model->CCR;
return false;
});
tune_view->view, LfRfidTuneViewModel * model, { result = model->CCR; }, false);
return result;
}

View File

@@ -0,0 +1,11 @@
App(
appid="text_box_test",
name="Text Box Test",
apptype=FlipperAppType.DEBUG,
entry_point="text_box_test_app",
cdefines=["APP_TEXT_BOX_TEST"],
requires=["gui"],
stack_size=1 * 1024,
order=140,
fap_category="Debug",
)

View File

@@ -0,0 +1,12 @@
App(
appid="UART_Echo",
name="UART Echo",
apptype=FlipperAppType.PLUGIN,
entry_point="uart_echo_app",
cdefines=["APP_UART_ECHO"],
requires=["gui"],
stack_size=2 * 1024,
order=70,
fap_icon="uart_10px.png",
fap_category="Misc",
)

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,10 +1,8 @@
#include <furi.h>
#include <m-string.h>
#include <gui/gui.h>
#include <notification/notification.h>
#include <notification/notification_messages.h>
#include <gui/elements.h>
#include <stream_buffer.h>
#include <furi_hal_uart.h>
#include <furi_hal_console.h>
#include <gui/view_dispatcher.h>
@@ -21,11 +19,11 @@ typedef struct {
ViewDispatcher* view_dispatcher;
View* view;
FuriThread* worker_thread;
StreamBufferHandle_t rx_stream;
FuriStreamBuffer* rx_stream;
} UartEchoApp;
typedef struct {
string_t text;
FuriString* text;
} ListElement;
struct UartDumpModel {
@@ -64,10 +62,11 @@ static void uart_echo_view_draw_callback(Canvas* canvas, void* _model) {
canvas,
0,
(i + 1) * (canvas_current_font_height(canvas) - 1),
string_get_cstr(model->list[i]->text));
furi_string_get_cstr(model->list[i]->text));
if(i == model->line) {
uint8_t width = canvas_string_width(canvas, string_get_cstr(model->list[i]->text));
uint8_t width =
canvas_string_width(canvas, furi_string_get_cstr(model->list[i]->text));
canvas_draw_box(
canvas,
@@ -92,13 +91,11 @@ static uint32_t uart_echo_exit(void* context) {
static void uart_echo_on_irq_cb(UartIrqEvent ev, uint8_t data, void* context) {
furi_assert(context);
BaseType_t xHigherPriorityTaskWoken = pdFALSE;
UartEchoApp* app = context;
if(ev == UartIrqEventRXNE) {
xStreamBufferSendFromISR(app->rx_stream, &data, 1, &xHigherPriorityTaskWoken);
furi_stream_buffer_send(app->rx_stream, &data, 1, 0);
furi_thread_flags_set(furi_thread_get_id(app->worker_thread), WorkerEventRx);
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
}
}
@@ -113,7 +110,7 @@ static void uart_echo_push_to_list(UartDumpModel* model, const char data) {
model->escape = true;
} else if((data >= ' ' && data <= '~') || (data == '\n' || data == '\r')) {
bool new_string_needed = false;
if(string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
if(furi_string_size(model->list[model->line]->text) >= COLUMNS_ON_SCREEN) {
new_string_needed = true;
} else if((data == '\n' || data == '\r')) {
// pack line breaks
@@ -132,13 +129,13 @@ static void uart_echo_push_to_list(UartDumpModel* model, const char data) {
model->list[i - 1] = model->list[i];
}
string_reset(first->text);
furi_string_reset(first->text);
model->list[model->line] = first;
}
}
if(data != '\n' && data != '\r') {
string_push_back(model->list[model->line]->text, data);
furi_string_push_back(model->list[model->line]->text, data);
}
}
model->last_char = data;
@@ -158,25 +155,24 @@ static int32_t uart_echo_worker(void* context) {
size_t length = 0;
do {
uint8_t data[64];
length = xStreamBufferReceive(app->rx_stream, data, 64, 0);
length = furi_stream_buffer_receive(app->rx_stream, data, 64, 0);
if(length > 0) {
furi_hal_uart_tx(FuriHalUartIdUSART1, data, length);
with_view_model(
app->view, (UartDumpModel * model) {
app->view,
UartDumpModel * model,
{
for(size_t i = 0; i < length; i++) {
uart_echo_push_to_list(model, data[i]);
}
return false;
});
},
false);
}
} while(length > 0);
notification_message(app->notification, &sequence_notification);
with_view_model(
app->view, (UartDumpModel * model) {
UNUSED(model);
return true;
});
app->view, UartDumpModel * model, { UNUSED(model); }, true);
}
}
@@ -186,7 +182,7 @@ static int32_t uart_echo_worker(void* context) {
static UartEchoApp* uart_echo_app_alloc() {
UartEchoApp* app = malloc(sizeof(UartEchoApp));
app->rx_stream = xStreamBufferCreate(2048, 1);
app->rx_stream = furi_stream_buffer_alloc(2048, 1);
// Gui
app->gui = furi_record_open(RECORD_GUI);
@@ -203,15 +199,17 @@ static UartEchoApp* uart_echo_app_alloc() {
view_set_input_callback(app->view, uart_echo_view_input_callback);
view_allocate_model(app->view, ViewModelTypeLocking, sizeof(UartDumpModel));
with_view_model(
app->view, (UartDumpModel * model) {
app->view,
UartDumpModel * model,
{
for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
model->line = 0;
model->escape = false;
model->list[i] = malloc(sizeof(ListElement));
string_init(model->list[i]->text);
model->list[i]->text = furi_string_alloc();
}
return true;
});
},
true);
view_set_previous_callback(app->view, uart_echo_exit);
view_dispatcher_add_view(app->view_dispatcher, 0, app->view);
@@ -245,13 +243,15 @@ static void uart_echo_app_free(UartEchoApp* app) {
view_dispatcher_remove_view(app->view_dispatcher, 0);
with_view_model(
app->view, (UartDumpModel * model) {
app->view,
UartDumpModel * model,
{
for(size_t i = 0; i < LINES_ON_SCREEN; i++) {
string_clear(model->list[i]->text);
furi_string_free(model->list[i]->text);
free(model->list[i]);
}
return true;
});
},
true);
view_free(app->view);
view_dispatcher_free(app->view_dispatcher);
@@ -260,7 +260,7 @@ static void uart_echo_app_free(UartEchoApp* app) {
furi_record_close(RECORD_NOTIFICATION);
app->gui = NULL;
vStreamBufferDelete(app->rx_stream);
furi_stream_buffer_free(app->rx_stream);
// Free rest
free(app);

View File

@@ -10,7 +10,7 @@ App(
App(
appid="delay_test",
name="Delay Test",
apptype=FlipperAppType.DEBUG,
apptype=FlipperAppType.SYSTEM,
entry_point="delay_test_app",
stack_size=1 * 1024,
requires=["unit_tests"],

View File

@@ -58,7 +58,7 @@ static const char* test_data_win = "Filetype: Flipper Format test\r\n"
#define ARRAY_W_BSIZE(x) (x), (sizeof(x))
MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
string_t tmpstr;
FuriString* tmpstr;
uint32_t version;
uint32_t uint32_data[COUNT_OF(test_uint_data)];
int32_t int32_data[COUNT_OF(test_int_data)];
@@ -101,14 +101,14 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_assert_int_eq(position_before, stream_tell(flipper_format_get_raw_stream(flipper_format)));
// read test
string_init(tmpstr);
tmpstr = furi_string_alloc();
mu_check(flipper_format_read_header(flipper_format, tmpstr, &version));
mu_assert_string_eq(test_filetype, string_get_cstr(tmpstr));
mu_assert_string_eq(test_filetype, furi_string_get_cstr(tmpstr));
mu_assert_int_eq(test_version, version);
mu_check(flipper_format_read_string(flipper_format, test_string_key, tmpstr));
mu_assert_string_eq(test_string_data, string_get_cstr(tmpstr));
mu_assert_string_eq(test_string_data, furi_string_get_cstr(tmpstr));
mu_check(flipper_format_get_value_count(flipper_format, test_int_key, &count));
mu_assert_int_eq(COUNT_OF(test_int_data), count);
@@ -133,7 +133,7 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_check(!flipper_format_read_string(flipper_format, "Key that doesn't exist", tmpstr));
string_clear(tmpstr);
furi_string_free(tmpstr);
// update data
mu_check(flipper_format_rewind(flipper_format));
@@ -155,14 +155,14 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
uint8_t hex_updated_data[COUNT_OF(test_hex_updated_data)];
mu_check(flipper_format_rewind(flipper_format));
string_init(tmpstr);
tmpstr = furi_string_alloc();
mu_check(flipper_format_read_header(flipper_format, tmpstr, &version));
mu_assert_string_eq(test_filetype, string_get_cstr(tmpstr));
mu_assert_string_eq(test_filetype, furi_string_get_cstr(tmpstr));
mu_assert_int_eq(test_version, version);
mu_check(flipper_format_read_string(flipper_format, test_string_key, tmpstr));
mu_assert_string_eq(test_string_updated_data, string_get_cstr(tmpstr));
mu_assert_string_eq(test_string_updated_data, furi_string_get_cstr(tmpstr));
mu_check(flipper_format_get_value_count(flipper_format, test_int_key, &count));
mu_assert_int_eq(COUNT_OF(test_int_updated_data), count);
@@ -190,7 +190,7 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_check(!flipper_format_read_string(flipper_format, "Key that doesn't exist", tmpstr));
string_clear(tmpstr);
furi_string_free(tmpstr);
// update data
mu_check(flipper_format_rewind(flipper_format));
@@ -214,14 +214,14 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
uint8_t hex_new_data[COUNT_OF(test_hex_new_data)];
mu_check(flipper_format_rewind(flipper_format));
string_init(tmpstr);
tmpstr = furi_string_alloc();
mu_check(flipper_format_read_header(flipper_format, tmpstr, &version));
mu_assert_string_eq(test_filetype, string_get_cstr(tmpstr));
mu_assert_string_eq(test_filetype, furi_string_get_cstr(tmpstr));
mu_assert_int_eq(test_version, version);
mu_check(flipper_format_read_string(flipper_format, test_string_key, tmpstr));
mu_assert_string_eq(test_string_updated_2_data, string_get_cstr(tmpstr));
mu_assert_string_eq(test_string_updated_2_data, furi_string_get_cstr(tmpstr));
mu_check(flipper_format_get_value_count(flipper_format, test_int_key, &count));
mu_assert_int_eq(COUNT_OF(test_int_updated_2_data), count);
@@ -255,7 +255,7 @@ MU_TEST_1(flipper_format_read_and_update_test, FlipperFormat* flipper_format) {
mu_check(!flipper_format_read_string(flipper_format, "Key that doesn't exist", tmpstr));
string_clear(tmpstr);
furi_string_free(tmpstr);
// delete key test
mu_check(flipper_format_rewind(flipper_format));

View File

@@ -57,6 +57,23 @@ static const char* test_data_win = "Filetype: Flipper File test\r\n"
"Hex data: DE AD BE";
#define READ_TEST_FLP "ff_flp.test"
#define READ_TEST_ODD "ff_oddities.test"
static const char* test_data_odd = "Filetype: Flipper File test\n"
// Tabs before newline
"Version: 666\t\t\n"
"# This is comment\n"
// Windows newline in a UNIX file
"String data: String\r\n"
// Trailing whitespace
"Int32 data: 1234 -6345 7813 0 \n"
// Extra whitespace
"Uint32 data: 1234 0 5678 9098 7654321 \n"
// Mixed whitespace
"Float data: 1.5\t \t1000.0\n"
// Leading tabs after key
"Bool data:\t\ttrue false\n"
// Mixed trailing whitespace
"Hex data: DE AD BE\t ";
// data created by user on linux machine
static const char* test_file_linux = TEST_DIR READ_TEST_NIX;
@@ -64,6 +81,8 @@ static const char* test_file_linux = TEST_DIR READ_TEST_NIX;
static const char* test_file_windows = TEST_DIR READ_TEST_WIN;
// data created by flipper itself
static const char* test_file_flipper = TEST_DIR READ_TEST_FLP;
// data containing odd user input
static const char* test_file_oddities = TEST_DIR READ_TEST_ODD;
static bool storage_write_string(const char* path, const char* data) {
Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -102,8 +121,8 @@ static bool test_read(const char* file_name) {
bool result = false;
FlipperFormat* file = flipper_format_file_alloc(storage);
string_t string_value;
string_init(string_value);
FuriString* string_value;
string_value = furi_string_alloc();
uint32_t uint32_value;
void* scratchpad = malloc(512);
@@ -111,11 +130,11 @@ static bool test_read(const char* file_name) {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, string_value, &uint32_value)) break;
if(string_cmp_str(string_value, test_filetype) != 0) break;
if(furi_string_cmp_str(string_value, test_filetype) != 0) break;
if(uint32_value != test_version) break;
if(!flipper_format_read_string(file, test_string_key, string_value)) break;
if(string_cmp_str(string_value, test_string_data) != 0) break;
if(furi_string_cmp_str(string_value, test_string_data) != 0) break;
if(!flipper_format_get_value_count(file, test_int_key, &uint32_value)) break;
if(uint32_value != COUNT_OF(test_int_data)) break;
@@ -150,7 +169,7 @@ static bool test_read(const char* file_name) {
} while(false);
free(scratchpad);
string_clear(string_value);
furi_string_free(string_value);
flipper_format_free(file);
@@ -164,8 +183,8 @@ static bool test_read_updated(const char* file_name) {
bool result = false;
FlipperFormat* file = flipper_format_file_alloc(storage);
string_t string_value;
string_init(string_value);
FuriString* string_value;
string_value = furi_string_alloc();
uint32_t uint32_value;
void* scratchpad = malloc(512);
@@ -173,11 +192,11 @@ static bool test_read_updated(const char* file_name) {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, string_value, &uint32_value)) break;
if(string_cmp_str(string_value, test_filetype) != 0) break;
if(furi_string_cmp_str(string_value, test_filetype) != 0) break;
if(uint32_value != test_version) break;
if(!flipper_format_read_string(file, test_string_key, string_value)) break;
if(string_cmp_str(string_value, test_string_updated_data) != 0) break;
if(furi_string_cmp_str(string_value, test_string_updated_data) != 0) break;
if(!flipper_format_get_value_count(file, test_int_key, &uint32_value)) break;
if(uint32_value != COUNT_OF(test_int_updated_data)) break;
@@ -228,7 +247,7 @@ static bool test_read_updated(const char* file_name) {
} while(false);
free(scratchpad);
string_clear(string_value);
furi_string_free(string_value);
flipper_format_free(file);
@@ -401,14 +420,14 @@ static bool test_read_multikey(const char* file_name) {
bool result = false;
FlipperFormat* file = flipper_format_file_alloc(storage);
string_t string_value;
string_init(string_value);
FuriString* string_value;
string_value = furi_string_alloc();
uint32_t uint32_value;
do {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, string_value, &uint32_value)) break;
if(string_cmp_str(string_value, test_filetype) != 0) break;
if(furi_string_cmp_str(string_value, test_filetype) != 0) break;
if(uint32_value != test_version) break;
bool error = false;
@@ -429,7 +448,7 @@ static bool test_read_multikey(const char* file_name) {
result = true;
} while(false);
string_clear(string_value);
furi_string_free(string_value);
flipper_format_free(file);
furi_record_close(RECORD_STORAGE);
@@ -503,6 +522,12 @@ MU_TEST(flipper_format_multikey_test) {
mu_assert(test_read_multikey(TEST_DIR "ff_multiline.test"), "Multikey read test error");
}
MU_TEST(flipper_format_oddities_test) {
mu_assert(
storage_write_string(test_file_oddities, test_data_odd), "Write test error [Oddities]");
mu_assert(test_read(test_file_linux), "Read test error [Oddities]");
}
MU_TEST_SUITE(flipper_format) {
tests_setup();
MU_RUN_TEST(flipper_format_write_test);
@@ -516,6 +541,7 @@ MU_TEST_SUITE(flipper_format) {
MU_RUN_TEST(flipper_format_update_2_test);
MU_RUN_TEST(flipper_format_update_2_result_test);
MU_RUN_TEST(flipper_format_multikey_test);
MU_RUN_TEST(flipper_format_oddities_test);
tests_teardown();
}

View File

@@ -0,0 +1,469 @@
#include <furi.h>
#include "../minunit.h"
static void test_setup(void) {
}
static void test_teardown(void) {
}
static FuriString* furi_string_alloc_vprintf_test(const char format[], ...) {
va_list args;
va_start(args, format);
FuriString* string = furi_string_alloc_vprintf(format, args);
va_end(args);
return string;
}
MU_TEST(mu_test_furi_string_alloc_free) {
FuriString* tmp;
FuriString* string;
// test alloc and free
string = furi_string_alloc();
mu_check(string != NULL);
mu_check(furi_string_empty(string));
furi_string_free(string);
// test furi_string_alloc_set_str and free
string = furi_string_alloc_set_str("test");
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "test") == 0);
furi_string_free(string);
// test furi_string_alloc_set and free
tmp = furi_string_alloc_set("more");
string = furi_string_alloc_set(tmp);
furi_string_free(tmp);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "more") == 0);
furi_string_free(string);
// test alloc_printf and free
string = furi_string_alloc_printf("test %d %s %c 0x%02x", 1, "two", '3', 0x04);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "test 1 two 3 0x04") == 0);
furi_string_free(string);
// test alloc_vprintf and free
string = furi_string_alloc_vprintf_test("test %d %s %c 0x%02x", 4, "five", '6', 0x07);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "test 4 five 6 0x07") == 0);
furi_string_free(string);
// test alloc_move and free
tmp = furi_string_alloc_set("move");
string = furi_string_alloc_move(tmp);
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
mu_check(furi_string_cmp(string, "move") == 0);
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_mem) {
FuriString* string = furi_string_alloc_set("test");
mu_check(string != NULL);
mu_check(!furi_string_empty(string));
// TODO: how to test furi_string_reserve?
// test furi_string_reset
furi_string_reset(string);
mu_check(furi_string_empty(string));
// test furi_string_swap
furi_string_set(string, "test");
FuriString* swap_string = furi_string_alloc_set("swap");
furi_string_swap(string, swap_string);
mu_check(furi_string_cmp(string, "swap") == 0);
mu_check(furi_string_cmp(swap_string, "test") == 0);
furi_string_free(swap_string);
// test furi_string_move
FuriString* move_string = furi_string_alloc_set("move");
furi_string_move(string, move_string);
mu_check(furi_string_cmp(string, "move") == 0);
// move_string is now empty
// and tested by leaked memory check at the end of the tests
furi_string_set(string, "abracadabra");
// test furi_string_hash
mu_assert_int_eq(0xc3bc16d7, furi_string_hash(string));
// test furi_string_size
mu_assert_int_eq(11, furi_string_size(string));
// test furi_string_empty
mu_check(!furi_string_empty(string));
furi_string_reset(string);
mu_check(furi_string_empty(string));
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_getters) {
FuriString* string = furi_string_alloc_set("test");
// test furi_string_get_char
mu_check(furi_string_get_char(string, 0) == 't');
mu_check(furi_string_get_char(string, 1) == 'e');
mu_check(furi_string_get_char(string, 2) == 's');
mu_check(furi_string_get_char(string, 3) == 't');
// test furi_string_get_cstr
mu_assert_string_eq("test", furi_string_get_cstr(string));
furi_string_free(string);
}
static FuriString* furi_string_vprintf_test(FuriString* string, const char format[], ...) {
va_list args;
va_start(args, format);
furi_string_vprintf(string, format, args);
va_end(args);
return string;
}
MU_TEST(mu_test_furi_string_setters) {
FuriString* tmp;
FuriString* string = furi_string_alloc();
// test furi_string_set_str
furi_string_set_str(string, "test");
mu_assert_string_eq("test", furi_string_get_cstr(string));
// test furi_string_set
tmp = furi_string_alloc_set("more");
furi_string_set(string, tmp);
furi_string_free(tmp);
mu_assert_string_eq("more", furi_string_get_cstr(string));
// test furi_string_set_strn
furi_string_set_strn(string, "test", 2);
mu_assert_string_eq("te", furi_string_get_cstr(string));
// test furi_string_set_char
furi_string_set_char(string, 0, 'a');
furi_string_set_char(string, 1, 'b');
mu_assert_string_eq("ab", furi_string_get_cstr(string));
// test furi_string_set_n
tmp = furi_string_alloc_set("dodecahedron");
furi_string_set_n(string, tmp, 4, 5);
furi_string_free(tmp);
mu_assert_string_eq("cahed", furi_string_get_cstr(string));
// test furi_string_printf
furi_string_printf(string, "test %d %s %c 0x%02x", 1, "two", '3', 0x04);
mu_assert_string_eq("test 1 two 3 0x04", furi_string_get_cstr(string));
// test furi_string_vprintf
furi_string_vprintf_test(string, "test %d %s %c 0x%02x", 4, "five", '6', 0x07);
mu_assert_string_eq("test 4 five 6 0x07", furi_string_get_cstr(string));
furi_string_free(string);
}
static FuriString* furi_string_cat_vprintf_test(FuriString* string, const char format[], ...) {
va_list args;
va_start(args, format);
furi_string_cat_vprintf(string, format, args);
va_end(args);
return string;
}
MU_TEST(mu_test_furi_string_appends) {
FuriString* tmp;
FuriString* string = furi_string_alloc();
// test furi_string_push_back
furi_string_push_back(string, 't');
furi_string_push_back(string, 'e');
furi_string_push_back(string, 's');
furi_string_push_back(string, 't');
mu_assert_string_eq("test", furi_string_get_cstr(string));
furi_string_push_back(string, '!');
mu_assert_string_eq("test!", furi_string_get_cstr(string));
// test furi_string_cat_str
furi_string_cat_str(string, "test");
mu_assert_string_eq("test!test", furi_string_get_cstr(string));
// test furi_string_cat
tmp = furi_string_alloc_set("more");
furi_string_cat(string, tmp);
furi_string_free(tmp);
mu_assert_string_eq("test!testmore", furi_string_get_cstr(string));
// test furi_string_cat_printf
furi_string_cat_printf(string, "test %d %s %c 0x%02x", 1, "two", '3', 0x04);
mu_assert_string_eq("test!testmoretest 1 two 3 0x04", furi_string_get_cstr(string));
// test furi_string_cat_vprintf
furi_string_cat_vprintf_test(string, "test %d %s %c 0x%02x", 4, "five", '6', 0x07);
mu_assert_string_eq(
"test!testmoretest 1 two 3 0x04test 4 five 6 0x07", furi_string_get_cstr(string));
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_compare) {
FuriString* string_1 = furi_string_alloc_set("string_1");
FuriString* string_2 = furi_string_alloc_set("string_2");
// test furi_string_cmp
mu_assert_int_eq(0, furi_string_cmp(string_1, string_1));
mu_assert_int_eq(0, furi_string_cmp(string_2, string_2));
mu_assert_int_eq(-1, furi_string_cmp(string_1, string_2));
mu_assert_int_eq(1, furi_string_cmp(string_2, string_1));
// test furi_string_cmp_str
mu_assert_int_eq(0, furi_string_cmp_str(string_1, "string_1"));
mu_assert_int_eq(0, furi_string_cmp_str(string_2, "string_2"));
mu_assert_int_eq(-1, furi_string_cmp_str(string_1, "string_2"));
mu_assert_int_eq(1, furi_string_cmp_str(string_2, "string_1"));
// test furi_string_cmpi
furi_string_set(string_1, "string");
furi_string_set(string_2, "StrIng");
mu_assert_int_eq(0, furi_string_cmpi(string_1, string_1));
mu_assert_int_eq(0, furi_string_cmpi(string_2, string_2));
mu_assert_int_eq(0, furi_string_cmpi(string_1, string_2));
mu_assert_int_eq(0, furi_string_cmpi(string_2, string_1));
furi_string_set(string_1, "string_1");
furi_string_set(string_2, "StrIng_2");
mu_assert_int_eq(32, furi_string_cmp(string_1, string_2));
mu_assert_int_eq(-32, furi_string_cmp(string_2, string_1));
mu_assert_int_eq(-1, furi_string_cmpi(string_1, string_2));
mu_assert_int_eq(1, furi_string_cmpi(string_2, string_1));
// test furi_string_cmpi_str
furi_string_set(string_1, "string");
mu_assert_int_eq(0, furi_string_cmp_str(string_1, "string"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "String"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STring"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRing"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRIng"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRINg"));
mu_assert_int_eq(32, furi_string_cmp_str(string_1, "STRING"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "string"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "String"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STring"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRing"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRIng"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRINg"));
mu_assert_int_eq(0, furi_string_cmpi_str(string_1, "STRING"));
furi_string_free(string_1);
furi_string_free(string_2);
}
MU_TEST(mu_test_furi_string_search) {
// 012345678901234567
FuriString* haystack = furi_string_alloc_set("test321test123test");
FuriString* needle = furi_string_alloc_set("test");
// test furi_string_search
mu_assert_int_eq(0, furi_string_search(haystack, needle));
mu_assert_int_eq(7, furi_string_search(haystack, needle, 1));
mu_assert_int_eq(14, furi_string_search(haystack, needle, 8));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search(haystack, needle, 15));
FuriString* tmp = furi_string_alloc_set("testnone");
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search(haystack, tmp));
furi_string_free(tmp);
// test furi_string_search_str
mu_assert_int_eq(0, furi_string_search_str(haystack, "test"));
mu_assert_int_eq(7, furi_string_search_str(haystack, "test", 1));
mu_assert_int_eq(14, furi_string_search_str(haystack, "test", 8));
mu_assert_int_eq(4, furi_string_search_str(haystack, "321"));
mu_assert_int_eq(11, furi_string_search_str(haystack, "123"));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_str(haystack, "testnone"));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_str(haystack, "test", 15));
// test furi_string_search_char
mu_assert_int_eq(0, furi_string_search_char(haystack, 't'));
mu_assert_int_eq(1, furi_string_search_char(haystack, 'e'));
mu_assert_int_eq(2, furi_string_search_char(haystack, 's'));
mu_assert_int_eq(3, furi_string_search_char(haystack, 't', 1));
mu_assert_int_eq(7, furi_string_search_char(haystack, 't', 4));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_char(haystack, 'x'));
// test furi_string_search_rchar
mu_assert_int_eq(17, furi_string_search_rchar(haystack, 't'));
mu_assert_int_eq(15, furi_string_search_rchar(haystack, 'e'));
mu_assert_int_eq(16, furi_string_search_rchar(haystack, 's'));
mu_assert_int_eq(13, furi_string_search_rchar(haystack, '3'));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_rchar(haystack, '3', 14));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_search_rchar(haystack, 'x'));
furi_string_free(haystack);
furi_string_free(needle);
}
MU_TEST(mu_test_furi_string_equality) {
FuriString* string = furi_string_alloc_set("test");
FuriString* string_eq = furi_string_alloc_set("test");
FuriString* string_neq = furi_string_alloc_set("test2");
// test furi_string_equal
mu_check(furi_string_equal(string, string_eq));
mu_check(!furi_string_equal(string, string_neq));
// test furi_string_equal_str
mu_check(furi_string_equal_str(string, "test"));
mu_check(!furi_string_equal_str(string, "test2"));
mu_check(furi_string_equal_str(string_neq, "test2"));
mu_check(!furi_string_equal_str(string_neq, "test"));
furi_string_free(string);
furi_string_free(string_eq);
furi_string_free(string_neq);
}
MU_TEST(mu_test_furi_string_replace) {
FuriString* needle = furi_string_alloc_set("test");
FuriString* replace = furi_string_alloc_set("replace");
FuriString* string = furi_string_alloc_set("test123test");
// test furi_string_replace_at
furi_string_replace_at(string, 4, 3, "!biglongword!");
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
// test furi_string_replace
mu_assert_int_eq(17, furi_string_replace(string, needle, replace, 1));
mu_assert_string_eq("test!biglongword!replace", furi_string_get_cstr(string));
mu_assert_int_eq(0, furi_string_replace(string, needle, replace));
mu_assert_string_eq("replace!biglongword!replace", furi_string_get_cstr(string));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_replace(string, needle, replace));
mu_assert_string_eq("replace!biglongword!replace", furi_string_get_cstr(string));
// test furi_string_replace_str
mu_assert_int_eq(20, furi_string_replace_str(string, "replace", "test", 1));
mu_assert_string_eq("replace!biglongword!test", furi_string_get_cstr(string));
mu_assert_int_eq(0, furi_string_replace_str(string, "replace", "test"));
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
mu_assert_int_eq(FURI_STRING_FAILURE, furi_string_replace_str(string, "replace", "test"));
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
// test furi_string_replace_all
furi_string_replace_all(string, needle, replace);
mu_assert_string_eq("replace!biglongword!replace", furi_string_get_cstr(string));
// test furi_string_replace_all_str
furi_string_replace_all_str(string, "replace", "test");
mu_assert_string_eq("test!biglongword!test", furi_string_get_cstr(string));
furi_string_free(string);
furi_string_free(needle);
furi_string_free(replace);
}
MU_TEST(mu_test_furi_string_start_end) {
FuriString* string = furi_string_alloc_set("start_end");
FuriString* start = furi_string_alloc_set("start");
FuriString* end = furi_string_alloc_set("end");
// test furi_string_start_with
mu_check(furi_string_start_with(string, start));
mu_check(!furi_string_start_with(string, end));
// test furi_string_start_with_str
mu_check(furi_string_start_with_str(string, "start"));
mu_check(!furi_string_start_with_str(string, "end"));
// test furi_string_end_with
mu_check(furi_string_end_with(string, end));
mu_check(!furi_string_end_with(string, start));
// test furi_string_end_with_str
mu_check(furi_string_end_with_str(string, "end"));
mu_check(!furi_string_end_with_str(string, "start"));
furi_string_free(string);
furi_string_free(start);
furi_string_free(end);
}
MU_TEST(mu_test_furi_string_trim) {
FuriString* string = furi_string_alloc_set("biglongstring");
// test furi_string_left
furi_string_left(string, 7);
mu_assert_string_eq("biglong", furi_string_get_cstr(string));
// test furi_string_right
furi_string_right(string, 3);
mu_assert_string_eq("long", furi_string_get_cstr(string));
// test furi_string_mid
furi_string_mid(string, 1, 2);
mu_assert_string_eq("on", furi_string_get_cstr(string));
// test furi_string_trim
furi_string_set(string, " \n\r\tbiglongstring \n\r\t ");
furi_string_trim(string);
mu_assert_string_eq("biglongstring", furi_string_get_cstr(string));
furi_string_set(string, "aaaabaaaabbaaabaaaabbtestaaaaaabbaaabaababaa");
furi_string_trim(string, "ab");
mu_assert_string_eq("test", furi_string_get_cstr(string));
furi_string_free(string);
}
MU_TEST(mu_test_furi_string_utf8) {
FuriString* utf8_string = furi_string_alloc_set("イルカ");
// test furi_string_utf8_length
mu_assert_int_eq(9, furi_string_size(utf8_string));
mu_assert_int_eq(3, furi_string_utf8_length(utf8_string));
// test furi_string_utf8_decode
const uint8_t dolphin_emoji_array[4] = {0xF0, 0x9F, 0x90, 0xAC};
FuriStringUTF8State state = FuriStringUTF8StateStarting;
FuriStringUnicodeValue value = 0;
furi_string_utf8_decode(dolphin_emoji_array[0], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateDecoding3, state);
furi_string_utf8_decode(dolphin_emoji_array[1], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateDecoding2, state);
furi_string_utf8_decode(dolphin_emoji_array[2], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateDecoding1, state);
furi_string_utf8_decode(dolphin_emoji_array[3], &state, &value);
mu_assert_int_eq(FuriStringUTF8StateStarting, state);
mu_assert_int_eq(0x1F42C, value);
// test furi_string_utf8_push
furi_string_set(utf8_string, "");
furi_string_utf8_push(utf8_string, value);
mu_assert_string_eq("🐬", furi_string_get_cstr(utf8_string));
furi_string_free(utf8_string);
}
MU_TEST_SUITE(test_suite) {
MU_SUITE_CONFIGURE(&test_setup, &test_teardown);
MU_RUN_TEST(mu_test_furi_string_alloc_free);
MU_RUN_TEST(mu_test_furi_string_mem);
MU_RUN_TEST(mu_test_furi_string_getters);
MU_RUN_TEST(mu_test_furi_string_setters);
MU_RUN_TEST(mu_test_furi_string_appends);
MU_RUN_TEST(mu_test_furi_string_compare);
MU_RUN_TEST(mu_test_furi_string_search);
MU_RUN_TEST(mu_test_furi_string_equality);
MU_RUN_TEST(mu_test_furi_string_replace);
MU_RUN_TEST(mu_test_furi_string_start_end);
MU_RUN_TEST(mu_test_furi_string_trim);
MU_RUN_TEST(mu_test_furi_string_utf8);
}
int run_minunit_test_furi_string() {
MU_RUN_SUITE(test_suite);
return MU_EXIT_CODE;
}

View File

@@ -11,7 +11,7 @@
typedef struct {
InfraredDecoderHandler* decoder_handler;
InfraredEncoderHandler* encoder_handler;
string_t file_path;
FuriString* file_path;
FlipperFormat* ff;
} InfraredTest;
@@ -23,7 +23,7 @@ static void infrared_test_alloc() {
test->decoder_handler = infrared_alloc_decoder();
test->encoder_handler = infrared_alloc_encoder();
test->ff = flipper_format_buffered_file_alloc(storage);
string_init(test->file_path);
test->file_path = furi_string_alloc();
}
static void infrared_test_free() {
@@ -31,18 +31,18 @@ static void infrared_test_free() {
infrared_free_decoder(test->decoder_handler);
infrared_free_encoder(test->encoder_handler);
flipper_format_free(test->ff);
string_clear(test->file_path);
furi_string_free(test->file_path);
furi_record_close(RECORD_STORAGE);
free(test);
test = NULL;
}
static bool infrared_test_prepare_file(const char* protocol_name) {
string_t file_type;
string_init(file_type);
FuriString* file_type;
file_type = furi_string_alloc();
bool success = false;
string_printf(
furi_string_printf(
test->file_path,
"%s%s%s%s",
IR_TEST_FILES_DIR,
@@ -52,14 +52,15 @@ static bool infrared_test_prepare_file(const char* protocol_name) {
do {
uint32_t format_version;
if(!flipper_format_buffered_file_open_existing(test->ff, string_get_cstr(test->file_path)))
if(!flipper_format_buffered_file_open_existing(
test->ff, furi_string_get_cstr(test->file_path)))
break;
if(!flipper_format_read_header(test->ff, file_type, &format_version)) break;
if(string_cmp_str(file_type, "IR tests file") || format_version != 1) break;
if(furi_string_cmp_str(file_type, "IR tests file") || format_version != 1) break;
success = true;
} while(false);
string_clear(file_type);
furi_string_free(file_type);
return success;
}
@@ -68,18 +69,18 @@ static bool infrared_test_load_raw_signal(
const char* signal_name,
uint32_t** timings,
uint32_t* timings_count) {
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
bool success = false;
do {
bool is_name_found = false;
for(; !is_name_found && flipper_format_read_string(ff, "name", buf);
is_name_found = !string_cmp_str(buf, signal_name))
is_name_found = !furi_string_cmp(buf, signal_name))
;
if(!is_name_found) break;
if(!flipper_format_read_string(ff, "type", buf) || string_cmp_str(buf, "raw")) break;
if(!flipper_format_read_string(ff, "type", buf) || furi_string_cmp_str(buf, "raw")) break;
if(!flipper_format_get_value_count(ff, "data", timings_count)) break;
if(!*timings_count) break;
@@ -91,18 +92,18 @@ static bool infrared_test_load_raw_signal(
success = true;
} while(false);
string_clear(buf);
furi_string_free(buf);
return success;
}
static bool infrared_test_read_message(FlipperFormat* ff, InfraredMessage* message) {
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
bool success = false;
do {
if(!flipper_format_read_string(ff, "protocol", buf)) break;
message->protocol = infrared_get_protocol_by_name(string_get_cstr(buf));
message->protocol = infrared_get_protocol_by_name(furi_string_get_cstr(buf));
if(!infrared_is_protocol_valid(message->protocol)) break;
if(!flipper_format_read_hex(ff, "address", (uint8_t*)&message->address, sizeof(uint32_t)))
break;
@@ -112,7 +113,7 @@ static bool infrared_test_read_message(FlipperFormat* ff, InfraredMessage* messa
success = true;
} while(false);
string_clear(buf);
furi_string_free(buf);
return success;
}
@@ -121,18 +122,19 @@ static bool infrared_test_load_messages(
const char* signal_name,
InfraredMessage** messages,
uint32_t* messages_count) {
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
bool success = false;
do {
bool is_name_found = false;
for(; !is_name_found && flipper_format_read_string(ff, "name", buf);
is_name_found = !string_cmp_str(buf, signal_name))
is_name_found = !furi_string_cmp(buf, signal_name))
;
if(!is_name_found) break;
if(!flipper_format_read_string(ff, "type", buf) || string_cmp_str(buf, "parsed_array"))
if(!flipper_format_read_string(ff, "type", buf) ||
furi_string_cmp_str(buf, "parsed_array"))
break;
if(!flipper_format_read_uint32(ff, "count", messages_count, 1)) break;
if(!*messages_count) break;
@@ -151,7 +153,7 @@ static bool infrared_test_load_messages(
success = true;
} while(false);
string_clear(buf);
furi_string_free(buf);
return success;
}
@@ -213,26 +215,26 @@ static void infrared_test_run_encoder(InfraredProtocol protocol, uint32_t test_i
InfraredMessage* input_messages;
uint32_t input_messages_count;
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
const char* protocol_name = infrared_get_protocol_name(protocol);
mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file");
string_printf(buf, "encoder_input%d", test_index);
furi_string_printf(buf, "encoder_input%ld", test_index);
mu_assert(
infrared_test_load_messages(
test->ff, string_get_cstr(buf), &input_messages, &input_messages_count),
test->ff, furi_string_get_cstr(buf), &input_messages, &input_messages_count),
"Failed to load messages from file");
string_printf(buf, "encoder_expected%d", test_index);
furi_string_printf(buf, "encoder_expected%ld", test_index);
mu_assert(
infrared_test_load_raw_signal(
test->ff, string_get_cstr(buf), &expected_timings, &expected_timings_count),
test->ff, furi_string_get_cstr(buf), &expected_timings, &expected_timings_count),
"Failed to load raw signal from file");
flipper_format_buffered_file_close(test->ff);
string_clear(buf);
furi_string_free(buf);
uint32_t j = 0;
timings = malloc(sizeof(uint32_t) * timings_count);
@@ -267,22 +269,22 @@ static void infrared_test_run_encoder_decoder(InfraredProtocol protocol, uint32_
uint32_t input_messages_count;
bool level = false;
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
timings = malloc(sizeof(uint32_t) * timings_count);
const char* protocol_name = infrared_get_protocol_name(protocol);
mu_assert(infrared_test_prepare_file(protocol_name), "Failed to prepare test file");
string_printf(buf, "encoder_decoder_input%d", test_index);
furi_string_printf(buf, "encoder_decoder_input%ld", test_index);
mu_assert(
infrared_test_load_messages(
test->ff, string_get_cstr(buf), &input_messages, &input_messages_count),
test->ff, furi_string_get_cstr(buf), &input_messages, &input_messages_count),
"Failed to load messages from file");
flipper_format_buffered_file_close(test->ff);
string_clear(buf);
furi_string_free(buf);
for(uint32_t message_counter = 0; message_counter < input_messages_count; ++message_counter) {
const InfraredMessage* message_encoded = &input_messages[message_counter];
@@ -327,25 +329,27 @@ static void infrared_test_run_decoder(InfraredProtocol protocol, uint32_t test_i
InfraredMessage* messages;
uint32_t messages_count;
string_t buf;
string_init(buf);
FuriString* buf;
buf = furi_string_alloc();
mu_assert(
infrared_test_prepare_file(infrared_get_protocol_name(protocol)),
"Failed to prepare test file");
string_printf(buf, "decoder_input%d", test_index);
furi_string_printf(buf, "decoder_input%ld", test_index);
mu_assert(
infrared_test_load_raw_signal(test->ff, string_get_cstr(buf), &timings, &timings_count),
infrared_test_load_raw_signal(
test->ff, furi_string_get_cstr(buf), &timings, &timings_count),
"Failed to load raw signal from file");
string_printf(buf, "decoder_expected%d", test_index);
furi_string_printf(buf, "decoder_expected%ld", test_index);
mu_assert(
infrared_test_load_messages(test->ff, string_get_cstr(buf), &messages, &messages_count),
infrared_test_load_messages(
test->ff, furi_string_get_cstr(buf), &messages, &messages_count),
"Failed to load messages from file");
flipper_format_buffered_file_close(test->ff);
string_clear(buf);
furi_string_free(buf);
InfraredMessage message_decoded_check_local;
bool level = 0;

View File

@@ -0,0 +1,303 @@
#include <furi.h>
#include <furi_hal.h>
#include <storage/storage.h>
#include <lib/flipper_format/flipper_format.h>
#include <lib/nfc/protocols/nfca.h>
#include <lib/nfc/helpers/mf_classic_dict.h>
#include <lib/digital_signal/digital_signal.h>
#include <lib/flipper_format/flipper_format_i.h>
#include <lib/toolbox/stream/file_stream.h>
#include "../minunit.h"
#define TAG "NfcTest"
#define NFC_TEST_RESOURCES_DIR EXT_PATH("unit_tests/nfc/")
#define NFC_TEST_SIGNAL_SHORT_FILE "nfc_nfca_signal_short.nfc"
#define NFC_TEST_SIGNAL_LONG_FILE "nfc_nfca_signal_long.nfc"
#define NFC_TEST_DICT_PATH EXT_PATH("unit_tests/mf_classic_dict.nfc")
static const char* nfc_test_file_type = "Flipper NFC test";
static const uint32_t nfc_test_file_version = 1;
#define NFC_TEST_DATA_MAX_LEN 18
#define NFC_TETS_TIMINGS_MAX_LEN 1350
typedef struct {
Storage* storage;
NfcaSignal* signal;
uint32_t test_data_len;
uint8_t test_data[NFC_TEST_DATA_MAX_LEN];
uint32_t test_timings_len;
uint32_t test_timings[NFC_TETS_TIMINGS_MAX_LEN];
} NfcTest;
static NfcTest* nfc_test = NULL;
static void nfc_test_alloc() {
nfc_test = malloc(sizeof(NfcTest));
nfc_test->signal = nfca_signal_alloc();
nfc_test->storage = furi_record_open(RECORD_STORAGE);
}
static void nfc_test_free() {
furi_assert(nfc_test);
furi_record_close(RECORD_STORAGE);
nfca_signal_free(nfc_test->signal);
free(nfc_test);
nfc_test = NULL;
}
static bool nfc_test_read_signal_from_file(const char* file_name) {
bool success = false;
FlipperFormat* file = flipper_format_file_alloc(nfc_test->storage);
FuriString* file_type;
file_type = furi_string_alloc();
uint32_t file_version = 0;
do {
if(!flipper_format_file_open_existing(file, file_name)) break;
if(!flipper_format_read_header(file, file_type, &file_version)) break;
if(furi_string_cmp_str(file_type, nfc_test_file_type) ||
file_version != nfc_test_file_version)
break;
if(!flipper_format_read_uint32(file, "Data length", &nfc_test->test_data_len, 1)) break;
if(nfc_test->test_data_len > NFC_TEST_DATA_MAX_LEN) break;
if(!flipper_format_read_hex(
file, "Plain data", nfc_test->test_data, nfc_test->test_data_len))
break;
if(!flipper_format_read_uint32(file, "Timings length", &nfc_test->test_timings_len, 1))
break;
if(nfc_test->test_timings_len > NFC_TETS_TIMINGS_MAX_LEN) break;
if(!flipper_format_read_uint32(
file, "Timings", nfc_test->test_timings, nfc_test->test_timings_len))
break;
success = true;
} while(false);
furi_string_free(file_type);
flipper_format_free(file);
return success;
}
static bool nfc_test_digital_signal_test_encode(
const char* file_name,
uint32_t encode_max_time,
uint32_t timing_tolerance,
uint32_t timings_sum_tolerance) {
furi_assert(nfc_test);
bool success = false;
uint32_t time = 0;
uint32_t dut_timings_sum = 0;
uint32_t ref_timings_sum = 0;
uint8_t parity[10] = {};
do {
// Read test data
if(!nfc_test_read_signal_from_file(file_name)) break;
// Encode signal
FURI_CRITICAL_ENTER();
time = DWT->CYCCNT;
nfca_signal_encode(
nfc_test->signal, nfc_test->test_data, nfc_test->test_data_len * 8, parity);
digital_signal_prepare_arr(nfc_test->signal->tx_signal);
time = (DWT->CYCCNT - time) / furi_hal_cortex_instructions_per_microsecond();
FURI_CRITICAL_EXIT();
// Check timings
if(time > encode_max_time) {
FURI_LOG_E(
TAG, "Encoding time: %ld us while accepted value: %ld us", time, encode_max_time);
break;
}
// Check data
if(nfc_test->signal->tx_signal->edge_cnt != nfc_test->test_timings_len) {
FURI_LOG_E(TAG, "Not equal timings buffers length");
break;
}
uint32_t timings_diff = 0;
uint32_t* ref = nfc_test->test_timings;
uint32_t* dut = nfc_test->signal->tx_signal->reload_reg_buff;
bool timing_check_success = true;
for(size_t i = 0; i < nfc_test->test_timings_len; i++) {
timings_diff = dut[i] > ref[i] ? dut[i] - ref[i] : ref[i] - dut[i];
dut_timings_sum += dut[i];
ref_timings_sum += ref[i];
if(timings_diff > timing_tolerance) {
FURI_LOG_E(
TAG, "Too big differece in %d timings. Ref: %ld, DUT: %ld", i, ref[i], dut[i]);
timing_check_success = false;
break;
}
}
if(!timing_check_success) break;
uint32_t sum_diff = dut_timings_sum > ref_timings_sum ? dut_timings_sum - ref_timings_sum :
ref_timings_sum - dut_timings_sum;
if(sum_diff > timings_sum_tolerance) {
FURI_LOG_E(
TAG,
"Too big difference in timings sum. Ref: %ld, DUT: %ld",
ref_timings_sum,
dut_timings_sum);
break;
}
FURI_LOG_I(TAG, "Encoding time: %ld us. Acceptable time: %ld us", time, encode_max_time);
FURI_LOG_I(
TAG,
"Timings sum difference: %ld [1/64MHZ]. Acceptable difference: %ld [1/64MHz]",
sum_diff,
timings_sum_tolerance);
success = true;
} while(false);
return success;
}
MU_TEST(nfc_digital_signal_test) {
mu_assert(
nfc_test_digital_signal_test_encode(
NFC_TEST_RESOURCES_DIR NFC_TEST_SIGNAL_SHORT_FILE, 500, 1, 37),
"NFC short digital signal test failed\r\n");
mu_assert(
nfc_test_digital_signal_test_encode(
NFC_TEST_RESOURCES_DIR NFC_TEST_SIGNAL_LONG_FILE, 2000, 1, 37),
"NFC long digital signal test failed\r\n");
}
MU_TEST(mf_classic_dict_test) {
MfClassicDict* instance = NULL;
uint64_t key = 0;
FuriString* temp_str;
temp_str = furi_string_alloc();
instance = mf_classic_dict_alloc(MfClassicDictTypeUnitTest);
mu_assert(instance != NULL, "mf_classic_dict_alloc\r\n");
mu_assert(
mf_classic_dict_get_total_keys(instance) == 0,
"mf_classic_dict_get_total_keys == 0 assert failed\r\n");
furi_string_set(temp_str, "2196FAD8115B");
mu_assert(
mf_classic_dict_add_key_str(instance, temp_str),
"mf_classic_dict_add_key == true assert failed\r\n");
mu_assert(
mf_classic_dict_get_total_keys(instance) == 1,
"mf_classic_dict_get_total_keys == 1 assert failed\r\n");
mu_assert(mf_classic_dict_rewind(instance), "mf_classic_dict_rewind == 1 assert failed\r\n");
mu_assert(
mf_classic_dict_get_key_at_index_str(instance, temp_str, 0),
"mf_classic_dict_get_key_at_index_str == true assert failed\r\n");
mu_assert(
furi_string_cmp(temp_str, "2196FAD8115B") == 0,
"string_cmp(temp_str, \"2196FAD8115B\") == 0 assert failed\r\n");
mu_assert(mf_classic_dict_rewind(instance), "mf_classic_dict_rewind == 1 assert failed\r\n");
mu_assert(
mf_classic_dict_get_key_at_index(instance, &key, 0),
"mf_classic_dict_get_key_at_index == true assert failed\r\n");
mu_assert(key == 0x2196FAD8115B, "key == 0x2196FAD8115B assert failed\r\n");
mu_assert(mf_classic_dict_rewind(instance), "mf_classic_dict_rewind == 1 assert failed\r\n");
mu_assert(
mf_classic_dict_delete_index(instance, 0),
"mf_classic_dict_delete_index == true assert failed\r\n");
mf_classic_dict_free(instance);
furi_string_free(temp_str);
}
MU_TEST(mf_classic_dict_load_test) {
Storage* storage = furi_record_open(RECORD_STORAGE);
mu_assert(storage != NULL, "storage != NULL assert failed\r\n");
// Delete unit test dict file if exists
if(storage_file_exists(storage, NFC_TEST_DICT_PATH)) {
mu_assert(
storage_simply_remove(storage, NFC_TEST_DICT_PATH),
"remove == true assert failed\r\n");
}
// Create unit test dict file
Stream* file_stream = file_stream_alloc(storage);
mu_assert(file_stream != NULL, "file_stream != NULL assert failed\r\n");
mu_assert(
file_stream_open(file_stream, NFC_TEST_DICT_PATH, FSAM_WRITE, FSOM_OPEN_ALWAYS),
"file_stream_open == true assert failed\r\n");
// Write unit test dict file
char key_str[] = "a0a1a2a3a4a5";
mu_assert(
stream_write_cstring(file_stream, key_str) == strlen(key_str),
"write == true assert failed\r\n");
// Close unit test dict file
mu_assert(file_stream_close(file_stream), "file_stream_close == true assert failed\r\n");
// Load unit test dict file
MfClassicDict* instance = NULL;
instance = mf_classic_dict_alloc(MfClassicDictTypeUnitTest);
mu_assert(instance != NULL, "mf_classic_dict_alloc\r\n");
uint32_t total_keys = mf_classic_dict_get_total_keys(instance);
mu_assert(total_keys == 1, "total_keys == 1 assert failed\r\n");
// Read key
uint64_t key_ref = 0xa0a1a2a3a4a5;
uint64_t key_dut = 0;
FuriString* temp_str = furi_string_alloc();
mu_assert(
mf_classic_dict_get_next_key_str(instance, temp_str),
"get_next_key_str == true assert failed\r\n");
mu_assert(furi_string_cmp_str(temp_str, key_str) == 0, "invalid key loaded\r\n");
mu_assert(mf_classic_dict_rewind(instance), "mf_classic_dict_rewind == 1 assert failed\r\n");
mu_assert(
mf_classic_dict_get_next_key(instance, &key_dut),
"get_next_key == true assert failed\r\n");
mu_assert(key_dut == key_ref, "invalid key loaded\r\n");
furi_string_free(temp_str);
mf_classic_dict_free(instance);
// Check that MfClassicDict added new line to the end of the file
mu_assert(
file_stream_open(file_stream, NFC_TEST_DICT_PATH, FSAM_READ, FSOM_OPEN_EXISTING),
"file_stream_open == true assert failed\r\n");
mu_assert(stream_seek(file_stream, -1, StreamOffsetFromEnd), "seek == true assert failed\r\n");
uint8_t last_char = 0;
mu_assert(stream_read(file_stream, &last_char, 1) == 1, "read == true assert failed\r\n");
mu_assert(last_char == '\n', "last_char == '\\n' assert failed\r\n");
mu_assert(file_stream_close(file_stream), "file_stream_close == true assert failed\r\n");
// Delete unit test dict file
mu_assert(
storage_simply_remove(storage, NFC_TEST_DICT_PATH), "remove == true assert failed\r\n");
stream_free(file_stream);
furi_record_close(RECORD_STORAGE);
}
MU_TEST_SUITE(nfc) {
nfc_test_alloc();
MU_RUN_TEST(nfc_digital_signal_test);
MU_RUN_TEST(mf_classic_dict_test);
MU_RUN_TEST(mf_classic_dict_load_test);
nfc_test_free();
}
int run_minunit_test_nfc() {
MU_RUN_SUITE(nfc);
return MU_EXIT_CODE;
}

View File

@@ -10,7 +10,6 @@
#include <furi.h>
#include "../minunit.h"
#include <stdint.h>
#include <stream_buffer.h>
#include <pb.h>
#include <pb_encode.h>
#include <m-list.h>
@@ -34,7 +33,7 @@ static uint32_t command_id = 0;
typedef struct {
RpcSession* session;
StreamBufferHandle_t output_stream;
FuriStreamBuffer* output_stream;
SemaphoreHandle_t close_session_semaphore;
SemaphoreHandle_t terminate_semaphore;
TickType_t timeout;
@@ -90,7 +89,7 @@ static void test_rpc_setup(void) {
}
furi_check(rpc_session[0].session);
rpc_session[0].output_stream = xStreamBufferCreate(1000, 1);
rpc_session[0].output_stream = furi_stream_buffer_alloc(1000, 1);
rpc_session_set_send_bytes_callback(rpc_session[0].session, output_bytes_callback);
rpc_session[0].close_session_semaphore = xSemaphoreCreateBinary();
rpc_session[0].terminate_semaphore = xSemaphoreCreateBinary();
@@ -110,7 +109,7 @@ static void test_rpc_setup_second_session(void) {
}
furi_check(rpc_session[1].session);
rpc_session[1].output_stream = xStreamBufferCreate(1000, 1);
rpc_session[1].output_stream = furi_stream_buffer_alloc(1000, 1);
rpc_session_set_send_bytes_callback(rpc_session[1].session, output_bytes_callback);
rpc_session[1].close_session_semaphore = xSemaphoreCreateBinary();
rpc_session[1].terminate_semaphore = xSemaphoreCreateBinary();
@@ -126,7 +125,7 @@ static void test_rpc_teardown(void) {
rpc_session_close(rpc_session[0].session);
furi_check(xSemaphoreTake(rpc_session[0].terminate_semaphore, portMAX_DELAY));
furi_record_close(RECORD_RPC);
vStreamBufferDelete(rpc_session[0].output_stream);
furi_stream_buffer_free(rpc_session[0].output_stream);
vSemaphoreDelete(rpc_session[0].close_session_semaphore);
vSemaphoreDelete(rpc_session[0].terminate_semaphore);
++command_id;
@@ -141,7 +140,7 @@ static void test_rpc_teardown_second_session(void) {
xSemaphoreTake(rpc_session[1].terminate_semaphore, 0);
rpc_session_close(rpc_session[1].session);
furi_check(xSemaphoreTake(rpc_session[1].terminate_semaphore, portMAX_DELAY));
vStreamBufferDelete(rpc_session[1].output_stream);
furi_stream_buffer_free(rpc_session[1].output_stream);
vSemaphoreDelete(rpc_session[1].close_session_semaphore);
vSemaphoreDelete(rpc_session[1].terminate_semaphore);
++command_id;
@@ -268,8 +267,8 @@ static PB_CommandStatus test_rpc_storage_get_file_error(File* file) {
static void output_bytes_callback(void* ctx, uint8_t* got_bytes, size_t got_size) {
RpcSessionContext* callbacks_context = ctx;
size_t bytes_sent =
xStreamBufferSend(callbacks_context->output_stream, got_bytes, got_size, FuriWaitForever);
size_t bytes_sent = furi_stream_buffer_send(
callbacks_context->output_stream, got_bytes, got_size, FuriWaitForever);
(void)bytes_sent;
furi_check(bytes_sent == got_size);
}
@@ -534,7 +533,8 @@ static bool test_rpc_pb_stream_read(pb_istream_t* istream, pb_byte_t* buf, size_
TickType_t now = xTaskGetTickCount();
int32_t time_left = session_context->timeout - now;
time_left = MAX(time_left, 0);
bytes_received = xStreamBufferReceive(session_context->output_stream, buf, count, time_left);
bytes_received =
furi_stream_buffer_receive(session_context->output_stream, buf, count, time_left);
return (count == bytes_received);
}

View File

@@ -75,7 +75,7 @@ typedef struct {
bool visited;
} StorageTestPath;
DICT_DEF2(StorageTestPathDict, string_t, STRING_OPLIST, StorageTestPath, M_POD_OPLIST)
DICT_DEF2(StorageTestPathDict, FuriString*, FURI_STRING_OPLIST, StorageTestPath, M_POD_OPLIST)
static StorageTestPathDict_t*
storage_test_paths_alloc(const StorageTestPathDesc paths[], size_t paths_count) {
@@ -83,15 +83,15 @@ static StorageTestPathDict_t*
StorageTestPathDict_init(*data);
for(size_t i = 0; i < paths_count; i++) {
string_t key;
string_init_set(key, paths[i].path);
FuriString* key;
key = furi_string_alloc_set(paths[i].path);
StorageTestPath value = {
.is_dir = paths[i].is_dir,
.visited = false,
};
StorageTestPathDict_set_at(*data, key, value);
string_clear(key);
furi_string_free(key);
}
return data;
@@ -102,7 +102,7 @@ static void storage_test_paths_free(StorageTestPathDict_t* data) {
free(data);
}
static bool storage_test_paths_mark(StorageTestPathDict_t* data, string_t path, bool is_dir) {
static bool storage_test_paths_mark(StorageTestPathDict_t* data, FuriString* path, bool is_dir) {
bool found = false;
StorageTestPath* record = StorageTestPathDict_get(*data, path);
@@ -148,27 +148,27 @@ static bool write_file_13DA(Storage* storage, const char* path) {
}
static void storage_dirs_create(Storage* storage, const char* base) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
storage_common_mkdir(storage, base);
for(size_t i = 0; i < COUNT_OF(storage_test_dirwalk_paths); i++) {
string_printf(path, "%s/%s", base, storage_test_dirwalk_paths[i]);
storage_common_mkdir(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_test_dirwalk_paths[i]);
storage_common_mkdir(storage, furi_string_get_cstr(path));
}
for(size_t i = 0; i < COUNT_OF(storage_test_dirwalk_files); i++) {
string_printf(path, "%s/%s", base, storage_test_dirwalk_files[i]);
write_file_13DA(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_test_dirwalk_files[i]);
write_file_13DA(storage, furi_string_get_cstr(path));
}
string_clear(path);
furi_string_free(path);
}
MU_TEST_1(test_dirwalk_full, Storage* storage) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
FileInfo fileinfo;
StorageTestPathDict_t* paths =
@@ -178,12 +178,12 @@ MU_TEST_1(test_dirwalk_full, Storage* storage) {
mu_check(dir_walk_open(dir_walk, EXT_PATH("dirwalk")));
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
string_right(path, strlen(EXT_PATH("dirwalk/")));
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
}
dir_walk_free(dir_walk);
string_clear(path);
furi_string_free(path);
mu_check(storage_test_paths_check(paths) == false);
@@ -191,8 +191,8 @@ MU_TEST_1(test_dirwalk_full, Storage* storage) {
}
MU_TEST_1(test_dirwalk_no_recursive, Storage* storage) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
FileInfo fileinfo;
StorageTestPathDict_t* paths = storage_test_paths_alloc(
@@ -203,12 +203,12 @@ MU_TEST_1(test_dirwalk_no_recursive, Storage* storage) {
mu_check(dir_walk_open(dir_walk, EXT_PATH("dirwalk")));
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
string_right(path, strlen(EXT_PATH("dirwalk/")));
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
}
dir_walk_free(dir_walk);
string_clear(path);
furi_string_free(path);
mu_check(storage_test_paths_check(paths) == false);
@@ -230,8 +230,8 @@ static bool test_dirwalk_filter_no_folder_ext(const char* name, FileInfo* filein
}
MU_TEST_1(test_dirwalk_filter, Storage* storage) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
FileInfo fileinfo;
StorageTestPathDict_t* paths = storage_test_paths_alloc(
@@ -242,12 +242,12 @@ MU_TEST_1(test_dirwalk_filter, Storage* storage) {
mu_check(dir_walk_open(dir_walk, EXT_PATH("dirwalk")));
while(dir_walk_read(dir_walk, path, &fileinfo) == DirWalkOK) {
string_right(path, strlen(EXT_PATH("dirwalk/")));
furi_string_right(path, strlen(EXT_PATH("dirwalk/")));
mu_check(storage_test_paths_mark(paths, path, (fileinfo.flags & FSF_DIRECTORY)));
}
dir_walk_free(dir_walk);
string_clear(path);
furi_string_free(path);
mu_check(storage_test_paths_check(paths) == false);

View File

@@ -58,7 +58,7 @@ MU_TEST(storage_file_open_lock) {
storage_file_close(file);
// file_locker thread stop
mu_check(furi_thread_join(locker_thread) == FuriStatusOk);
mu_check(furi_thread_join(locker_thread));
furi_thread_free(locker_thread);
// clean data
@@ -148,7 +148,7 @@ MU_TEST(storage_dir_open_lock) {
storage_dir_close(file);
// file_locker thread stop
mu_check(furi_thread_join(locker_thread) == FuriStatusOk);
mu_check(furi_thread_join(locker_thread));
furi_thread_free(locker_thread);
// clean data
@@ -211,22 +211,22 @@ static bool check_file_13DA(Storage* storage, const char* path) {
}
static void storage_dir_create(Storage* storage, const char* base) {
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
storage_common_mkdir(storage, base);
for(size_t i = 0; i < COUNT_OF(storage_copy_test_paths); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
storage_common_mkdir(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
storage_common_mkdir(storage, furi_string_get_cstr(path));
}
for(size_t i = 0; i < COUNT_OF(storage_copy_test_files); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
write_file_13DA(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
write_file_13DA(storage, furi_string_get_cstr(path));
}
string_clear(path);
furi_string_free(path);
}
static void storage_dir_remove(Storage* storage, const char* base) {
@@ -235,15 +235,15 @@ static void storage_dir_remove(Storage* storage, const char* base) {
static bool storage_dir_rename_check(Storage* storage, const char* base) {
bool result = false;
string_t path;
string_init(path);
FuriString* path;
path = furi_string_alloc();
result = (storage_common_stat(storage, base, NULL) == FSE_OK);
if(result) {
for(size_t i = 0; i < COUNT_OF(storage_copy_test_paths); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
result = (storage_common_stat(storage, string_get_cstr(path), NULL) == FSE_OK);
furi_string_printf(path, "%s/%s", base, storage_copy_test_paths[i]);
result = (storage_common_stat(storage, furi_string_get_cstr(path), NULL) == FSE_OK);
if(!result) {
break;
}
@@ -252,15 +252,15 @@ static bool storage_dir_rename_check(Storage* storage, const char* base) {
if(result) {
for(size_t i = 0; i < COUNT_OF(storage_copy_test_files); i++) {
string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
result = check_file_13DA(storage, string_get_cstr(path));
furi_string_printf(path, "%s/%s", base, storage_copy_test_files[i]);
result = check_file_13DA(storage, furi_string_get_cstr(path));
if(!result) {
break;
}
}
}
string_clear(path);
furi_string_free(path);
return result;
}

View File

@@ -18,8 +18,8 @@ static const char* stream_test_right_data =
MU_TEST_1(stream_composite_subtest, Stream* stream) {
const size_t data_size = 128;
uint8_t data[data_size];
string_t string_lee;
string_init_set(string_lee, "lee");
FuriString* string_lee;
string_lee = furi_string_alloc_set("lee");
// test that stream is empty
// "" -> ""
@@ -267,7 +267,7 @@ MU_TEST_1(stream_composite_subtest, Stream* stream) {
mu_assert_int_eq(9, stream_tell(stream));
mu_check(stream_eof(stream));
string_clear(string_lee);
furi_string_free(string_lee);
}
MU_TEST(stream_composite_test) {
@@ -416,10 +416,10 @@ MU_TEST(stream_buffered_write_after_read_test) {
}
MU_TEST(stream_buffered_large_file_test) {
string_t input_data;
string_t output_data;
string_init(input_data);
string_init(output_data);
FuriString* input_data;
FuriString* output_data;
input_data = furi_string_alloc();
output_data = furi_string_alloc();
Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -429,7 +429,7 @@ MU_TEST(stream_buffered_large_file_test) {
const size_t rep_count = data_size / line_size + 1;
for(size_t i = 0; i < rep_count; ++i) {
string_cat_printf(input_data, "%s\n", stream_test_data);
furi_string_cat_printf(input_data, "%s\n", stream_test_data);
}
// write test data to file
@@ -437,8 +437,8 @@ MU_TEST(stream_buffered_large_file_test) {
mu_check(buffered_file_stream_open(
stream, EXT_PATH("filestream.str"), FSAM_READ_WRITE, FSOM_CREATE_ALWAYS));
mu_assert_int_eq(0, stream_size(stream));
mu_assert_int_eq(string_size(input_data), stream_write_string(stream, input_data));
mu_assert_int_eq(string_size(input_data), stream_size(stream));
mu_assert_int_eq(furi_string_size(input_data), stream_write_string(stream, input_data));
mu_assert_int_eq(furi_string_size(input_data), stream_size(stream));
const size_t substr_start = 8;
const size_t substr_len = 11;
@@ -475,23 +475,23 @@ MU_TEST(stream_buffered_large_file_test) {
// read the whole file
mu_check(stream_rewind(stream));
string_t tmp;
string_init(tmp);
FuriString* tmp;
tmp = furi_string_alloc();
while(stream_read_line(stream, tmp)) {
string_cat(output_data, tmp);
furi_string_cat(output_data, tmp);
}
string_clear(tmp);
furi_string_free(tmp);
// check against generated data
mu_assert_int_eq(string_size(input_data), string_size(output_data));
mu_check(string_equal_p(input_data, output_data));
mu_assert_int_eq(furi_string_size(input_data), furi_string_size(output_data));
mu_check(furi_string_equal(input_data, output_data));
mu_check(stream_eof(stream));
stream_free(stream);
furi_record_close(RECORD_STORAGE);
string_clear(input_data);
string_clear(output_data);
furi_string_free(input_data);
furi_string_free(output_data);
}
MU_TEST_SUITE(stream_suite) {

View File

@@ -13,7 +13,7 @@
#define CAME_ATOMO_DIR_NAME EXT_PATH("subghz/assets/came_atomo")
#define NICE_FLOR_S_DIR_NAME EXT_PATH("subghz/assets/nice_flor_s")
#define TEST_RANDOM_DIR_NAME EXT_PATH("unit_tests/subghz/test_random_raw.sub")
#define TEST_RANDOM_COUNT_PARSE 232
#define TEST_RANDOM_COUNT_PARSE 233
#define TEST_TIMEOUT 10000
static SubGhzEnvironment* environment_handler;
@@ -28,12 +28,12 @@ static void subghz_test_rx_callback(
void* context) {
UNUSED(receiver);
UNUSED(context);
string_t text;
string_init(text);
FuriString* text;
text = furi_string_alloc();
subghz_protocol_decoder_base_get_string(decoder_base, text);
subghz_receiver_reset(receiver_handler);
FURI_LOG_T(TAG, "\r\n%s", string_get_cstr(text));
string_clear(text);
FURI_LOG_T(TAG, "\r\n%s", furi_string_get_cstr(text));
furi_string_free(text);
subghz_test_decoder_count++;
}
@@ -141,8 +141,8 @@ static bool subghz_decode_random_test(const char* path) {
static bool subghz_encoder_test(const char* path) {
subghz_test_decoder_count = 0;
uint32_t test_start = furi_get_tick();
string_t temp_str;
string_init(temp_str);
FuriString* temp_str;
temp_str = furi_string_alloc();
bool file_load = false;
Storage* storage = furi_record_open(RECORD_STORAGE);
@@ -167,11 +167,11 @@ static bool subghz_encoder_test(const char* path) {
} while(false);
if(file_load) {
SubGhzTransmitter* transmitter =
subghz_transmitter_alloc_init(environment_handler, string_get_cstr(temp_str));
subghz_transmitter_alloc_init(environment_handler, furi_string_get_cstr(temp_str));
subghz_transmitter_deserialize(transmitter, fff_data_file);
SubGhzProtocolDecoderBase* decoder = subghz_receiver_search_decoder_base_by_name(
receiver_handler, string_get_cstr(temp_str));
receiver_handler, furi_string_get_cstr(temp_str));
if(decoder) {
LevelDuration level_duration;
@@ -192,10 +192,11 @@ static bool subghz_encoder_test(const char* path) {
flipper_format_free(fff_data_file);
FURI_LOG_T(TAG, "\r\n Decoder count parse \033[0;33m%d\033[0m ", subghz_test_decoder_count);
if(furi_get_tick() - test_start > TEST_TIMEOUT) {
printf("\033[0;31mTest encoder %s ERROR TimeOut\033[0m\r\n", string_get_cstr(temp_str));
printf(
"\033[0;31mTest encoder %s ERROR TimeOut\033[0m\r\n", furi_string_get_cstr(temp_str));
subghz_test_decoder_count = 0;
}
string_clear(temp_str);
furi_string_free(temp_str);
return subghz_test_decoder_count ? true : false;
}
@@ -434,6 +435,13 @@ MU_TEST(subghz_decoder_clemsa_test) {
"Test decoder " SUBGHZ_PROTOCOL_CLEMSA_NAME " error\r\n");
}
MU_TEST(subghz_decoder_oregon2_test) {
mu_assert(
subghz_decoder_test(
EXT_PATH("unit_tests/subghz/oregon2_raw.sub"), SUBGHZ_PROTOCOL_OREGON2_NAME),
"Test decoder " SUBGHZ_PROTOCOL_OREGON2_NAME " error\r\n");
}
//test encoders
MU_TEST(subghz_encoder_princeton_test) {
mu_assert(
@@ -595,6 +603,7 @@ MU_TEST_SUITE(subghz) {
MU_RUN_TEST(subghz_decoder_magellen_test);
MU_RUN_TEST(subghz_decoder_intertechno_v3_test);
MU_RUN_TEST(subghz_decoder_clemsa_test);
MU_RUN_TEST(subghz_decoder_oregon2_test);
MU_RUN_TEST(subghz_encoder_princeton_test);
MU_RUN_TEST(subghz_encoder_came_test);

View File

@@ -1,5 +1,3 @@
#include "m-string.h"
#include <stdio.h>
#include <furi.h>
#include <furi_hal.h>
@@ -11,6 +9,7 @@
#define TAG "UnitTests"
int run_minunit_test_furi();
int run_minunit_test_furi_string();
int run_minunit_test_infrared();
int run_minunit_test_rpc();
int run_minunit_test_flipper_format();
@@ -33,6 +32,7 @@ typedef struct {
const UnitTest unit_tests[] = {
{.name = "furi", .entry = run_minunit_test_furi},
{.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},
@@ -63,7 +63,7 @@ void minunit_print_fail(const char* str) {
printf(FURI_LOG_CLR_E "%s\r\n" FURI_LOG_CLR_RESET, str);
}
void unit_tests_cli(Cli* cli, string_t args, void* context) {
void unit_tests_cli(Cli* cli, FuriString* args, void* context) {
UNUSED(cli);
UNUSED(args);
UNUSED(context);
@@ -91,8 +91,8 @@ void unit_tests_cli(Cli* cli, string_t args, void* context) {
break;
}
if(string_size(args)) {
if(string_cmp_str(args, unit_tests[i].name) == 0) {
if(furi_string_size(args)) {
if(furi_string_cmp_str(args, unit_tests[i].name) == 0) {
failed_tests += unit_tests[i].entry();
} else {
printf("Skipping %s\r\n", unit_tests[i].name);

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