[FL-1913, FL-1963] SubGhz: save raw signal, add came atomo decoder (#783)

* File_Worker: getting the name of a new file with an index
* SubGhz: add decoder RAW protocol
* SubGhz: add view Save RAW
* SubGhz: refactoring subghz custom event
* SubGhz: fix syntax
* SubGhz: fix error build
* SubGhz: test build
* SubGhz: refactoring subghz, add rename, delete, start and emulate RAW signal
* SubGhz: fix triangle glitch in save raw view
* SubGhz: fix receiver config scene
* SubGhz: fix transfer after returning from save scene
* Canvas: add font rotation
* SubGhz: raw protocol encoder
* SubGhz: fix error completion of transfer raw encoder
* SubGhz: increased the speed of reading RAW data from a flash drive, displaying the name of the saved file in the Save RAW scene
* Canvas: fix font rotation
* SubGhz: fix navigation save RAW  scene
* SubGhz: add decode came atomo
* Git: renormalize
* Cleanup sources and enums
* Gui: add font direction to canvas reset, canvas init sequence cleanup.
* SubGhz: reorder menu.
* Gui: correct canvas_set_font_direction signature

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Skorpionm
2021-10-25 18:37:14 +04:00
committed by GitHub
parent 88cee4601a
commit 9d952ed855
59 changed files with 1693 additions and 199 deletions

View File

@@ -79,6 +79,32 @@ bool file_worker_remove(FileWorker* file_worker, const char* filename) {
return file_worker_check_common_errors(file_worker);
}
void file_worker_get_next_filename(
FileWorker* file_worker,
const char* dirname,
const char* filename,
const char* fileextension,
string_t nextfilename) {
string_t temp_str;
string_init(temp_str);
uint16_t num = 0;
string_printf(temp_str, "%s/%s%s", dirname, filename, fileextension);
while(storage_common_stat(file_worker->api, string_get_cstr(temp_str), NULL) == FSE_OK) {
num++;
string_printf(temp_str, "%s/%s%d%s", dirname, filename, num, fileextension);
}
if(num) {
string_printf(nextfilename, "%s%d", filename, num);
} else {
string_printf(nextfilename, "%s", filename);
}
string_clear(temp_str);
}
bool file_worker_read(FileWorker* file_worker, void* buffer, uint16_t bytes_to_read) {
if(!file_worker_read_internal(file_worker, buffer, bytes_to_read)) {
return false;
@@ -355,7 +381,11 @@ bool file_worker_read_until_buffered(
return string_size(str_result) || *file_buf_cnt;
}
bool file_worker_get_value_from_key(FileWorker* file_worker, string_t key, char delimiter, string_t value) {
bool file_worker_get_value_from_key(
FileWorker* file_worker,
string_t key,
char delimiter,
string_t value) {
bool found = false;
string_t next_line;
string_t next_key;

View File

@@ -68,6 +68,22 @@ bool file_worker_mkdir(FileWorker* file_worker, const char* dirname);
*/
bool file_worker_remove(FileWorker* file_worker, const char* filename);
/**
* @brief Get next free filename.
*
* @param file_worker FileWorker instance
* @param dirname
* @param filename
* @param fileextension
* @param nextfilename return name
*/
void file_worker_get_next_filename(
FileWorker* file_worker,
const char* dirname,
const char* filename,
const char* fileextension,
string_t nextfilename);
/**
* @brief Reads data from a file.
*
@@ -194,7 +210,11 @@ bool file_worker_read_until_buffered(
* @param value value for given key
* @return true on success
*/
bool file_worker_get_value_from_key(FileWorker* file_worker, string_t key, char delimiter, string_t value);
bool file_worker_get_value_from_key(
FileWorker* file_worker,
string_t key,
char delimiter,
string_t value);
/**
* @brief Check whether file exist or not