mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Merge branch 'ofwdev' into 420
This commit is contained in:
13
applications/main/subghz/helpers/subghz_error_type.h
Normal file
13
applications/main/subghz/helpers/subghz_error_type.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
|
||||
/** SubGhzErrorType */
|
||||
typedef enum {
|
||||
SubGhzErrorTypeNoError = 0, /** There are no errors */
|
||||
SubGhzErrorTypeParseFile =
|
||||
1, /** File parsing error, or wrong file structure, or missing required parameters. more accurate data can be obtained through the debug port */
|
||||
SubGhzErrorTypeOnlyRX =
|
||||
2, /** Transmission on this frequency is blocked by regional settings */
|
||||
} SubGhzErrorType;
|
||||
@@ -45,6 +45,12 @@ bool subghz_scene_rpc_on_event(void* context, SceneManagerEvent event) {
|
||||
result = subghz_tx_start(subghz, subghz->txrx->fff_data);
|
||||
if(result) subghz_blink_start(subghz);
|
||||
}
|
||||
if(!result) {
|
||||
rpc_system_app_set_error_code(subghz->rpc_ctx, SubGhzErrorTypeOnlyRX);
|
||||
rpc_system_app_set_error_text(
|
||||
subghz->rpc_ctx,
|
||||
"Transmission on this frequency is restricted in your region");
|
||||
}
|
||||
rpc_system_app_confirm(subghz->rpc_ctx, RpcAppEventButtonPress, result);
|
||||
} else if(event.event == SubGhzCustomEventSceneRpcButtonRelease) {
|
||||
bool result = false;
|
||||
@@ -76,6 +82,9 @@ bool subghz_scene_rpc_on_event(void* context, SceneManagerEvent event) {
|
||||
popup_set_text(popup, subghz->file_name_tmp, 89, 44, AlignCenter, AlignTop);
|
||||
|
||||
furi_string_free(file_name);
|
||||
} else {
|
||||
rpc_system_app_set_error_code(subghz->rpc_ctx, SubGhzErrorTypeParseFile);
|
||||
rpc_system_app_set_error_text(subghz->rpc_ctx, "Cannot parse file");
|
||||
}
|
||||
}
|
||||
rpc_system_app_confirm(subghz->rpc_ctx, RpcAppEventLoadFile, result);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "helpers/subghz_types.h"
|
||||
#include "helpers/subghz_error_type.h"
|
||||
#include <lib/subghz/types.h>
|
||||
#include "subghz.h"
|
||||
#include "views/receiver.h"
|
||||
|
||||
Reference in New Issue
Block a user