SubGhz: read and save static remotes. Create new static and dynamic remotes. (#646)
* SubGhz: the functions of saving loading KeeLog have been modified, saving KeeLog is prohibited * SubGhz: Fix displaying Nice FlorS in the Raed scene * SubGhz: Fix displaying Faac SLH in the Raed scene * SubGhz: Fix displaying iDo in the Raed scene * SubGhz: Fix displaying Star Line in the Raed scene * SubGhz: Fix displaying Nice Flo in the Raed scene, added save and load functions. (testing needed, no remote control) * SubGhz: subghz_beginadded common encoder upload signal * SubGhz: add Came encoder * SubGhz: modified pricenton encoder, fix view transmitter hide the "Send" button if there is no encoder * SubGhz: add nice flo encoder, need testing no remote control * SubGhz: add gate_tx encoder * SubGhz: add nero_sketch encoder * SubGhz: add keelog encoder * SubGhz: add long upload upload while the button is pressed while releasing the transfer is over, with a check for sticking (maximum 200 upload repetitions) * SubGhz: fix max upload * SubGhz: Fix structure subghz add encoder * SubGhz: add generating and sending a dynamic keelog key, refactoring the code * SubGhz: add notifications * SubGhz: add creating a new remote control (Pricenton, Nice Flo 12bit, Nice Flo 24bit, CAME 12bit, CAME 24bit, Gate TX, DoorHan) * SubGhz: Fix load file, fix scene start * Subghz: Fix show key * SubGhz: Fix subghz_cli * SubGhz: Fix furi-hal-subghz * Format sources * SubGhz: standard notification scheme, fix broken assert in DMA. * SubGhz: move level alignment logic to furi-hal-subghz, fix spelling, cleanup. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -6,7 +6,11 @@ const void subghz_scene_analyze_on_enter(void* context) {
|
||||
}
|
||||
|
||||
const bool subghz_scene_analyze_on_event(void* context, SceneManagerEvent event) {
|
||||
// SubGhz* subghz = context;
|
||||
SubGhz* subghz = context;
|
||||
if(event.type == SceneManagerEventTypeTick) {
|
||||
notification_message(subghz->notifications, &sequence_blink_blue_10);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -10,3 +10,4 @@ ADD_SCENE(subghz, static, Static)
|
||||
ADD_SCENE(subghz, test, Test)
|
||||
ADD_SCENE(subghz, test_carrier, TestCarrier)
|
||||
ADD_SCENE(subghz, test_packet, TestPacket)
|
||||
ADD_SCENE(subghz, set_type, SetType)
|
||||
|
@@ -25,6 +25,7 @@ const void subghz_scene_read_on_enter(void* context) {
|
||||
//Start CC1101 rx
|
||||
subghz_begin(FuriHalSubGhzPresetOokAsync);
|
||||
subghz_rx(433920000);
|
||||
|
||||
furi_hal_subghz_start_async_rx(subghz_worker_rx_callback, subghz->worker);
|
||||
subghz_worker_start(subghz->worker);
|
||||
subghz_protocol_enable_dump(subghz->protocol, subghz_read_protocol_callback, subghz);
|
||||
@@ -36,9 +37,13 @@ const bool subghz_scene_read_on_event(void* context, SceneManagerEvent event) {
|
||||
SubGhz* subghz = context;
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == GUBGHZ_READ_CUSTOM_EVENT) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzViewReceiver);
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneReceiver);
|
||||
notification_message(subghz->notifications, &sequence_success);
|
||||
return true;
|
||||
}
|
||||
} else if(event.type == SceneManagerEventTypeTick) {
|
||||
notification_message(subghz->notifications, &sequence_blink_blue_10);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -46,7 +51,7 @@ const bool subghz_scene_read_on_event(void* context, SceneManagerEvent event) {
|
||||
const void subghz_scene_read_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
//Stop CC1101
|
||||
// Stop CC1101
|
||||
subghz_worker_stop(subghz->worker);
|
||||
furi_hal_subghz_stop_async_rx();
|
||||
subghz_end();
|
||||
|
@@ -4,52 +4,6 @@
|
||||
|
||||
#define SCENE_SAVE_NAME_CUSTOM_EVENT (0UL)
|
||||
|
||||
bool subghz_scene_save_data_to_file(void* context, const char* dev_name) {
|
||||
SubGhz* subghz = context;
|
||||
FileWorker* file_worker = file_worker_alloc(false);
|
||||
string_t dev_file_name;
|
||||
string_init(dev_file_name);
|
||||
string_t temp_str;
|
||||
string_init(temp_str);
|
||||
bool saved = false;
|
||||
|
||||
do {
|
||||
// Create subghz folder directory if necessary
|
||||
if(!file_worker_mkdir(file_worker, SUBGHZ_APP_FOLDER)) {
|
||||
break;
|
||||
}
|
||||
// Create saved directory if necessary
|
||||
if(!file_worker_mkdir(file_worker, SUBGHZ_APP_PATH_FOLDER)) {
|
||||
break;
|
||||
}
|
||||
// First remove subghz device file if it was saved
|
||||
string_printf(
|
||||
dev_file_name, "%s/%s%s", SUBGHZ_APP_PATH_FOLDER, dev_name, SUBGHZ_APP_EXTENSION);
|
||||
if(!file_worker_remove(file_worker, string_get_cstr(dev_file_name))) {
|
||||
break;
|
||||
}
|
||||
// Open file
|
||||
if(!file_worker_open(
|
||||
file_worker, string_get_cstr(dev_file_name), FSAM_WRITE, FSOM_CREATE_ALWAYS)) {
|
||||
break;
|
||||
}
|
||||
//Get string save
|
||||
subghz->protocol_result->to_save_string(subghz->protocol_result, temp_str);
|
||||
// Prepare and write data to file
|
||||
if(!file_worker_write(file_worker, string_get_cstr(temp_str), string_size(temp_str))) {
|
||||
break;
|
||||
}
|
||||
saved = true;
|
||||
} while(0);
|
||||
|
||||
string_clear(temp_str);
|
||||
string_clear(dev_file_name);
|
||||
file_worker_close(file_worker);
|
||||
file_worker_free(file_worker);
|
||||
|
||||
return saved;
|
||||
}
|
||||
|
||||
void subghz_scene_save_name_text_input_callback(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
view_dispatcher_send_custom_event(subghz->view_dispatcher, SCENE_SAVE_NAME_CUSTOM_EVENT);
|
||||
@@ -81,7 +35,7 @@ const bool subghz_scene_save_name_on_event(void* context, SceneManagerEvent even
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SCENE_SAVE_NAME_CUSTOM_EVENT) {
|
||||
if(subghz_scene_save_data_to_file(subghz, subghz->text_store)) {
|
||||
if(subghz_save_protocol_to_file(subghz, subghz->text_store)) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveSuccess);
|
||||
return true;
|
||||
} else {
|
||||
|
@@ -1,77 +1,9 @@
|
||||
#include "../subghz_i.h"
|
||||
|
||||
bool subghz_scene_saved_file_select(SubGhz* subghz) {
|
||||
furi_assert(subghz);
|
||||
|
||||
FileWorker* file_worker = file_worker_alloc(false);
|
||||
string_t protocol_file_name;
|
||||
string_init(protocol_file_name);
|
||||
string_t temp_str;
|
||||
string_init(temp_str);
|
||||
|
||||
// Input events and views are managed by file_select
|
||||
bool res = file_worker_file_select(
|
||||
file_worker,
|
||||
SUBGHZ_APP_PATH_FOLDER,
|
||||
SUBGHZ_APP_EXTENSION,
|
||||
subghz->text_store,
|
||||
sizeof(subghz->text_store),
|
||||
NULL);
|
||||
|
||||
if(res) {
|
||||
// Get key file path
|
||||
string_printf(
|
||||
protocol_file_name,
|
||||
"%s/%s%s",
|
||||
SUBGHZ_APP_PATH_FOLDER,
|
||||
subghz->text_store,
|
||||
SUBGHZ_APP_EXTENSION);
|
||||
} else {
|
||||
string_clear(temp_str);
|
||||
string_clear(protocol_file_name);
|
||||
|
||||
file_worker_close(file_worker);
|
||||
file_worker_free(file_worker);
|
||||
return res;
|
||||
}
|
||||
|
||||
do {
|
||||
if(!file_worker_open(
|
||||
file_worker, string_get_cstr(protocol_file_name), FSAM_READ, FSOM_OPEN_EXISTING)) {
|
||||
break;
|
||||
}
|
||||
// Read and parse name protocol from 1st line
|
||||
if(!file_worker_read_until(file_worker, temp_str, '\n')) {
|
||||
break;
|
||||
}
|
||||
// strlen("Protocol: ") = 10
|
||||
string_right(temp_str, 10);
|
||||
subghz->protocol_result =
|
||||
subghz_protocol_get_by_name(subghz->protocol, string_get_cstr(temp_str));
|
||||
if(subghz->protocol_result == NULL) {
|
||||
file_worker_show_error(file_worker, "Cannot parse\nfile");
|
||||
break;
|
||||
}
|
||||
if(!subghz->protocol_result->to_load_protocol(file_worker, subghz->protocol_result)) {
|
||||
file_worker_show_error(file_worker, "Cannot parse\nfile");
|
||||
break;
|
||||
}
|
||||
res = true;
|
||||
} while(0);
|
||||
|
||||
string_clear(temp_str);
|
||||
string_clear(protocol_file_name);
|
||||
|
||||
file_worker_close(file_worker);
|
||||
file_worker_free(file_worker);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
const void subghz_scene_saved_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
if(subghz_scene_saved_file_select(subghz)) {
|
||||
if(subghz_saved_protocol_select(subghz)) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneTransmitter);
|
||||
} else {
|
||||
scene_manager_search_and_switch_to_previous_scene(subghz->scene_manager, SubGhzSceneStart);
|
||||
|
173
applications/subghz/scenes/subghz_scene_set_type.c
Normal file
173
applications/subghz/scenes/subghz_scene_set_type.c
Normal file
@@ -0,0 +1,173 @@
|
||||
#include "../subghz_i.h"
|
||||
#include "../lib/subghz/protocols/subghz_protocol_keeloq.h"
|
||||
|
||||
enum SubmenuIndex {
|
||||
SubmenuIndexPricenton,
|
||||
SubmenuIndexNiceFlo12bit,
|
||||
SubmenuIndexNiceFlo24bit,
|
||||
SubmenuIndexCAME12bit,
|
||||
SubmenuIndexCAME24bit,
|
||||
SubmenuIndexNeroSketch,
|
||||
SubmenuIndexGateTX,
|
||||
SubmenuIndexDoorHan,
|
||||
};
|
||||
|
||||
bool subghz_scene_set_type_submenu_to_find_protocol(void* context, const char* protocol_name) {
|
||||
SubGhz* subghz = context;
|
||||
subghz->protocol_result = subghz_protocol_get_by_name(subghz->protocol, protocol_name);
|
||||
if(subghz->protocol_result == NULL) {
|
||||
//show error
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void subghz_scene_set_type_submenu_callback(void* context, uint32_t index) {
|
||||
SubGhz* subghz = context;
|
||||
view_dispatcher_send_custom_event(subghz->view_dispatcher, index);
|
||||
}
|
||||
|
||||
const void subghz_scene_set_type_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"Pricenton",
|
||||
SubmenuIndexPricenton,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"Nice Flo 12bit",
|
||||
SubmenuIndexNiceFlo12bit,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"Nice Flo 24bit",
|
||||
SubmenuIndexNiceFlo24bit,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"CAME 12bit",
|
||||
SubmenuIndexCAME12bit,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"CAME 24bit",
|
||||
SubmenuIndexCAME24bit,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
// submenu_add_item(
|
||||
// subghz->submenu, "Nero Sketch", SubmenuIndexNeroSketch, subghz_scene_set_type_submenu_callback, subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"Gate TX",
|
||||
SubmenuIndexGateTX,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"DoorHan",
|
||||
SubmenuIndexDoorHan,
|
||||
subghz_scene_set_type_submenu_callback,
|
||||
subghz);
|
||||
|
||||
submenu_set_selected_item(
|
||||
subghz->submenu, scene_manager_get_scene_state(subghz->scene_manager, SubGhzSceneSetType));
|
||||
|
||||
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewMenu);
|
||||
}
|
||||
|
||||
const bool subghz_scene_set_type_on_event(void* context, SceneManagerEvent event) {
|
||||
SubGhz* subghz = context;
|
||||
bool generated_protocol = false;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
uint32_t key = subghz_random_serial();
|
||||
switch(event.event) {
|
||||
case SubmenuIndexPricenton:
|
||||
if(subghz_scene_set_type_submenu_to_find_protocol(subghz, "Princeton")) {
|
||||
subghz->protocol_result->code_last_count_bit = 24;
|
||||
key = (key & 0x00FFFFF0) | 0x4; //btn 0x1, 0x2, 0x4, 0x8
|
||||
subghz->protocol_result->code_last_found = key;
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexNiceFlo12bit:
|
||||
if(subghz_scene_set_type_submenu_to_find_protocol(subghz, "Nice FLO")) {
|
||||
subghz->protocol_result->code_last_count_bit = 12;
|
||||
key = (key & 0x0000FFF0) | 0x1; //btn 0x1, 0x2, 0x4
|
||||
subghz->protocol_result->code_last_found = key;
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexNiceFlo24bit:
|
||||
if(subghz_scene_set_type_submenu_to_find_protocol(subghz, "Nice FLO")) {
|
||||
subghz->protocol_result->code_last_count_bit = 24;
|
||||
key = (key & 0x00FFFFF0) | 0x4; //btn 0x1, 0x2, 0x4, 0x8
|
||||
subghz->protocol_result->code_last_found = key;
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexCAME12bit:
|
||||
if(subghz_scene_set_type_submenu_to_find_protocol(subghz, "CAME")) {
|
||||
subghz->protocol_result->code_last_count_bit = 12;
|
||||
key = (key & 0x0000FFF0) | 0x1; //btn 0x1, 0x2, 0x4
|
||||
subghz->protocol_result->code_last_found = key;
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexCAME24bit:
|
||||
if(subghz_scene_set_type_submenu_to_find_protocol(subghz, "CAME")) {
|
||||
subghz->protocol_result->code_last_count_bit = 24;
|
||||
key = (key & 0x00FFFFF0) | 0x4; //btn 0x1, 0x2, 0x4, 0x8
|
||||
subghz->protocol_result->code_last_found = key;
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
// case SubmenuIndexNeroSketch:
|
||||
// /* code */
|
||||
// break;
|
||||
case SubmenuIndexGateTX:
|
||||
if(subghz_scene_set_type_submenu_to_find_protocol(subghz, "GateTX")) {
|
||||
subghz->protocol_result->code_last_count_bit = 24;
|
||||
key = (key & 0x00F0FFFF) | 0xF << 16; //btn 0xF, 0xC, 0xA, 0x6
|
||||
subghz->protocol_result->code_last_found = subghz_protocol_common_reverse_key(
|
||||
key, subghz->protocol_result->code_last_count_bit);
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
case SubmenuIndexDoorHan:
|
||||
if(subghz_scene_set_type_submenu_to_find_protocol(subghz, "KeeLoq")) {
|
||||
subghz->protocol_result->code_last_count_bit = 64;
|
||||
subghz->protocol_result->serial = key & 0x0FFFFFFF;
|
||||
subghz->protocol_result->btn = 0x2; //btn 0x1, 0x2, 0x4, 0x8
|
||||
subghz->protocol_result->cnt = 0x0003;
|
||||
subghz_protocol_keeloq_set_manufacture_name(subghz->protocol_result, "DoorHan");
|
||||
subghz->protocol_result->code_last_found =
|
||||
subghz_protocol_keeloq_gen_key(subghz->protocol_result);
|
||||
|
||||
generated_protocol = true;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
if(generated_protocol) {
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const void subghz_scene_set_type_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
submenu_clean(subghz->submenu);
|
||||
}
|
@@ -6,6 +6,7 @@ enum SubmenuIndex {
|
||||
SubmenuIndexSaved,
|
||||
SubmenuIndexStatic,
|
||||
SubmenuIndexTest,
|
||||
SubmenuIndexAddManualy,
|
||||
};
|
||||
|
||||
void subghz_scene_start_submenu_callback(void* context, uint32_t index) {
|
||||
@@ -15,7 +16,9 @@ void subghz_scene_start_submenu_callback(void* context, uint32_t index) {
|
||||
|
||||
const void subghz_scene_start_on_enter(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
if(subghz->state_notifications == NOTIFICATION_STARTING_STATE) {
|
||||
subghz->state_notifications = NOTIFICATION_IDLE_STATE;
|
||||
}
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"Analyze",
|
||||
@@ -26,6 +29,12 @@ const void subghz_scene_start_on_enter(void* context) {
|
||||
subghz->submenu, "Read", SubmenuIndexRead, subghz_scene_start_submenu_callback, subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu, "Saved", SubmenuIndexSaved, subghz_scene_start_submenu_callback, subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu,
|
||||
"Add manually",
|
||||
SubmenuIndexAddManualy,
|
||||
subghz_scene_start_submenu_callback,
|
||||
subghz);
|
||||
submenu_add_item(
|
||||
subghz->submenu, "Static", SubmenuIndexStatic, subghz_scene_start_submenu_callback, subghz);
|
||||
submenu_add_item(
|
||||
@@ -56,6 +65,11 @@ const bool subghz_scene_start_on_event(void* context, SceneManagerEvent event) {
|
||||
subghz->scene_manager, SubGhzSceneStart, SubmenuIndexSaved);
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaved);
|
||||
return true;
|
||||
} else if(event.event == SubmenuIndexAddManualy) {
|
||||
scene_manager_set_scene_state(
|
||||
subghz->scene_manager, SubGhzSceneStart, SubmenuIndexAddManualy);
|
||||
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSetType);
|
||||
return true;
|
||||
} else if(event.event == SubmenuIndexStatic) {
|
||||
scene_manager_set_scene_state(
|
||||
subghz->scene_manager, SubGhzSceneStart, SubmenuIndexStatic);
|
||||
|
@@ -1,28 +1,5 @@
|
||||
#include "../subghz_i.h"
|
||||
#include "../views/subghz_transmitter.h"
|
||||
#include "lib/subghz/protocols/subghz_protocol_princeton.h"
|
||||
|
||||
void subghz_scene_transmitter_tx(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
SubGhzEncoderPrinceton* encoder = subghz_encoder_princeton_alloc();
|
||||
|
||||
subghz_encoder_princeton_reset(encoder, subghz->protocol_result->code_last_found, 4);
|
||||
subghz_encoder_princeton_set_te(encoder, subghz->protocol_result);
|
||||
|
||||
subghz_begin(FuriHalSubGhzPresetOokAsync);
|
||||
subghz_tx(433920000);
|
||||
|
||||
furi_hal_subghz_start_async_tx(subghz_encoder_princeton_yield, encoder);
|
||||
|
||||
while(!furi_hal_subghz_is_async_tx_complete()) {
|
||||
osDelay(20);
|
||||
}
|
||||
|
||||
//Stop tx
|
||||
furi_hal_subghz_stop_async_tx();
|
||||
subghz_end();
|
||||
subghz_encoder_princeton_free(encoder);
|
||||
}
|
||||
|
||||
void subghz_scene_transmitter_callback(SubghzTransmitterEvent event, void* context) {
|
||||
furi_assert(context);
|
||||
@@ -35,24 +12,36 @@ const void subghz_scene_transmitter_on_enter(void* context) {
|
||||
SubghzTransmitter* subghz_transmitter = subghz->subghz_transmitter;
|
||||
|
||||
subghz_transmitter_set_callback(subghz_transmitter, subghz_scene_transmitter_callback, subghz);
|
||||
|
||||
subghz_transmitter_set_protocol(subghz_transmitter, subghz->protocol_result);
|
||||
|
||||
view_dispatcher_switch_to_view(subghz->view_dispatcher, SubGhzViewTransmitter);
|
||||
|
||||
subghz->state_notifications = NOTIFICATION_IDLE_STATE;
|
||||
}
|
||||
|
||||
const bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent event) {
|
||||
SubGhz* subghz = context;
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SubghzTransmitterEventSend) {
|
||||
//scene_manager_next_scene(subghz->scene_manager, SubGhzSceneSaveName);
|
||||
subghz_scene_transmitter_tx(subghz);
|
||||
if(event.event == SubghzTransmitterEventSendStart) {
|
||||
subghz->state_notifications = NOTIFICATION_TX_STATE;
|
||||
subghz_transmitter_tx_start(subghz);
|
||||
return true;
|
||||
} else if(event.event == SubghzTransmitterEventSendStop) {
|
||||
subghz->state_notifications = NOTIFICATION_IDLE_STATE;
|
||||
subghz_transmitter_tx_stop(subghz);
|
||||
return true;
|
||||
} else if(event.event == SubghzTransmitterEventBack) {
|
||||
subghz->state_notifications = NOTIFICATION_IDLE_STATE;
|
||||
scene_manager_search_and_switch_to_previous_scene(
|
||||
subghz->scene_manager, SubGhzSceneStart);
|
||||
return true;
|
||||
}
|
||||
} else if(event.type == SceneManagerEventTypeTick) {
|
||||
if(subghz->state_notifications == NOTIFICATION_TX_STATE) {
|
||||
notification_message(subghz->notifications, &sequence_blink_red_10);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -60,6 +49,6 @@ const bool subghz_scene_transmitter_on_event(void* context, SceneManagerEvent ev
|
||||
const void subghz_scene_transmitter_on_exit(void* context) {
|
||||
SubGhz* subghz = context;
|
||||
SubghzTransmitter* subghz_transmitter = subghz->subghz_transmitter;
|
||||
|
||||
subghz_transmitter_set_callback(subghz_transmitter, NULL, subghz);
|
||||
subghz->state_notifications = NOTIFICATION_IDLE_STATE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user