2022-04-19 00:32:25 +03:00
|
|
|
#include "../subghz_i.h"
|
|
|
|
|
2022-07-21 00:35:43 +03:00
|
|
|
#define TAG "SubGhzSetFixFaac868"
|
2022-04-23 01:21:50 +03:00
|
|
|
|
2022-07-21 00:35:43 +03:00
|
|
|
void subghz_scene_set_fix_faac_868_byte_input_callback(void* context) {
|
2022-04-21 19:55:08 +03:00
|
|
|
SubGhz* subghz = context;
|
2022-04-19 00:32:25 +03:00
|
|
|
|
|
|
|
view_dispatcher_send_custom_event(subghz->view_dispatcher, SubGhzCustomEventByteInputDone);
|
|
|
|
}
|
|
|
|
|
2022-07-21 00:35:43 +03:00
|
|
|
void subghz_scene_set_fix_faac_868_on_enter(void* context) {
|
2022-04-21 19:55:08 +03:00
|
|
|
SubGhz* subghz = context;
|
2022-04-19 00:32:25 +03:00
|
|
|
|
|
|
|
// Setup view
|
|
|
|
ByteInput* byte_input = subghz->byte_input;
|
|
|
|
byte_input_set_header_text(byte_input, "Enter FIX in hex");
|
|
|
|
byte_input_set_result_callback(
|
|
|
|
byte_input,
|
2022-07-21 00:35:43 +03:00
|
|
|
subghz_scene_set_fix_faac_868_byte_input_callback,
|
2022-04-19 00:32:25 +03:00
|
|
|
NULL,
|
|
|
|
subghz,
|
2022-04-20 22:23:45 +03:00
|
|
|
subghz->txrx->secure_data->fix,
|
2022-04-19 00:32:25 +03:00
|
|
|
4);
|
|
|
|
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewIdByteInput);
|
|
|
|
}
|
|
|
|
|
2022-07-21 00:35:43 +03:00
|
|
|
bool subghz_scene_set_fix_faac_868_on_event(void* context, SceneManagerEvent event) {
|
2022-04-21 19:55:08 +03:00
|
|
|
SubGhz* subghz = context;
|
|
|
|
bool consumed = false;
|
2022-04-19 00:32:25 +03:00
|
|
|
|
|
|
|
if(event.type == SceneManagerEventTypeCustom) {
|
|
|
|
if(event.event == SubGhzCustomEventByteInputDone) {
|
2022-07-21 00:35:43 +03:00
|
|
|
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSetCntFaac868);
|
2022-04-21 19:55:08 +03:00
|
|
|
consumed = true;
|
2022-04-19 00:32:25 +03:00
|
|
|
}
|
|
|
|
}
|
2022-04-21 19:55:08 +03:00
|
|
|
return consumed;
|
2022-04-19 00:32:25 +03:00
|
|
|
}
|
|
|
|
|
2022-07-21 00:35:43 +03:00
|
|
|
void subghz_scene_set_fix_faac_868_on_exit(void* context) {
|
2022-04-21 19:55:08 +03:00
|
|
|
SubGhz* subghz = context;
|
2022-04-28 13:33:22 +03:00
|
|
|
|
2022-04-19 00:32:25 +03:00
|
|
|
// Clear view
|
|
|
|
byte_input_set_result_callback(subghz->byte_input, NULL, NULL, NULL, NULL, 0);
|
|
|
|
byte_input_set_header_text(subghz->byte_input, "");
|
|
|
|
}
|