[FL-3002] SubGhz: add RPC error (#2097)
* [FL-3002] SubGhz: add RPC error * RPC_APP: rpc_system_app_error_reset, automatic error reset when a new event is executed * SubGhz: fix text error * SubGhz: fix text error 2 * SubGhz: add error description * Format sources Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
		@@ -43,6 +43,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;
 | 
			
		||||
@@ -74,6 +80,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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user