From 2dc43311e0b961ba8f3f43e3e3f2b477c5445e98 Mon Sep 17 00:00:00 2001 From: David Lee Date: Thu, 14 Mar 2024 18:57:12 +0100 Subject: [PATCH 1/2] Fix for compile errors under 0.99.1 --- helpers/meal_pager_storage.c | 12 ++++++------ helpers/retekess/meal_pager_retekess_t119.c | 6 +++--- helpers/retekess/meal_pager_retekess_td157.c | 6 +++--- helpers/retekess/meal_pager_retekess_td165.c | 6 +++--- helpers/retekess/meal_pager_retekess_td174.c | 6 +++--- scenes/meal_pager_scene_set_first_pager.c | 2 +- scenes/meal_pager_scene_set_first_station.c | 2 +- scenes/meal_pager_scene_set_last_pager.c | 4 ++-- scenes/meal_pager_scene_set_last_station.c | 4 ++-- 9 files changed, 24 insertions(+), 24 deletions(-) diff --git a/helpers/meal_pager_storage.c b/helpers/meal_pager_storage.c index 187031f33ad..aa10026d3d5 100644 --- a/helpers/meal_pager_storage.c +++ b/helpers/meal_pager_storage.c @@ -223,26 +223,26 @@ void meal_pager_set_max_values(void* context) { } if(app->first_station > app->max_station) { app->first_station = app->max_station; - snprintf(app->text_store[0], 5, "%lu", app->first_station); + snprintf(app->text_store[0], 20, "%lu", app->first_station); } if(app->last_station > app->max_station) { app->last_station = app->max_station; - snprintf(app->text_store[1], 5, "%lu", app->last_station); + snprintf(app->text_store[1], 20, "%lu", app->last_station); } if(app->last_station < app->first_station) { app->last_station = app->first_station; - snprintf(app->text_store[1], 5, "%lu", app->last_station); + snprintf(app->text_store[1], 20, "%lu", app->last_station); } if(app->first_pager > app->max_pager) { app->first_pager = app->max_pager; - snprintf(app->text_store[2], 4, "%lu", app->first_pager); + snprintf(app->text_store[2], 20, "%lu", app->first_pager); } if(app->last_pager > app->max_pager) { app->last_pager = app->max_pager; - snprintf(app->text_store[3], 4, "%lu", app->last_pager); + snprintf(app->text_store[3], 20, "%lu", app->last_pager); } if(app->last_pager < app->first_pager) { app->last_pager = app->first_pager; - snprintf(app->text_store[3], 4, "%lu", app->last_pager); + snprintf(app->text_store[3], 20, "%lu", app->last_pager); } } \ No newline at end of file diff --git a/helpers/retekess/meal_pager_retekess_t119.c b/helpers/retekess/meal_pager_retekess_t119.c index fa6415537af..999ee3a4e19 100644 --- a/helpers/retekess/meal_pager_retekess_t119.c +++ b/helpers/retekess/meal_pager_retekess_t119.c @@ -67,7 +67,7 @@ static void meal_pager_retekess_t119_generate_pager( //FURI_LOG_D(TAG, "Manchester: %s", manchester); char* rawSignal = genRawDataT119(200, 600, manchester); //FURI_LOG_D(TAG, "RAW_Data: %s", rawSignal); - for(u_int32_t i = 1; app->repeats >= i; i++) { + for(uint32_t i = 1; app->repeats >= i; i++) { flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal); } //flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal); @@ -90,7 +90,7 @@ static void uint32ToBinaray(station, stationId, 13); reverse(stationId); meal_pager_transmit_model_set_station(app->meal_pager_transmit, app->current_station); - for(u_int32_t i = app->current_pager; i <= app->last_pager; i++) { + for(uint32_t i = app->current_pager; i <= app->last_pager; i++) { meal_pager_retekess_t119_generate_pager(app, stationId, i, ff); //furi_thread_flags_wait(0, FuriFlagWaitAny, 1); if(app->stop_transmit) { @@ -117,7 +117,7 @@ bool meal_pager_retekess_t119_generate_all(void* context) { return success; } - for(u_int32_t i = app->current_station; i <= app->last_station; i++) { + for(uint32_t i = app->current_station; i <= app->last_station; i++) { meal_pager_retekess_t119_generate_station(app, i, ff); //furi_thread_flags_wait(0, FuriFlagWaitAny, 100); if(app->stop_transmit) { diff --git a/helpers/retekess/meal_pager_retekess_td157.c b/helpers/retekess/meal_pager_retekess_td157.c index 6467927ee0a..329afa5f44c 100644 --- a/helpers/retekess/meal_pager_retekess_td157.c +++ b/helpers/retekess/meal_pager_retekess_td157.c @@ -55,7 +55,7 @@ static void meal_pager_retekess_td157_generate_pager( customConcat(fullId, actionId); char* manchester = encManchester(fullId, 0); char* rawSignal = genRawDataTD157(200, 600, manchester); - for(u_int32_t i = 1; app->repeats >= i; i++) { + for(uint32_t i = 1; app->repeats >= i; i++) { flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal); } free(manchester); @@ -77,7 +77,7 @@ static void uint32ToBinaray(station, stationId, 10); //reverse(stationId); meal_pager_transmit_model_set_station(app->meal_pager_transmit, app->current_station); - for(u_int32_t i = app->current_pager; i <= app->last_pager; i++) { + for(uint32_t i = app->current_pager; i <= app->last_pager; i++) { meal_pager_retekess_td157_generate_pager(app, stationId, i, ff); if(app->stop_transmit) { break; @@ -103,7 +103,7 @@ bool meal_pager_retekess_td157_generate_all(void* context) { return success; } - for(u_int32_t i = app->current_station; i <= app->last_station; i++) { + for(uint32_t i = app->current_station; i <= app->last_station; i++) { meal_pager_retekess_td157_generate_station(app, i, ff); if(app->stop_transmit) { break; diff --git a/helpers/retekess/meal_pager_retekess_td165.c b/helpers/retekess/meal_pager_retekess_td165.c index 0f81f281b96..798239fab43 100644 --- a/helpers/retekess/meal_pager_retekess_td165.c +++ b/helpers/retekess/meal_pager_retekess_td165.c @@ -57,7 +57,7 @@ static void meal_pager_retekess_td165_generate_pager( customConcat(fullId, actionId); char* manchester = encManchester(fullId, 0); char* rawSignal = genRawDataTD165(200, 600, manchester); - for(u_int32_t i = 1; app->repeats >= i; i++) { + for(uint32_t i = 1; app->repeats >= i; i++) { flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal); } free(manchester); @@ -79,7 +79,7 @@ static void uint32ToBinaray(station, stationId, 13); reverse(stationId); meal_pager_transmit_model_set_station(app->meal_pager_transmit, app->current_station); - for(u_int32_t i = app->current_pager; i <= app->last_pager; i++) { + for(uint32_t i = app->current_pager; i <= app->last_pager; i++) { meal_pager_retekess_td165_generate_pager(app, stationId, i, ff); if(app->stop_transmit) { break; @@ -105,7 +105,7 @@ bool meal_pager_retekess_td165_generate_all(void* context) { return success; } - for(u_int32_t i = app->current_station; i <= app->last_station; i++) { + for(uint32_t i = app->current_station; i <= app->last_station; i++) { meal_pager_retekess_td165_generate_station(app, i, ff); if(app->stop_transmit) { break; diff --git a/helpers/retekess/meal_pager_retekess_td174.c b/helpers/retekess/meal_pager_retekess_td174.c index 312bf900fdd..10050712e98 100644 --- a/helpers/retekess/meal_pager_retekess_td174.c +++ b/helpers/retekess/meal_pager_retekess_td174.c @@ -60,7 +60,7 @@ static void meal_pager_retekess_td174_generate_pager( customConcat(fullId, pagerId); char* manchester = encManchester(fullId, 0); char* rawSignal = genRawDataTd174(300, 900, manchester); - for(u_int32_t i = 1; app->repeats >= i; i++) { + for(uint32_t i = 1; app->repeats >= i; i++) { flipper_format_write_string_cstr(ff, "RAW_Data", rawSignal); } free(manchester); @@ -82,7 +82,7 @@ static void uint32ToBinaray(station, stationId, 13); reverse(stationId); meal_pager_transmit_model_set_station(app->meal_pager_transmit, app->current_station); - for(u_int32_t i = app->current_pager; i <= app->last_pager; i++) { + for(uint32_t i = app->current_pager; i <= app->last_pager; i++) { meal_pager_retekess_td174_generate_pager(app, stationId, i, ff); if(app->stop_transmit) { break; @@ -108,7 +108,7 @@ bool meal_pager_retekess_td174_generate_all(void* context) { return success; } - for(u_int32_t i = app->current_station; i <= app->last_station; i++) { + for(uint32_t i = app->current_station; i <= app->last_station; i++) { meal_pager_retekess_td174_generate_station(app, i, ff); //furi_thread_flags_wait(0, FuriFlagWaitAny, 100); if(app->stop_transmit) { diff --git a/scenes/meal_pager_scene_set_first_pager.c b/scenes/meal_pager_scene_set_first_pager.c index e8c1611e21e..fb54ab4dabb 100644 --- a/scenes/meal_pager_scene_set_first_pager.c +++ b/scenes/meal_pager_scene_set_first_pager.c @@ -43,7 +43,7 @@ bool meal_pager_scene_set_first_pager_on_event(void* context, SceneManagerEvent app->first_pager = atoi(app->text_store[2]); if(app->first_pager > app->max_pager) { app->first_pager = app->max_pager; - snprintf(app->text_store[2], 4, "%lu", app->first_pager); + snprintf(app->text_store[2], 20, "%lu", app->first_pager); } app->first_pager_char = app->text_store[2]; scene_manager_previous_scene(app->scene_manager); diff --git a/scenes/meal_pager_scene_set_first_station.c b/scenes/meal_pager_scene_set_first_station.c index ca035883d7e..338b9543036 100644 --- a/scenes/meal_pager_scene_set_first_station.c +++ b/scenes/meal_pager_scene_set_first_station.c @@ -43,7 +43,7 @@ bool meal_pager_scene_set_first_station_on_event(void* context, SceneManagerEven app->first_station = atoi(app->text_store[0]); if(app->first_station > app->max_station) { app->first_station = app->max_station; - snprintf(app->text_store[0], 5, "%lu", app->first_station); + snprintf(app->text_store[0], 20, "%lu", app->first_station); } app->first_station_char = app->text_store[0]; scene_manager_previous_scene(app->scene_manager); diff --git a/scenes/meal_pager_scene_set_last_pager.c b/scenes/meal_pager_scene_set_last_pager.c index f67cef501ca..c092e8242ac 100644 --- a/scenes/meal_pager_scene_set_last_pager.c +++ b/scenes/meal_pager_scene_set_last_pager.c @@ -43,11 +43,11 @@ bool meal_pager_scene_set_last_pager_on_event(void* context, SceneManagerEvent e app->last_pager = atoi(app->text_store[3]); if(app->last_pager > app->max_pager) { app->last_pager = app->max_pager; - snprintf(app->text_store[3], 4, "%lu", app->last_pager); + snprintf(app->text_store[3], 20, "%lu", app->last_pager); } if(app->last_pager < app->first_pager) { app->last_pager = app->first_pager; - snprintf(app->text_store[3], 4, "%lu", app->last_pager); + snprintf(app->text_store[3], 20, "%lu", app->last_pager); } app->last_pager_char = app->text_store[3]; scene_manager_previous_scene(app->scene_manager); diff --git a/scenes/meal_pager_scene_set_last_station.c b/scenes/meal_pager_scene_set_last_station.c index 70efe784415..27e7f8d21bd 100644 --- a/scenes/meal_pager_scene_set_last_station.c +++ b/scenes/meal_pager_scene_set_last_station.c @@ -43,11 +43,11 @@ bool meal_pager_scene_set_last_station_on_event(void* context, SceneManagerEvent app->last_station = atoi(app->text_store[1]); if(app->last_station > app->max_station) { app->last_station = app->max_station; - snprintf(app->text_store[1], 5, "%lu", app->last_station); + snprintf(app->text_store[1], 20, "%lu", app->last_station); } if(app->last_station < app->first_station) { app->last_station = app->first_station; - snprintf(app->text_store[1], 5, "%lu", app->last_station); + snprintf(app->text_store[1], 20, "%lu", app->last_station); } app->last_station_char = app->text_store[1]; scene_manager_previous_scene(app->scene_manager); From b27b217d95acd37633de8a7022c686e300805240 Mon Sep 17 00:00:00 2001 From: David Lee Date: Thu, 14 Mar 2024 18:59:08 +0100 Subject: [PATCH 2/2] Fix for compile errors under 0.99.1 --- application.fam | 2 +- docs/changelog.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application.fam b/application.fam index 6dfdce520da..7742570cd63 100644 --- a/application.fam +++ b/application.fam @@ -7,7 +7,7 @@ App( fap_icon="icons/meal_pager_10px.png", fap_icon_assets="icons", fap_category="Sub-Ghz", - fap_version="1.3", + fap_version="1.4", fap_author="leedave", fap_weburl="https://github.com/leedave/flipper-zero-meal-pager", fap_description="This app triggers restaurant pagers in a brute force manner, useful to test if devices are still functional.", diff --git a/docs/changelog.md b/docs/changelog.md index c026d53f9a4..dbe20149e47 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,3 +1,6 @@ +## v1.4 +- Fixed some restrictions that prevented build under 0.99.1 + ## v1.3 - Fixed some memory leaks - Changed Subghz Protocol Registry to Fipper API conform variant