From ebf39f189d4a32baf65f551406c2bcaba517f92d Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sat, 10 Dec 2022 22:39:04 +0300 Subject: [PATCH 1/4] Add link back --- CHANGELOG.md | 1 + ReadMe.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ce5f65dd..3d5d51be8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ [-> Download qFlipper (official link)](https://flipperzero.one/update) ## Please support development of the project +* Boosty: https://boosty.to/mmxdev * destream (100 EUR min): https://destream.net/live/MMX/donate * cloudtips (only RU payments accepted): https://pay.cloudtips.ru/p/7b3e9d65 * YooMoney (only RU payments accepted): https://yoomoney.ru/fundraise/XA49mgQLPA0.221209 diff --git a/ReadMe.md b/ReadMe.md index 86cd2304d..ef9e6e1d5 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -67,6 +67,7 @@ Also check changelog in releases for latest updates! - Star Line ## Please support development of the project +* Boosty: https://boosty.to/mmxdev * destream (100 EUR min): https://destream.net/live/MMX/donate * cloudtips (only RU payments accepted): https://pay.cloudtips.ru/p/7b3e9d65 * YooMoney (only RU payments accepted): https://yoomoney.ru/fundraise/XA49mgQLPA0.221209 From 63b40992efedfbd344e03402b5eb2e7e6d569f65 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 11 Dec 2022 00:09:38 +0300 Subject: [PATCH 2/4] Fix naming was different from OFW --- applications/main/infrared/infrared_brute_force.c | 10 +++++----- applications/main/infrared/infrared_brute_force.h | 2 +- applications/main/infrared/infrared_cli.c | 2 +- .../scenes/common/infrared_scene_universal_common.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/applications/main/infrared/infrared_brute_force.c b/applications/main/infrared/infrared_brute_force.c index ebc34bd15..3f426f1dc 100644 --- a/applications/main/infrared/infrared_brute_force.c +++ b/applications/main/infrared/infrared_brute_force.c @@ -38,11 +38,6 @@ InfraredBruteForce* infrared_brute_force_alloc() { return brute_force; } -void infrared_brute_force_clear_records(InfraredBruteForce* brute_force) { - furi_assert(!brute_force->is_started); - InfraredBruteForceRecordDict_reset(brute_force->records); -} - void infrared_brute_force_free(InfraredBruteForce* brute_force) { furi_assert(!brute_force->is_started); InfraredBruteForceRecordDict_clear(brute_force->records); @@ -151,3 +146,8 @@ void infrared_brute_force_add_record( InfraredBruteForceRecordDict_set_at(brute_force->records, key, value); furi_string_free(key); } + +void infrared_brute_force_reset(InfraredBruteForce* brute_force) { + furi_assert(!brute_force->is_started); + InfraredBruteForceRecordDict_reset(brute_force->records); +} diff --git a/applications/main/infrared/infrared_brute_force.h b/applications/main/infrared/infrared_brute_force.h index fff472e79..b6c48e3f6 100644 --- a/applications/main/infrared/infrared_brute_force.h +++ b/applications/main/infrared/infrared_brute_force.h @@ -16,7 +16,7 @@ bool infrared_brute_force_start( bool infrared_brute_force_is_started(InfraredBruteForce* brute_force); void infrared_brute_force_stop(InfraredBruteForce* brute_force); bool infrared_brute_force_send_next(InfraredBruteForce* brute_force); -void infrared_brute_force_clear_records(InfraredBruteForce* brute_force); +void infrared_brute_force_reset(InfraredBruteForce* brute_force); void infrared_brute_force_add_record( InfraredBruteForce* brute_force, uint32_t index, diff --git a/applications/main/infrared/infrared_cli.c b/applications/main/infrared/infrared_cli.c index 7d4c150ef..8f35a8fd1 100644 --- a/applications/main/infrared/infrared_cli.c +++ b/applications/main/infrared/infrared_cli.c @@ -453,7 +453,7 @@ static void } while(false); furi_string_free(remote_path); - infrared_brute_force_clear_records(brute_force); + infrared_brute_force_reset(brute_force); infrared_brute_force_free(brute_force); } diff --git a/applications/main/infrared/scenes/common/infrared_scene_universal_common.c b/applications/main/infrared/scenes/common/infrared_scene_universal_common.c index 7feb36412..d55d8d0a6 100644 --- a/applications/main/infrared/scenes/common/infrared_scene_universal_common.c +++ b/applications/main/infrared/scenes/common/infrared_scene_universal_common.c @@ -87,6 +87,6 @@ void infrared_scene_universal_common_on_exit(void* context) { Infrared* infrared = context; ButtonPanel* button_panel = infrared->button_panel; view_stack_remove_view(infrared->view_stack, button_panel_get_view(button_panel)); - infrared_brute_force_clear_records(infrared->brute_force); + infrared_brute_force_reset(infrared->brute_force); button_panel_reset(button_panel); } From 17ea9315e00393d0e5119e99c0cc2278b2061ae6 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 11 Dec 2022 00:42:26 +0300 Subject: [PATCH 3/4] Fix incompatibility with OFW in subghz part + improve speed SubGHz app launch times improved, also setting_user file no longer added by firmware, this update will remove this file, be sure to backup! Now this file is actually should be created by user and will be not removed every update! --- applications/main/subghz/subghz.c | 53 ++++++- applications/main/unirfremix/unirfremix_app.c | 2 +- .../plugins/pocsag_pager/pocsag_pager_app.c | 21 +-- .../weather_station/weather_station_app.c | 2 +- .../subghz/assets/keeloq_mfcodes_user.example | 4 +- assets/resources/subghz/assets/setting_user | 101 ------------- .../subghz/assets/setting_user.example | 29 ++++ firmware/targets/f7/api_symbols.csv | 2 +- lib/subghz/subghz_setting.c | 142 +++++++++++------- lib/subghz/subghz_setting.h | 2 +- 10 files changed, 173 insertions(+), 185 deletions(-) delete mode 100644 assets/resources/subghz/assets/setting_user create mode 100644 assets/resources/subghz/assets/setting_user.example diff --git a/applications/main/subghz/subghz.c b/applications/main/subghz/subghz.c index c6614f0cf..d904dfc89 100644 --- a/applications/main/subghz/subghz.c +++ b/applications/main/subghz/subghz.c @@ -182,11 +182,54 @@ SubGhz* subghz_alloc(bool alloc_for_tx_only) { //init setting subghz->setting = subghz_setting_alloc(); - if(alloc_for_tx_only) { - subghz_setting_load(subghz->setting, EXT_PATH("subghz/assets/setting_user"), false); - } else { - subghz_setting_load(subghz->setting, EXT_PATH("subghz/assets/setting_user"), true); - } + + subghz_setting_load(subghz->setting, EXT_PATH("subghz/assets/setting_user")); + + // Custom Presets load without using config file + + FlipperFormat* temp_fm_preset = flipper_format_string_alloc(); + flipper_format_write_string_cstr( + temp_fm_preset, + (const char*)"Custom_preset_data", + (const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 83 10 67 15 24 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00"); + flipper_format_rewind(temp_fm_preset); + subghz_setting_load_custom_preset(subghz->setting, (const char*)"FM95", temp_fm_preset); + + flipper_format_free(temp_fm_preset); + + // #2-FSK 200khz BW / 135kHz Filter/ 15.86Khz Deviation + Ramping + FlipperFormat* temp_fm_preset2 = flipper_format_string_alloc(); + flipper_format_write_string_cstr( + temp_fm_preset2, + (const char*)"Custom_preset_data", + (const char*)"02 0D 03 47 08 32 0B 06 15 32 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0"); + flipper_format_rewind(temp_fm_preset2); + subghz_setting_load_custom_preset(subghz->setting, (const char*)"FM15k", temp_fm_preset2); + + flipper_format_free(temp_fm_preset2); + + // # HND - FM presets + FlipperFormat* temp_fm_preset3 = flipper_format_string_alloc(); + flipper_format_write_string_cstr( + temp_fm_preset3, + (const char*)"Custom_preset_data", + (const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00"); + flipper_format_rewind(temp_fm_preset3); + subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_1", temp_fm_preset3); + + flipper_format_free(temp_fm_preset3); + + FlipperFormat* temp_fm_preset4 = flipper_format_string_alloc(); + flipper_format_write_string_cstr( + temp_fm_preset4, + (const char*)"Custom_preset_data", + (const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00"); + flipper_format_rewind(temp_fm_preset4); + subghz_setting_load_custom_preset(subghz->setting, (const char*)"HND_2", temp_fm_preset4); + + flipper_format_free(temp_fm_preset4); + + // custom presets loading - end // Load last used values for Read, Read RAW, etc. or default if(!alloc_for_tx_only) { diff --git a/applications/main/unirfremix/unirfremix_app.c b/applications/main/unirfremix/unirfremix_app.c index 6ade9c9b0..d981c3cd5 100644 --- a/applications/main/unirfremix/unirfremix_app.c +++ b/applications/main/unirfremix/unirfremix_app.c @@ -706,7 +706,7 @@ static void input_callback(InputEvent* input_event, void* ctx) { void unirfremix_subghz_alloc(UniRFRemix* app) { // load subghz presets app->setting = subghz_setting_alloc(); - subghz_setting_load(app->setting, EXT_PATH("subghz/assets/setting_user"), false); + subghz_setting_load(app->setting, EXT_PATH("subghz/assets/setting_user")); // load mfcodes app->environment = subghz_environment_alloc(); diff --git a/applications/plugins/pocsag_pager/pocsag_pager_app.c b/applications/plugins/pocsag_pager/pocsag_pager_app.c index a3d45ac1b..3ac242304 100644 --- a/applications/plugins/pocsag_pager/pocsag_pager_app.c +++ b/applications/plugins/pocsag_pager/pocsag_pager_app.c @@ -5,9 +5,6 @@ #include #include "protocols/protocol_items.h" -// Comment next line to build on OFW -#define IS_UNLEASHED - static bool pocsag_pager_app_custom_event_callback(void* context, uint32_t event) { furi_assert(context); POCSAGPagerApp* app = context; @@ -84,12 +81,10 @@ POCSAGPagerApp* pocsag_pager_app_alloc() { //init setting app->setting = subghz_setting_alloc(); -//ToDo FIX file name setting -#ifdef IS_UNLEASHED - subghz_setting_load(app->setting, EXT_PATH("pocsag/settings.txt"), true); -#else + //ToDo FIX file name setting + subghz_setting_load(app->setting, EXT_PATH("pocsag/settings.txt")); -#endif + //init Worker & Protocol & History app->lock = PCSGLockOff; app->txrx = malloc(sizeof(POCSAGPagerTxRx)); @@ -108,16 +103,6 @@ POCSAGPagerApp* pocsag_pager_app_alloc() { flipper_format_free(temp_fm_preset); - FlipperFormat* temp_fm_preset2 = flipper_format_string_alloc(); - flipper_format_write_string_cstr( - temp_fm_preset2, - (const char*)"Custom_preset_data", - (const char*)"02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 83 10 67 15 31 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00"); - flipper_format_rewind(temp_fm_preset2); - subghz_setting_load_custom_preset(app->setting, (const char*)"FM150", temp_fm_preset2); - - flipper_format_free(temp_fm_preset2); - // custom presets loading - end pcsg_preset_init(app, "FM95", 439987500, NULL, 0); diff --git a/applications/plugins/weather_station/weather_station_app.c b/applications/plugins/weather_station/weather_station_app.c index c4edc5975..b17f2acfc 100644 --- a/applications/plugins/weather_station/weather_station_app.c +++ b/applications/plugins/weather_station/weather_station_app.c @@ -81,7 +81,7 @@ WeatherStationApp* weather_station_app_alloc() { app->setting = subghz_setting_alloc(); //ToDo FIX file name setting - subghz_setting_load(app->setting, EXT_PATH("subghz/assets/setting_user"), true); + subghz_setting_load(app->setting, EXT_PATH("subghz/assets/setting_user")); //init Worker & Protocol & History app->lock = WSLockOff; diff --git a/assets/resources/subghz/assets/keeloq_mfcodes_user.example b/assets/resources/subghz/assets/keeloq_mfcodes_user.example index 38fcf72a9..df1e9ff61 100644 --- a/assets/resources/subghz/assets/keeloq_mfcodes_user.example +++ b/assets/resources/subghz/assets/keeloq_mfcodes_user.example @@ -4,7 +4,9 @@ # for adding manufacture keys # AABBCCDDEEFFAABB:X:NAME\r\n # AABBCCDDEEFFAABB - man 64 bit -# X - encryption method 1 - Simple Learning, 2 - Normal_Learning, 3 - Secure_Learning, 4 - Magic_xor_type1 Learning, 5 - FAAC, 6 - Magic Serial typ1 +# X - encryption method - 1 - Simple Learning, 2 - Normal_Learning, 3 - Secure_Learning, +# 4 - Magic_xor_type1 Learning, 5 - FAAC SLH, +# 6 - Magic Serial typ1, 7 - Magic Serial typ2, 8 - Magic Serial typ3 # 0 - iterates over both previous and man in direct and reverse byte sequence # NAME - name (string without spaces) max 64 characters long Filetype: Flipper SubGhz Keystore File diff --git a/assets/resources/subghz/assets/setting_user b/assets/resources/subghz/assets/setting_user deleted file mode 100644 index 4f5dae64c..000000000 --- a/assets/resources/subghz/assets/setting_user +++ /dev/null @@ -1,101 +0,0 @@ -# to use manual settings and prevent them from being deleted on upgrade, rename *_user.example files to *_user -Filetype: Flipper SubGhz Setting File -Version: 1 - -# Add All Standard frequencies -Add_standard_frequencies: false - -# Default Frequency: used as default for "Read" and "Read Raw" -Default_frequency: 433920000 - -# Frequencies used for "Read", "Read Raw" and "Frequency Analyzer" - they added after default ones if enabled in Add_standard_frequencies -Frequency: 300000000 -Frequency: 302757000 -Frequency: 303875000 -Frequency: 304250000 -Frequency: 307000000 -Frequency: 307500000 -Frequency: 307800000 -Frequency: 309000000 -Frequency: 310000000 -Frequency: 312000000 -Frequency: 312100000 -Frequency: 312200000 -Frequency: 313000000 -Frequency: 313850000 -Frequency: 314000000 -Frequency: 314350000 -Frequency: 314980000 -Frequency: 315000000 -Frequency: 318000000 -Frequency: 330000000 -Frequency: 345000000 -Frequency: 348000000 -Frequency: 387000000 -Frequency: 390000000 -Frequency: 418000000 -Frequency: 433075000 -Frequency: 433220000 -Frequency: 433420000 -Frequency: 433657070 -Frequency: 433889000 -Frequency: 433920000 -Frequency: 434075000 -Frequency: 434176948 -Frequency: 434190000 -Frequency: 434390000 -Frequency: 434420000 -Frequency: 434620000 -Frequency: 434775000 -Frequency: 438900000 -Frequency: 440175000 -Frequency: 464000000 -Frequency: 779000000 -Frequency: 868350000 -Frequency: 868400000 -Frequency: 868800000 -Frequency: 868950000 -Frequency: 906400000 -Frequency: 915000000 -Frequency: 925000000 -Frequency: 928000000 - -# Frequencies used for hopping mode (keep this list small or flipper will miss signal) - they added after default ones if enabled in Add_standard_frequencies -Hopper_frequency: 310000000 -Hopper_frequency: 315000000 -Hopper_frequency: 390000000 -Hopper_frequency: 433920000 -Hopper_frequency: 434420000 -Hopper_frequency: 868350000 - -# Custom preset examples -# format for CC1101 "Custom_preset_data:" XX YY XX YY .. 00 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ, where: XX-register, YY - register data, 00 00 - end load register, ZZ - 8 byte Pa table register - -#Custom_preset_name: AM_1 -#Custom_preset_module: CC1101 -#Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 - -#Custom_preset_name: AM_2 -#Custom_preset_module: CC1101 -#Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 - -# Custom presets added in Unleashed FW -# -- Some presets from forum.flipperzero.one -- - -#2-FSK 200khz BW / 135kHz Filter/ 15.86Khz Deviation + Ramping -Custom_preset_name: FM15k -Custom_preset_module: CC1101 -Custom_preset_data: 02 0D 03 47 08 32 0B 06 15 32 14 00 13 00 12 00 11 32 10 A7 18 18 19 1D 1D 92 1C 00 1B 04 20 FB 22 17 21 B6 00 00 00 12 0E 34 60 C5 C1 C0 - -# -- Other presets -- - -# Honda Presets -Custom_preset_name: HND_1 -Custom_preset_module: CC1101 -# G2 G3 G4 D L0 L1 L2 -Custom_preset_data: 02 0D 0B 06 08 32 07 04 14 00 13 02 12 04 11 36 10 69 15 32 18 18 19 16 1D 91 1C 00 1B 07 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00 - -Custom_preset_name: HND_2 -Custom_preset_module: CC1101 -# G2 G3 G4 D L0 L1 L2 -Custom_preset_data: 02 0D 0B 06 08 32 07 04 14 00 13 02 12 07 11 36 10 E9 15 32 18 18 19 16 1D 92 1C 40 1B 03 20 FB 22 10 21 56 00 00 C0 00 00 00 00 00 00 00 diff --git a/assets/resources/subghz/assets/setting_user.example b/assets/resources/subghz/assets/setting_user.example new file mode 100644 index 000000000..e0c474a99 --- /dev/null +++ b/assets/resources/subghz/assets/setting_user.example @@ -0,0 +1,29 @@ +# to use manual settings and prevent them from being deleted on upgrade, rename *_user.example files to *_user +Filetype: Flipper SubGhz Setting File +Version: 1 +# Add Standard frequencies for your region +#Add_standard_frequencies: true + +# Default Frequency: used as default for "Read" and "Read Raw" +#Default_frequency: 433920000 + +# Frequencies used for "Read", "Read Raw" and "Frequency Analyzer" +#Frequency: 300000000 +#Frequency: 310000000 +#Frequency: 320000000 + +# Frequencies used for hopping mode (keep this list small or flipper will miss signal) +#Hopper_frequency: 300000000 +#Hopper_frequency: 310000000 +#Hopper_frequency: 310000000 + +# Custom preset +# format for CC1101 "Custom_preset_data:" XX YY XX YY .. 00 00 ZZ ZZ ZZ ZZ ZZ ZZ ZZ ZZ, where: XX-register, YY - register data, 00 00 - end load register, ZZ - 8 byte Pa table register + +#Custom_preset_name: AM_1 +#Custom_preset_module: CC1101 +#Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 + +#Custom_preset_name: AM_2 +#Custom_preset_module: CC1101 +#Custom_preset_data: 02 0D 03 07 08 32 0B 06 14 00 13 00 12 30 11 32 10 17 18 18 19 18 1D 91 1C 00 1B 07 20 FB 22 11 21 B6 00 00 00 C0 00 00 00 00 00 00 diff --git a/firmware/targets/f7/api_symbols.csv b/firmware/targets/f7/api_symbols.csv index 9cbbb796d..aca3548a4 100644 --- a/firmware/targets/f7/api_symbols.csv +++ b/firmware/targets/f7/api_symbols.csv @@ -3044,7 +3044,7 @@ Function,+,subghz_setting_get_preset_data,uint8_t*,"SubGhzSetting*, size_t" Function,+,subghz_setting_get_preset_data_by_name,uint8_t*,"SubGhzSetting*, const char*" Function,+,subghz_setting_get_preset_data_size,size_t,"SubGhzSetting*, size_t" Function,+,subghz_setting_get_preset_name,const char*,"SubGhzSetting*, size_t" -Function,+,subghz_setting_load,void,"SubGhzSetting*, const char*, _Bool" +Function,+,subghz_setting_load,void,"SubGhzSetting*, const char*" Function,+,subghz_setting_load_custom_preset,_Bool,"SubGhzSetting*, const char*, FlipperFormat*" Function,+,subghz_setting_set_default_frequency,void,"SubGhzSetting*, uint32_t" Function,+,subghz_transmitter_alloc_init,SubGhzTransmitter*,"SubGhzEnvironment*, const char*" diff --git a/lib/subghz/subghz_setting.c b/lib/subghz/subghz_setting.c index 574365efa..439b7a43d 100644 --- a/lib/subghz/subghz_setting.c +++ b/lib/subghz/subghz_setting.c @@ -18,26 +18,59 @@ static const uint32_t subghz_frequency_list[] = { /* 300 - 348 */ 300000000, + 302757000, 303875000, 304250000, + 307000000, + 307500000, + 307800000, + 309000000, 310000000, + 312000000, + 312100000, + 312200000, + 313000000, + 313850000, + 314000000, + 314350000, + 314980000, 315000000, 318000000, + 330000000, + 345000000, + 348000000, /* 387 - 464 */ + 387000000, 390000000, 418000000, 433075000, /* LPD433 first */ + 433220000, 433420000, + 433657070, + 433889000, 433920000 | FREQUENCY_FLAG_DEFAULT, /* LPD433 mid */ + 434075000, + 434176948, + 434190000, + 434390000, 434420000, + 434620000, 434775000, /* LPD433 last channels */ 438900000, + 440175000, + 464000000, /* 779 - 928 */ + 779000000, 868350000, + 868400000, + 868800000, + 868950000, + 906400000, 915000000, 925000000, + 928000000, 0, }; @@ -182,7 +215,7 @@ void subghz_setting_load_default(SubGhzSetting* instance) { instance, subghz_frequency_list, subghz_hopper_frequency_list); } -void subghz_setting_load(SubGhzSetting* instance, const char* file_path, bool not_skip_frequencies) { +void subghz_setting_load(SubGhzSetting* instance, const char* file_path) { furi_assert(instance); Storage* storage = furi_record_open(RECORD_STORAGE); @@ -215,67 +248,64 @@ void subghz_setting_load(SubGhzSetting* instance, const char* file_path, bool no } // Standard frequencies (optional) - if(not_skip_frequencies) { - temp_bool = true; - flipper_format_read_bool(fff_data_file, "Add_standard_frequencies", &temp_bool, 1); - if(!temp_bool) { - FURI_LOG_I(TAG, "Removing standard frequencies"); - FrequencyList_reset(instance->frequencies); - FrequencyList_reset(instance->hopper_frequencies); + temp_bool = true; + flipper_format_read_bool(fff_data_file, "Add_standard_frequencies", &temp_bool, 1); + if(!temp_bool) { + FURI_LOG_I(TAG, "Removing standard frequencies"); + FrequencyList_reset(instance->frequencies); + FrequencyList_reset(instance->hopper_frequencies); + } else { + FURI_LOG_I(TAG, "Keeping standard frequencies"); + } + + // Load frequencies + if(!flipper_format_rewind(fff_data_file)) { + FURI_LOG_E(TAG, "Rewind error"); + break; + } + while(flipper_format_read_uint32( + fff_data_file, "Frequency", (uint32_t*)&temp_data32, 1)) { + if(furi_hal_subghz_is_frequency_valid(temp_data32)) { + FURI_LOG_I(TAG, "Frequency loaded %lu", temp_data32); + FrequencyList_push_back(instance->frequencies, temp_data32); } else { - FURI_LOG_I(TAG, "Keeping standard frequencies"); + FURI_LOG_E(TAG, "Frequency not supported %lu", temp_data32); } + } - // Load frequencies - if(!flipper_format_rewind(fff_data_file)) { - FURI_LOG_E(TAG, "Rewind error"); - break; - } - while(flipper_format_read_uint32( - fff_data_file, "Frequency", (uint32_t*)&temp_data32, 1)) { - if(furi_hal_subghz_is_frequency_valid(temp_data32)) { - FURI_LOG_I(TAG, "Frequency loaded %lu", temp_data32); - FrequencyList_push_back(instance->frequencies, temp_data32); - } else { - FURI_LOG_E(TAG, "Frequency not supported %lu", temp_data32); - } + // Load hopper frequencies + if(!flipper_format_rewind(fff_data_file)) { + FURI_LOG_E(TAG, "Rewind error"); + break; + } + while(flipper_format_read_uint32( + fff_data_file, "Hopper_frequency", (uint32_t*)&temp_data32, 1)) { + if(furi_hal_subghz_is_frequency_valid(temp_data32)) { + FURI_LOG_I(TAG, "Hopper frequency loaded %lu", temp_data32); + FrequencyList_push_back(instance->hopper_frequencies, temp_data32); + } else { + FURI_LOG_E(TAG, "Hopper frequency not supported %lu", temp_data32); } + } - // Load hopper frequencies - if(!flipper_format_rewind(fff_data_file)) { - FURI_LOG_E(TAG, "Rewind error"); - break; - } - while(flipper_format_read_uint32( - fff_data_file, "Hopper_frequency", (uint32_t*)&temp_data32, 1)) { - if(furi_hal_subghz_is_frequency_valid(temp_data32)) { - FURI_LOG_I(TAG, "Hopper frequency loaded %lu", temp_data32); - FrequencyList_push_back(instance->hopper_frequencies, temp_data32); - } else { - FURI_LOG_E(TAG, "Hopper frequency not supported %lu", temp_data32); - } - } + // Default frequency (optional) + if(!flipper_format_rewind(fff_data_file)) { + FURI_LOG_E(TAG, "Rewind error"); + break; + } + if(flipper_format_read_uint32(fff_data_file, "Default_frequency", &temp_data32, 1)) { + subghz_setting_set_default_frequency(instance, temp_data32); + } - // Default frequency (optional) - if(!flipper_format_rewind(fff_data_file)) { - FURI_LOG_E(TAG, "Rewind error"); - break; - } - if(flipper_format_read_uint32( - fff_data_file, "Default_frequency", &temp_data32, 1)) { - subghz_setting_set_default_frequency(instance, temp_data32); - } - - // custom preset (optional) - if(!flipper_format_rewind(fff_data_file)) { - FURI_LOG_E(TAG, "Rewind error"); - break; - } - while(flipper_format_read_string(fff_data_file, "Custom_preset_name", temp_str)) { - FURI_LOG_I(TAG, "Custom preset loaded %s", furi_string_get_cstr(temp_str)); - subghz_setting_load_custom_preset( - instance, furi_string_get_cstr(temp_str), fff_data_file); - } + // custom preset (optional) + if(!flipper_format_rewind(fff_data_file)) { + FURI_LOG_E(TAG, "Rewind error"); + break; + } + while(flipper_format_read_string(fff_data_file, "Custom_preset_name", temp_str)) { + FURI_LOG_I(TAG, "Custom preset loaded %s", furi_string_get_cstr(temp_str)); + subghz_setting_load_custom_preset( + instance, furi_string_get_cstr(temp_str), fff_data_file); } } while(false); diff --git a/lib/subghz/subghz_setting.h b/lib/subghz/subghz_setting.h index c72c6f784..3cb07ff6d 100644 --- a/lib/subghz/subghz_setting.h +++ b/lib/subghz/subghz_setting.h @@ -18,7 +18,7 @@ SubGhzSetting* subghz_setting_alloc(void); void subghz_setting_free(SubGhzSetting* instance); -void subghz_setting_load(SubGhzSetting* instance, const char* file_path, bool not_skip_frequencies); +void subghz_setting_load(SubGhzSetting* instance, const char* file_path); size_t subghz_setting_get_frequency_count(SubGhzSetting* instance); From f73d28677bd89afd0df08b69625c133d18bd9fa0 Mon Sep 17 00:00:00 2001 From: MX <10697207+xMasterX@users.noreply.github.com> Date: Sun, 11 Dec 2022 01:08:00 +0300 Subject: [PATCH 4/4] Update changelog --- CHANGELOG.md | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d5d51be8..0eddf1258 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,11 @@ ### New changes -* API: Version was changed due to breaking changes - from 8.x to 10.x - Extra pack was updated, download it by using link below ([- Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps)) -* SubGHz: Improve signals visibility in history -* Infrared: Update universal remote assets **(TV universal remote now works much faster)** (by @Amec0e) -* Plugins: Weather Station -> Improved signal info dashboard, added signal age counter. (PR by @LY2NEO | #197) (Modified and improved by @xMasterX, new icons and UI changes recommendations by @Karator in OFW PR 2087) -* Plugins: Weather Station -> Oregon2 - add support for RTHN129 -* Plugins: iButton Fuzzer -> change minimal delay (after @Tobirg successfully verified stability with lower delay) -* Plugins: iButton Fuzzer + RFID Fuzzer -> Attempt to fix crash when exiting from uids from file attack -* OFW: NFC bug fixes **(breaking change, affects API version)** -* OFW: UART echo: fix race conditions causing null pointer dereference -* OFW: File browser base folder **(breaking change, affects API version)** -* OFW: Change NFC emulation screens -* OFW: SubGhz: add RPC error -* OFW: FuriHal, Power, UnitTests: battery charging voltage limit API -* OFW: Fix logical error in storage script -* OFW: VCP session close fix -* OFW: Dolphin: new animation L2_Wake_up_128x64 -* OFW: FuriHal: add i2c unit tests +* SubGHz: app launch times improved significantly, also setting_user file no longer overwritten by firmware updates, this update will remove this file (only this version, next ones will not touch it (if you skip this version file will be removed in any case on next update)), be sure to backup if you have custom changes in it! +Now this file is actually should be created by user and will be not removed every update! +* Plugins: Add POCSAG Pager [(by xMasterX & Shmuma)](https://github.com/xMasterX/flipper-pager) +* Misc fixes +* OFW: IR button overflow fix +* OFW: Weather Station: proper event flow for view redraw. +* OFW: Untangle NFC from Unit Tests #### [🎲 Download latest extra apps pack](https://download-directory.github.io/?url=https://github.com/xMasterX/unleashed-extra-pack/tree/main/apps) @@ -41,6 +31,8 @@ **Recommended option - Web Updater** +What means `n` in - `flipper-z-f7-update-(version)n.tgz` ? - that means this build comes without our custom animations, only official flipper animations + Self-update package (update from microSD) - `flipper-z-f7-update-(version).zip` or download `.tgz` for mobile app / qFlipper