-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
47 changed files
with
458 additions
and
758 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#include "../subghz_i.h" | ||
|
||
#define TAG "SubGhzSetCnt" | ||
|
||
void subghz_scene_set_cnt_byte_input_callback(void* context) { | ||
SubGhz* subghz = context; | ||
|
||
view_dispatcher_send_custom_event(subghz->view_dispatcher, SubGhzCustomEventByteInputDone); | ||
} | ||
|
||
void subghz_scene_set_cnt_on_enter(void* context) { | ||
SubGhz* subghz = context; | ||
|
||
// Setup view | ||
ByteInput* byte_input = subghz->byte_input; | ||
SubGhzCustomEvent state = | ||
scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneSetType); | ||
|
||
switch(state) { | ||
case SubmenuIndexBFTClone: | ||
byte_input_set_header_text(byte_input, "Enter COUNTER in hex"); | ||
byte_input_set_result_callback( | ||
byte_input, | ||
subghz_scene_set_cnt_byte_input_callback, | ||
NULL, | ||
subghz, | ||
subghz->txrx->secure_data->cnt, | ||
2); | ||
break; | ||
case SubmenuIndexFaacSLH_433: | ||
case SubmenuIndexFaacSLH_868: | ||
byte_input_set_header_text(byte_input, "Enter COUNTER in hex, 20bits"); | ||
byte_input_set_result_callback( | ||
byte_input, | ||
subghz_scene_set_cnt_byte_input_callback, | ||
NULL, | ||
subghz, | ||
subghz->txrx->secure_data->cnt, | ||
3); | ||
break; | ||
default: | ||
break; | ||
} | ||
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdByteInput); | ||
} | ||
|
||
bool subghz_scene_set_cnt_on_event(void* context, SceneManagerEvent event) { | ||
SubGhz* subghz = context; | ||
bool consumed = false; | ||
|
||
if(event.type == SceneManagerEventTypeCustom) { | ||
if(event.event == SubGhzCustomEventByteInputDone) { | ||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSetSeed); | ||
consumed = true; | ||
} | ||
} | ||
return consumed; | ||
} | ||
|
||
void subghz_scene_set_cnt_on_exit(void* context) { | ||
SubGhz* subghz = context; | ||
|
||
// Clear view | ||
byte_input_set_result_callback(subghz->byte_input, NULL, NULL, NULL, NULL, 0); | ||
byte_input_set_header_text(subghz->byte_input, ""); | ||
} |
46 changes: 0 additions & 46 deletions
46
applications/main/subghz/scenes/subghz_scene_set_cnt_bft.c
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
applications/main/subghz/scenes/subghz_scene_set_cnt_faac.c
This file was deleted.
Oops, something went wrong.
14 changes: 7 additions & 7 deletions
14
.../subghz/scenes/subghz_scene_set_fix_bft.c → ...main/subghz/scenes/subghz_scene_set_fix.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 0 additions & 46 deletions
46
applications/main/subghz/scenes/subghz_scene_set_fix_faac.c
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.