This commit is contained in:
r3df0xx
2022-05-17 15:54:09 +03:00
parent 2c5fc9ea44
commit 7fbf49d377
76 changed files with 2239 additions and 63 deletions

View File

@@ -1,10 +1,12 @@
#include <furi.h>
#include <furi_hal.h>
#include "../subghz_i.h"
#include "../views/subghz_read_raw.h"
#include <dolphin/dolphin.h>
#include <lib/subghz/protocols/raw.h>
#include <lib/toolbox/path.h>
#define RAW_FILE_NAME "Raw_signal_"
#define RAW_FILE_NAME "R_"
#define TAG "SubGhzSceneReadRAW"
bool subghz_scene_read_raw_update_filename(SubGhz* subghz) {
@@ -237,8 +239,17 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
string_t temp_str;
string_init(temp_str);
FuriHalRtcDateTime datetime;
furi_hal_rtc_get_datetime(&datetime);
char strings[1][25];
sprintf(strings[0], "%s%.4d%.2d%.2d%.2d%.2d", "R"
, datetime.year, datetime.month, datetime.day
, datetime.hour, datetime.minute
);
string_printf(
temp_str, "%s/%s%s", SUBGHZ_RAW_FOLDER, RAW_FILE_NAME, SUBGHZ_APP_EXTENSION);
temp_str, "%s/%s%s", SUBGHZ_RAW_FOLDER, strings[0], SUBGHZ_APP_EXTENSION);
subghz_protocol_raw_gen_fff_data(subghz->txrx->fff_data, string_get_cstr(temp_str));
string_clear(temp_str);
@@ -259,9 +270,17 @@ bool subghz_scene_read_raw_on_event(void* context, SceneManagerEvent event) {
scene_manager_next_scene(subghz->scene_manager, SubGhzSceneNeedSaving);
} else {
//subghz_get_preset_name(subghz, subghz->error_str);
FuriHalRtcDateTime datetime;
furi_hal_rtc_get_datetime(&datetime);
char strings[1][25];
sprintf(strings[0], "%s%.4d%.2d%.2d%.2d%.2d", "R"
, datetime.year, datetime.month, datetime.day
, datetime.hour, datetime.minute
);
if(subghz_protocol_raw_save_to_file_init(
(SubGhzProtocolDecoderRAW*)subghz->txrx->decoder_result,
RAW_FILE_NAME,
strings[0],
subghz->txrx->frequency,
subghz->txrx->preset)) {
DOLPHIN_DEED(DolphinDeedSubGhzRawRec);