From 4a3e3aba34891787b609d7e7f28d150a46a82acd Mon Sep 17 00:00:00 2001 From: r3df0xx Date: Mon, 11 Apr 2022 02:10:32 +0300 Subject: [PATCH] rollback --- .../subghz/helpers/subghz_custom_event.h | 1 - .../scenes/subghz_scene_receiver_info.c | 27 ------------------- applications/subghz/subghz_i.h | 6 ----- lib/subghz/protocols/faac_slh.c | 3 ++- 4 files changed, 2 insertions(+), 35 deletions(-) diff --git a/applications/subghz/helpers/subghz_custom_event.h b/applications/subghz/helpers/subghz_custom_event.h index 33ffb1b46..97920015a 100644 --- a/applications/subghz/helpers/subghz_custom_event.h +++ b/applications/subghz/helpers/subghz_custom_event.h @@ -13,7 +13,6 @@ typedef enum { SubGhzCustomEventSceneReceiverInfoTxStart, SubGhzCustomEventSceneReceiverInfoTxStop, SubGhzCustomEventSceneReceiverInfoSave, - SubGhzCustomEventSceneReceiverInfoNeedSeed, SubGhzCustomEventSceneSaveName, SubGhzCustomEventSceneSaveSuccess, SubGhzCustomEventSceneShowErrorBack, diff --git a/applications/subghz/scenes/subghz_scene_receiver_info.c b/applications/subghz/scenes/subghz_scene_receiver_info.c index 6fb396328..6b27cdb1d 100644 --- a/applications/subghz/scenes/subghz_scene_receiver_info.c +++ b/applications/subghz/scenes/subghz_scene_receiver_info.c @@ -1,7 +1,6 @@ #include "../subghz_i.h" #include "../helpers/subghz_custom_event.h" #include -#include "applications/gui/modules/byte_input.h" void subghz_scene_receiver_info_callback(GuiButtonType result, InputType type, void* context) { furi_assert(context); @@ -16,9 +15,6 @@ void subghz_scene_receiver_info_callback(GuiButtonType result, InputType type, v } else if((result == GuiButtonTypeRight) && (type == InputTypeShort)) { view_dispatcher_send_custom_event( subghz->view_dispatcher, SubGhzCustomEventSceneReceiverInfoSave); - } else if((result == GuiButtonTypeLeft) && (type == InputTypeShort)) { - view_dispatcher_send_custom_event( - subghz->view_dispatcher, SubGhzCustomEventSceneReceiverInfoNeedSeed); } } @@ -115,11 +111,6 @@ void subghz_scene_receiver_info_on_enter(void* context) { view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdWidget); } -void byte_input_callback(void* context) { - SubGhz* subghz = (SubGhz*)context; - view_dispatcher_send_custom_event(subghz->view_dispatcher, SubGhzCustomEventViewReceiverOK); -} - bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event) { SubGhz* subghz = context; if(event.type == SceneManagerEventTypeCustom) { @@ -174,7 +165,6 @@ bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event) if(!subghz_scene_receiver_info_update_parser(subghz)) { return false; } - if((subghz->txrx->decoder_result->protocol->flag & SubGhzProtocolFlag_Save) == SubGhzProtocolFlag_Save) { subghz_file_name_clear(subghz); @@ -182,23 +172,6 @@ bool subghz_scene_receiver_info_on_event(void* context, SceneManagerEvent event) } return true; } - else if(event.event == SubGhzCustomEventSceneReceiverInfoNeedSeed) { - //Need to input seed - SubGhz* subghz = (SubGhz*)context; - - // Setup view - ByteInput* byte_input = subghz->byte_input; - byte_input_set_header_text(byte_input, "Enter seed"); - byte_input_set_result_callback( - byte_input, - byte_input_callback, - NULL, - subghz, - subghz->seed_data->seed, - subghz->seed_data->seed_len); - view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdByteInput); - return true; - } } else if(event.type == SceneManagerEventTypeTick) { if(subghz->txrx->hopper_state != SubGhzHopperStateOFF) { subghz_hopper_update(subghz); diff --git a/applications/subghz/subghz_i.h b/applications/subghz/subghz_i.h index c3c9e456f..5d2596b13 100644 --- a/applications/subghz/subghz_i.h +++ b/applications/subghz/subghz_i.h @@ -110,11 +110,6 @@ struct SubGhzTxRx { typedef struct SubGhzTxRx SubGhzTxRx; -typedef struct { - uint8_t seed[4]; - uint8_t seed_len; -} SeedData; - struct SubGhz { Gui* gui; NotificationApp* notifications; @@ -128,7 +123,6 @@ struct SubGhz { Popup* popup; TextInput* text_input; ByteInput* byte_input; - SeedData* seed_data; Widget* widget; DialogsApp* dialogs; char file_name[SUBGHZ_MAX_LEN_NAME + 1]; diff --git a/lib/subghz/protocols/faac_slh.c b/lib/subghz/protocols/faac_slh.c index 046a9f90f..3f13ea99f 100644 --- a/lib/subghz/protocols/faac_slh.c +++ b/lib/subghz/protocols/faac_slh.c @@ -120,7 +120,7 @@ static bool subghz_protocol_faac_slh_gen_data(SubGhzProtocolEncoderFaacSLH* inst uint32_t hop = 0; uint32_t decrypt = 0; uint64_t man = 0; - //instance->seed = 0x77ED7698; + instance->seed = 0x77ED7698; int res = 0; char fixx[8] = {}; int shiftby = 32; @@ -384,6 +384,7 @@ static void subghz_protocol_faac_slh_check_remote_controller instance->btn = code_fix & 0xF; uint32_t decrypt = 0; uint64_t man; + instance->seed = 0x77ED7698; for M_EACH(manufacture_code, *subghz_keystore_get_data(keystore), SubGhzKeyArray_t) {