[FL-2274] Inventing streams and moving FFF to them (#981)
* Streams: string stream * String stream: updated insert/delete api * Streams: generic stream interface and string stream implementation * Streams: helpers for insert and delete_and_insert * FFF: now compatible with streams * MinUnit: introduced tests with arguments * FFF: stream access violation * Streams: copy data between streams * Streams: file stream * FFF: documentation * FFStream: documentation * FFF: alloc as file * MinUnit: support for nested tests * Streams: changed delete_and_insert, now it returns success flag. Added ability dump stream inner parameters and data to cout. * FFF: simplified file open function * Streams: unit tests * FFF: tests * Streams: declare cache_size constant as define, to allow variable modified arrays * FFF: lib moved to a separate folder * iButton: new FFF * RFID: new FFF * Animations: new FFF * IR: new FFF * NFC: new FFF * Flipper file format: delete lib * U2F: new FFF * Subghz: new FFF and streams * Streams: read line * Streams: split * FuriCore: implement memset with extra asserts * FuriCore: implement extra heap asserts without inventing memset * Scene manager: protected access to the scene id stack with a size check * NFC worker: dirty fix for issue where hal_nfc was busy on app start * Furi: update allocator to erase memory on allocation. Replace furi_alloc with malloc. * FuriCore: cleanup memmgr code. * Furi HAL: furi_hal_init is split into critical and non-critical parts. The critical part is currently clock and console. * Memmgr: added ability to track allocations and deallocations through console. * FFStream: some speedup * Streams, FF: minor fixes * Tests: restore * File stream: a slightly more thread-safe version of file_stream_delete_and_insert Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -19,7 +19,7 @@ typedef enum {
|
||||
} CameDecoderStep;
|
||||
|
||||
SubGhzProtocolCame* subghz_protocol_came_alloc() {
|
||||
SubGhzProtocolCame* instance = furi_alloc(sizeof(SubGhzProtocolCame));
|
||||
SubGhzProtocolCame* instance = malloc(sizeof(SubGhzProtocolCame));
|
||||
|
||||
instance->common.name = "CAME";
|
||||
instance->common.code_min_count_bit_for_found = 12;
|
||||
@@ -167,16 +167,16 @@ void subghz_protocol_came_to_str(SubGhzProtocolCame* instance, string_t output)
|
||||
code_found_reverse_lo);
|
||||
}
|
||||
|
||||
bool subghz_protocol_came_to_save_file(SubGhzProtocolCame* instance, FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
bool subghz_protocol_came_to_save_file(SubGhzProtocolCame* instance, FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_came_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolCame* instance,
|
||||
const char* file_path) {
|
||||
return subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
(SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
void subghz_decoder_came_to_load_protocol(SubGhzProtocolCame* instance, void* context) {
|
||||
|
@@ -48,20 +48,20 @@ void subghz_protocol_came_to_str(SubGhzProtocolCame* instance, string_t output);
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolCame instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_came_to_save_file(SubGhzProtocolCame* instance, FlipperFile* flipper_file);
|
||||
bool subghz_protocol_came_to_save_file(SubGhzProtocolCame* instance, FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolCame instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_came_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolCame* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -19,7 +19,7 @@ typedef enum {
|
||||
} CameAtomoDecoderStep;
|
||||
|
||||
SubGhzProtocolCameAtomo* subghz_protocol_came_atomo_alloc() {
|
||||
SubGhzProtocolCameAtomo* instance = furi_alloc(sizeof(SubGhzProtocolCameAtomo));
|
||||
SubGhzProtocolCameAtomo* instance = malloc(sizeof(SubGhzProtocolCameAtomo));
|
||||
|
||||
instance->common.name = "CAME Atomo";
|
||||
instance->common.code_min_count_bit_for_found = 62;
|
||||
|
@@ -27,7 +27,7 @@ typedef enum {
|
||||
} CameTweeDecoderStep;
|
||||
|
||||
SubGhzProtocolCameTwee* subghz_protocol_came_twee_alloc() {
|
||||
SubGhzProtocolCameTwee* instance = furi_alloc(sizeof(SubGhzProtocolCameTwee));
|
||||
SubGhzProtocolCameTwee* instance = malloc(sizeof(SubGhzProtocolCameTwee));
|
||||
|
||||
instance->common.name = "CAME TWEE";
|
||||
instance->common.code_min_count_bit_for_found = 54;
|
||||
@@ -327,16 +327,16 @@ void subghz_protocol_came_twee_to_str(SubGhzProtocolCameTwee* instance, string_t
|
||||
|
||||
bool subghz_protocol_came_twee_to_save_file(
|
||||
SubGhzProtocolCameTwee* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_came_twee_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolCameTwee* instance,
|
||||
const char* file_path) {
|
||||
if(subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file)) {
|
||||
(SubGhzProtocolCommon*)instance, flipper_format)) {
|
||||
subghz_protocol_came_twee_remote_controller(instance);
|
||||
return true;
|
||||
}
|
||||
|
@@ -51,22 +51,22 @@ void subghz_protocol_came_twee_to_str(SubGhzProtocolCameTwee* instance, string_t
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolCameTwee instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_came_twee_to_save_file(
|
||||
SubGhzProtocolCameTwee* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolCameTwee instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_came_twee_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolCameTwee* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -3,8 +3,8 @@
|
||||
#include <lib/toolbox/hex.h>
|
||||
|
||||
SubGhzProtocolCommonEncoder* subghz_protocol_encoder_common_alloc() {
|
||||
SubGhzProtocolCommonEncoder* instance = furi_alloc(sizeof(SubGhzProtocolCommonEncoder));
|
||||
instance->upload = furi_alloc(SUBGHZ_ENCODER_UPLOAD_MAX_SIZE * sizeof(LevelDuration));
|
||||
SubGhzProtocolCommonEncoder* instance = malloc(sizeof(SubGhzProtocolCommonEncoder));
|
||||
instance->upload = malloc(SUBGHZ_ENCODER_UPLOAD_MAX_SIZE * sizeof(LevelDuration));
|
||||
instance->start = true;
|
||||
instance->repeat = 10; //default number of repeat
|
||||
return instance;
|
||||
@@ -169,17 +169,19 @@ bool subghz_protocol_common_read_hex(string_t str, uint8_t* buff, uint16_t len)
|
||||
return parsed;
|
||||
}
|
||||
|
||||
bool subghz_protocol_common_to_save_file(SubGhzProtocolCommon* instance, FlipperFile* flipper_file) {
|
||||
bool subghz_protocol_common_to_save_file(
|
||||
SubGhzProtocolCommon* instance,
|
||||
FlipperFormat* flipper_format) {
|
||||
furi_assert(instance);
|
||||
furi_assert(flipper_file);
|
||||
furi_assert(flipper_format);
|
||||
bool res = false;
|
||||
do {
|
||||
if(!flipper_file_write_string_cstr(flipper_file, "Protocol", instance->name)) {
|
||||
if(!flipper_format_write_string_cstr(flipper_format, "Protocol", instance->name)) {
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Protocol");
|
||||
break;
|
||||
}
|
||||
uint32_t temp = instance->code_last_count_bit;
|
||||
if(!flipper_file_write_uint32(flipper_file, "Bit", &temp, 1)) {
|
||||
if(!flipper_format_write_uint32(flipper_format, "Bit", &temp, 1)) {
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Bit");
|
||||
break;
|
||||
}
|
||||
@@ -189,7 +191,7 @@ bool subghz_protocol_common_to_save_file(SubGhzProtocolCommon* instance, Flipper
|
||||
key_data[sizeof(uint64_t) - i - 1] = (instance->code_last_found >> i * 8) & 0xFF;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_hex(flipper_file, "Key", key_data, sizeof(uint64_t))) {
|
||||
if(!flipper_format_write_hex(flipper_format, "Key", key_data, sizeof(uint64_t))) {
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Key");
|
||||
break;
|
||||
}
|
||||
@@ -201,23 +203,23 @@ bool subghz_protocol_common_to_save_file(SubGhzProtocolCommon* instance, Flipper
|
||||
|
||||
bool subghz_protocol_common_to_load_protocol_from_file(
|
||||
SubGhzProtocolCommon* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
FlipperFormat* flipper_format) {
|
||||
furi_assert(instance);
|
||||
furi_assert(flipper_file);
|
||||
furi_assert(flipper_format);
|
||||
bool loaded = false;
|
||||
string_t temp_str;
|
||||
string_init(temp_str);
|
||||
uint32_t temp_data = 0;
|
||||
|
||||
do {
|
||||
if(!flipper_file_read_uint32(flipper_file, "Bit", (uint32_t*)&temp_data, 1)) {
|
||||
if(!flipper_format_read_uint32(flipper_format, "Bit", (uint32_t*)&temp_data, 1)) {
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Missing Bit");
|
||||
break;
|
||||
}
|
||||
instance->code_last_count_bit = (uint8_t)temp_data;
|
||||
|
||||
uint8_t key_data[sizeof(uint64_t)] = {0};
|
||||
if(!flipper_file_read_hex(flipper_file, "Key", key_data, sizeof(uint64_t))) {
|
||||
if(!flipper_format_read_hex(flipper_format, "Key", key_data, sizeof(uint64_t))) {
|
||||
FURI_LOG_E(SUBGHZ_PARSER_TAG, "Missing Key");
|
||||
break;
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@
|
||||
#include <m-string.h>
|
||||
#include <furi_hal.h>
|
||||
#include <stdint.h>
|
||||
#include <lib/flipper_file/flipper_file.h>
|
||||
#include <flipper_format/flipper_format.h>
|
||||
|
||||
#define bit_read(value, bit) (((value) >> (bit)) & 0x01)
|
||||
#define bit_set(value, bit) ((value) |= (1UL << (bit)))
|
||||
@@ -43,11 +43,11 @@ typedef void (*SubGhzProtocolCommonToStr)(SubGhzProtocolCommon* instance, string
|
||||
|
||||
//Get string to save
|
||||
typedef bool (
|
||||
*SubGhzProtocolCommonSaveFile)(SubGhzProtocolCommon* instance, FlipperFile* flipper_file);
|
||||
*SubGhzProtocolCommonSaveFile)(SubGhzProtocolCommon* instance, FlipperFormat* flipper_format);
|
||||
|
||||
//Load protocol from file
|
||||
typedef bool (*SubGhzProtocolCommonLoadFromFile)(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolCommon* instance,
|
||||
const char* file_path);
|
||||
//Load protocol
|
||||
@@ -208,17 +208,19 @@ bool subghz_protocol_common_read_hex(string_t str, uint8_t* buff, uint16_t len);
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolCommon instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_common_to_save_file(SubGhzProtocolCommon* instance, FlipperFile* flipper_file);
|
||||
bool subghz_protocol_common_to_save_file(
|
||||
SubGhzProtocolCommon* instance,
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolCommon instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_common_to_load_protocol_from_file(
|
||||
SubGhzProtocolCommon* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
@@ -12,7 +12,7 @@ typedef enum {
|
||||
} FaacSLHDecoderStep;
|
||||
|
||||
SubGhzProtocolFaacSLH* subghz_protocol_faac_slh_alloc(void) {
|
||||
SubGhzProtocolFaacSLH* instance = furi_alloc(sizeof(SubGhzProtocolFaacSLH));
|
||||
SubGhzProtocolFaacSLH* instance = malloc(sizeof(SubGhzProtocolFaacSLH));
|
||||
|
||||
instance->common.name = "Faac SLH";
|
||||
instance->common.code_min_count_bit_for_found = 64;
|
||||
@@ -186,4 +186,4 @@ void subghz_decoder_faac_slh_to_load_protocol(SubGhzProtocolFaacSLH* instance, v
|
||||
instance->common.code_last_found = data->code_found;
|
||||
instance->common.code_last_count_bit = data->code_count_bit;
|
||||
subghz_protocol_faac_slh_check_remote_controller(instance);
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ typedef enum {
|
||||
} GateTXDecoderStep;
|
||||
|
||||
SubGhzProtocolGateTX* subghz_protocol_gate_tx_alloc(void) {
|
||||
SubGhzProtocolGateTX* instance = furi_alloc(sizeof(SubGhzProtocolGateTX));
|
||||
SubGhzProtocolGateTX* instance = malloc(sizeof(SubGhzProtocolGateTX));
|
||||
|
||||
instance->common.name = "GateTX";
|
||||
instance->common.code_min_count_bit_for_found = 24;
|
||||
@@ -169,16 +169,16 @@ void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t out
|
||||
|
||||
bool subghz_protocol_gate_tx_to_save_file(
|
||||
SubGhzProtocolGateTX* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_gate_tx_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolGateTX* instance,
|
||||
const char* file_path) {
|
||||
if(subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file)) {
|
||||
(SubGhzProtocolCommon*)instance, flipper_format)) {
|
||||
subghz_protocol_gate_tx_check_remote_controller(instance);
|
||||
return true;
|
||||
}
|
||||
|
@@ -48,22 +48,22 @@ void subghz_protocol_gate_tx_to_str(SubGhzProtocolGateTX* instance, string_t out
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolGateTX instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_gate_tx_to_save_file(
|
||||
SubGhzProtocolGateTX* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolGateTX instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_gate_tx_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolGateTX* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -15,7 +15,7 @@ typedef enum {
|
||||
} HormannDecoderStep;
|
||||
|
||||
SubGhzProtocolHormann* subghz_protocol_hormann_alloc() {
|
||||
SubGhzProtocolHormann* instance = furi_alloc(sizeof(SubGhzProtocolHormann));
|
||||
SubGhzProtocolHormann* instance = malloc(sizeof(SubGhzProtocolHormann));
|
||||
|
||||
instance->common.name = "Hormann HSM";
|
||||
instance->common.code_min_count_bit_for_found = 44;
|
||||
@@ -188,16 +188,16 @@ void subghz_protocol_hormann_to_str(SubGhzProtocolHormann* instance, string_t ou
|
||||
|
||||
bool subghz_protocol_hormann_to_save_file(
|
||||
SubGhzProtocolHormann* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_hormann_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolHormann* instance,
|
||||
const char* file_path) {
|
||||
return subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
(SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
void subghz_decoder_hormann_to_load_protocol(SubGhzProtocolHormann* instance, void* context) {
|
||||
|
@@ -48,22 +48,22 @@ void subghz_protocol_hormann_to_str(SubGhzProtocolHormann* instance, string_t ou
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolHormann instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_hormann_to_save_file(
|
||||
SubGhzProtocolHormann* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolHormann instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_hormann_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolHormann* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -12,7 +12,7 @@ typedef enum {
|
||||
} IDoDecoderStep;
|
||||
|
||||
SubGhzProtocolIDo* subghz_protocol_ido_alloc(void) {
|
||||
SubGhzProtocolIDo* instance = furi_alloc(sizeof(SubGhzProtocolIDo));
|
||||
SubGhzProtocolIDo* instance = malloc(sizeof(SubGhzProtocolIDo));
|
||||
|
||||
instance->common.name = "iDo 117/111"; // PT4301-X";
|
||||
instance->common.code_min_count_bit_for_found = 48;
|
||||
@@ -186,4 +186,4 @@ void subghz_decoder_ido_to_load_protocol(SubGhzProtocolIDo* instance, void* cont
|
||||
instance->common.code_last_found = data->code_found;
|
||||
instance->common.code_last_count_bit = data->code_count_bit;
|
||||
subghz_protocol_ido_check_remote_controller(instance);
|
||||
}
|
||||
}
|
||||
|
@@ -21,7 +21,7 @@ typedef enum {
|
||||
} KeeloqDecoderStep;
|
||||
|
||||
SubGhzProtocolKeeloq* subghz_protocol_keeloq_alloc(SubGhzKeystore* keystore) {
|
||||
SubGhzProtocolKeeloq* instance = furi_alloc(sizeof(SubGhzProtocolKeeloq));
|
||||
SubGhzProtocolKeeloq* instance = malloc(sizeof(SubGhzProtocolKeeloq));
|
||||
|
||||
instance->keystore = keystore;
|
||||
|
||||
@@ -469,16 +469,18 @@ void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t outp
|
||||
instance->common.serial);
|
||||
}
|
||||
|
||||
bool subghz_protocol_keeloq_to_save_file(SubGhzProtocolKeeloq* instance, FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
bool subghz_protocol_keeloq_to_save_file(
|
||||
SubGhzProtocolKeeloq* instance,
|
||||
FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_keeloq_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolKeeloq* instance,
|
||||
const char* file_path) {
|
||||
return subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
(SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
void subghz_decoder_keeloq_to_load_protocol(SubGhzProtocolKeeloq* instance, void* context) {
|
||||
|
@@ -79,20 +79,22 @@ void subghz_protocol_keeloq_to_str(SubGhzProtocolKeeloq* instance, string_t outp
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolKeeloq instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_keeloq_to_save_file(SubGhzProtocolKeeloq* instance, FlipperFile* flipper_file);
|
||||
bool subghz_protocol_keeloq_to_save_file(
|
||||
SubGhzProtocolKeeloq* instance,
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolKeeloq instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_keeloq_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolKeeloq* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -12,7 +12,7 @@ typedef enum {
|
||||
} KIADecoderStep;
|
||||
|
||||
SubGhzProtocolKIA* subghz_protocol_kia_alloc(void) {
|
||||
SubGhzProtocolKIA* instance = furi_alloc(sizeof(SubGhzProtocolKIA));
|
||||
SubGhzProtocolKIA* instance = malloc(sizeof(SubGhzProtocolKIA));
|
||||
|
||||
instance->common.name = "KIA";
|
||||
instance->common.code_min_count_bit_for_found = 60;
|
||||
@@ -185,4 +185,4 @@ void subghz_decoder_kia_to_load_protocol(SubGhzProtocolKIA* instance, void* cont
|
||||
instance->common.code_last_found = data->code_found;
|
||||
instance->common.code_last_count_bit = data->code_count_bit;
|
||||
subghz_protocol_kia_check_remote_controller(instance);
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@ typedef enum {
|
||||
} NeroRadioDecoderStep;
|
||||
|
||||
SubGhzProtocolNeroRadio* subghz_protocol_nero_radio_alloc(void) {
|
||||
SubGhzProtocolNeroRadio* instance = furi_alloc(sizeof(SubGhzProtocolNeroRadio));
|
||||
SubGhzProtocolNeroRadio* instance = malloc(sizeof(SubGhzProtocolNeroRadio));
|
||||
|
||||
instance->common.name = "Nero Radio";
|
||||
instance->common.code_min_count_bit_for_found = 55;
|
||||
@@ -211,16 +211,16 @@ void subghz_protocol_nero_radio_to_str(SubGhzProtocolNeroRadio* instance, string
|
||||
|
||||
bool subghz_protocol_nero_radio_to_save_file(
|
||||
SubGhzProtocolNeroRadio* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_nero_radio_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolNeroRadio* instance,
|
||||
const char* file_path) {
|
||||
return subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
(SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
void subghz_decoder_nero_radio_to_load_protocol(SubGhzProtocolNeroRadio* instance, void* context) {
|
||||
@@ -229,4 +229,4 @@ void subghz_decoder_nero_radio_to_load_protocol(SubGhzProtocolNeroRadio* instanc
|
||||
SubGhzProtocolCommonLoad* data = context;
|
||||
instance->common.code_last_found = data->code_found;
|
||||
instance->common.code_last_count_bit = data->code_count_bit;
|
||||
}
|
||||
}
|
||||
|
@@ -57,22 +57,22 @@ void subghz_protocol_nero_radio_to_str(SubGhzProtocolNeroRadio* instance, string
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolNeroRadio instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_nero_radio_to_save_file(
|
||||
SubGhzProtocolNeroRadio* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolNeroRadio instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_nero_radio_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolNeroRadio* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -12,7 +12,7 @@ typedef enum {
|
||||
} NeroSketchDecoderStep;
|
||||
|
||||
SubGhzProtocolNeroSketch* subghz_protocol_nero_sketch_alloc(void) {
|
||||
SubGhzProtocolNeroSketch* instance = furi_alloc(sizeof(SubGhzProtocolNeroSketch));
|
||||
SubGhzProtocolNeroSketch* instance = malloc(sizeof(SubGhzProtocolNeroSketch));
|
||||
|
||||
instance->common.name = "Nero Sketch";
|
||||
instance->common.code_min_count_bit_for_found = 40;
|
||||
@@ -204,16 +204,16 @@ void subghz_protocol_nero_sketch_to_str(SubGhzProtocolNeroSketch* instance, stri
|
||||
|
||||
bool subghz_protocol_nero_sketch_to_save_file(
|
||||
SubGhzProtocolNeroSketch* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_nero_sketch_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolNeroSketch* instance,
|
||||
const char* file_path) {
|
||||
return subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
(SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
void subghz_decoder_nero_sketch_to_load_protocol(SubGhzProtocolNeroSketch* instance, void* context) {
|
||||
|
@@ -57,22 +57,22 @@ void subghz_protocol_nero_sketch_to_str(SubGhzProtocolNeroSketch* instance, stri
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolNeroSketch instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_nero_sketch_to_save_file(
|
||||
SubGhzProtocolNeroSketch* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolNeroSketch instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_nero_sketch_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolNeroSketch* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -18,7 +18,7 @@ typedef enum {
|
||||
} NiceFloDecoderStep;
|
||||
|
||||
SubGhzProtocolNiceFlo* subghz_protocol_nice_flo_alloc() {
|
||||
SubGhzProtocolNiceFlo* instance = furi_alloc(sizeof(SubGhzProtocolNiceFlo));
|
||||
SubGhzProtocolNiceFlo* instance = malloc(sizeof(SubGhzProtocolNiceFlo));
|
||||
|
||||
instance->common.name = "Nice FLO";
|
||||
instance->common.code_min_count_bit_for_found = 12;
|
||||
@@ -166,16 +166,16 @@ void subghz_protocol_nice_flo_to_str(SubGhzProtocolNiceFlo* instance, string_t o
|
||||
|
||||
bool subghz_protocol_nice_flo_to_save_file(
|
||||
SubGhzProtocolNiceFlo* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
FlipperFormat* flipper_format) {
|
||||
return subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
bool subghz_protocol_nice_flo_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolNiceFlo* instance,
|
||||
const char* file_path) {
|
||||
return subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
(SubGhzProtocolCommon*)instance, flipper_format);
|
||||
}
|
||||
|
||||
void subghz_decoder_nice_flo_to_load_protocol(SubGhzProtocolNiceFlo* instance, void* context) {
|
||||
|
@@ -48,22 +48,22 @@ void subghz_protocol_nice_flo_to_str(SubGhzProtocolNiceFlo* instance, string_t o
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzProtocolNiceFlo instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_nice_flo_to_save_file(
|
||||
SubGhzProtocolNiceFlo* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzProtocolNiceFlo instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_protocol_nice_flo_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolNiceFlo* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -25,7 +25,7 @@ typedef enum {
|
||||
} NiceFlorSDecoderStep;
|
||||
|
||||
SubGhzProtocolNiceFlorS* subghz_protocol_nice_flor_s_alloc() {
|
||||
SubGhzProtocolNiceFlorS* instance = furi_alloc(sizeof(SubGhzProtocolNiceFlorS));
|
||||
SubGhzProtocolNiceFlorS* instance = malloc(sizeof(SubGhzProtocolNiceFlorS));
|
||||
|
||||
instance->common.name = "Nice FloR-S";
|
||||
instance->common.code_min_count_bit_for_found = 52;
|
||||
@@ -261,4 +261,4 @@ void subghz_decoder_nice_flor_s_to_load_protocol(SubGhzProtocolNiceFlorS* instan
|
||||
instance->common.code_last_found = data->code_found;
|
||||
instance->common.code_last_count_bit = data->code_count_bit;
|
||||
subghz_nice_flor_s_decoder_decrypt(instance);
|
||||
}
|
||||
}
|
||||
|
@@ -35,7 +35,7 @@ typedef enum {
|
||||
} PrincetonDecoderStep;
|
||||
|
||||
SubGhzEncoderPrinceton* subghz_encoder_princeton_alloc() {
|
||||
SubGhzEncoderPrinceton* instance = furi_alloc(sizeof(SubGhzEncoderPrinceton));
|
||||
SubGhzEncoderPrinceton* instance = malloc(sizeof(SubGhzEncoderPrinceton));
|
||||
return instance;
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ LevelDuration subghz_encoder_princeton_yield(void* context) {
|
||||
}
|
||||
|
||||
SubGhzDecoderPrinceton* subghz_decoder_princeton_alloc(void) {
|
||||
SubGhzDecoderPrinceton* instance = furi_alloc(sizeof(SubGhzDecoderPrinceton));
|
||||
SubGhzDecoderPrinceton* instance = malloc(sizeof(SubGhzDecoderPrinceton));
|
||||
|
||||
instance->te = SUBGHZ_PT_SHORT;
|
||||
instance->common.name = "Princeton";
|
||||
@@ -333,23 +333,24 @@ void subghz_decoder_princeton_to_str(SubGhzDecoderPrinceton* instance, string_t
|
||||
|
||||
bool subghz_decoder_princeton_to_save_file(
|
||||
SubGhzDecoderPrinceton* instance,
|
||||
FlipperFile* flipper_file) {
|
||||
bool res = subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_file);
|
||||
FlipperFormat* flipper_format) {
|
||||
bool res =
|
||||
subghz_protocol_common_to_save_file((SubGhzProtocolCommon*)instance, flipper_format);
|
||||
if(res) {
|
||||
res = flipper_file_write_uint32(flipper_file, "TE", &instance->te, 1);
|
||||
res = flipper_format_write_uint32(flipper_format, "TE", &instance->te, 1);
|
||||
if(!res) FURI_LOG_E(SUBGHZ_PARSER_TAG, "Unable to add Te");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
bool subghz_decoder_princeton_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzDecoderPrinceton* instance,
|
||||
const char* file_path) {
|
||||
bool loaded = subghz_protocol_common_to_load_protocol_from_file(
|
||||
(SubGhzProtocolCommon*)instance, flipper_file);
|
||||
(SubGhzProtocolCommon*)instance, flipper_format);
|
||||
if(loaded) {
|
||||
loaded = flipper_file_read_uint32(flipper_file, "TE", (uint32_t*)&instance->te, 1);
|
||||
loaded = flipper_format_read_uint32(flipper_format, "TE", (uint32_t*)&instance->te, 1);
|
||||
if(!loaded) FURI_LOG_E(SUBGHZ_PARSER_TAG, "Missing TE");
|
||||
}
|
||||
return loaded;
|
||||
|
@@ -110,22 +110,22 @@ void subghz_decoder_princeton_to_str(SubGhzDecoderPrinceton* instance, string_t
|
||||
/** Adding data to a file
|
||||
*
|
||||
* @param instance - SubGhzDecoderPrinceton instance
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_decoder_princeton_to_save_file(
|
||||
SubGhzDecoderPrinceton* instance,
|
||||
FlipperFile* flipper_file);
|
||||
FlipperFormat* flipper_format);
|
||||
|
||||
/** Loading protocol from file
|
||||
*
|
||||
* @param flipper_file - FlipperFile
|
||||
* @param flipper_format - FlipperFormat
|
||||
* @param instance - SubGhzDecoderPrinceton instance
|
||||
* @param file_path - file path
|
||||
* @return bool
|
||||
*/
|
||||
bool subghz_decoder_princeton_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzDecoderPrinceton* instance,
|
||||
const char* file_path);
|
||||
|
||||
|
@@ -11,7 +11,7 @@ struct SubGhzProtocolRAW {
|
||||
int32_t* upload_raw;
|
||||
uint16_t ind_write;
|
||||
Storage* storage;
|
||||
FlipperFile* flipper_file;
|
||||
FlipperFormat* flipper_format;
|
||||
SubGhzFileEncoderWorker* file_worker_encoder;
|
||||
uint32_t file_is_open;
|
||||
string_t file_name;
|
||||
@@ -28,7 +28,7 @@ typedef enum {
|
||||
} RAWFilIsOpen;
|
||||
|
||||
SubGhzProtocolRAW* subghz_protocol_raw_alloc(void) {
|
||||
SubGhzProtocolRAW* instance = furi_alloc(sizeof(SubGhzProtocolRAW));
|
||||
SubGhzProtocolRAW* instance = malloc(sizeof(SubGhzProtocolRAW));
|
||||
|
||||
instance->upload_raw = NULL;
|
||||
instance->ind_write = 0;
|
||||
@@ -36,7 +36,7 @@ SubGhzProtocolRAW* subghz_protocol_raw_alloc(void) {
|
||||
instance->last_level = false;
|
||||
|
||||
instance->storage = furi_record_open("storage");
|
||||
instance->flipper_file = flipper_file_alloc(instance->storage);
|
||||
instance->flipper_format = flipper_format_file_alloc(instance->storage);
|
||||
instance->file_is_open = RAWFileIsOpenClose;
|
||||
string_init(instance->file_name);
|
||||
|
||||
@@ -61,7 +61,7 @@ void subghz_protocol_raw_free(SubGhzProtocolRAW* instance) {
|
||||
furi_assert(instance);
|
||||
string_clear(instance->file_name);
|
||||
|
||||
flipper_file_free(instance->flipper_file);
|
||||
flipper_format_free(instance->flipper_format);
|
||||
furi_record_close("storage");
|
||||
|
||||
free(instance);
|
||||
@@ -166,7 +166,7 @@ bool subghz_protocol_raw_save_to_file_init(
|
||||
const char* preset) {
|
||||
furi_assert(instance);
|
||||
|
||||
//instance->flipper_file = flipper_file_alloc(instance->storage);
|
||||
//instance->flipper_format = flipper_format_file_alloc(instance->storage);
|
||||
string_t dev_file_name;
|
||||
string_init(dev_file_name);
|
||||
bool init = false;
|
||||
@@ -186,34 +186,35 @@ bool subghz_protocol_raw_save_to_file_init(
|
||||
}
|
||||
|
||||
// Open file
|
||||
if(!flipper_file_open_always(instance->flipper_file, string_get_cstr(dev_file_name))) {
|
||||
if(!flipper_format_file_open_always(
|
||||
instance->flipper_format, string_get_cstr(dev_file_name))) {
|
||||
FURI_LOG_E(TAG, "Unable to open file for write: %s", dev_file_name);
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_header_cstr(
|
||||
instance->flipper_file, SUBGHZ_RAW_FILE_TYPE, SUBGHZ_RAW_FILE_VERSION)) {
|
||||
if(!flipper_format_write_header_cstr(
|
||||
instance->flipper_format, SUBGHZ_RAW_FILE_TYPE, SUBGHZ_RAW_FILE_VERSION)) {
|
||||
FURI_LOG_E(TAG, "Unable to add header");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_uint32(instance->flipper_file, "Frequency", &frequency, 1)) {
|
||||
if(!flipper_format_write_uint32(instance->flipper_format, "Frequency", &frequency, 1)) {
|
||||
FURI_LOG_E(TAG, "Unable to add Frequency");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_string_cstr(instance->flipper_file, "Preset", preset)) {
|
||||
if(!flipper_format_write_string_cstr(instance->flipper_format, "Preset", preset)) {
|
||||
FURI_LOG_E(TAG, "Unable to add Preset");
|
||||
break;
|
||||
}
|
||||
|
||||
if(!flipper_file_write_string_cstr(
|
||||
instance->flipper_file, "Protocol", instance->common.name)) {
|
||||
if(!flipper_format_write_string_cstr(
|
||||
instance->flipper_format, "Protocol", instance->common.name)) {
|
||||
FURI_LOG_E(TAG, "Unable to add Protocol");
|
||||
break;
|
||||
}
|
||||
|
||||
instance->upload_raw = furi_alloc(SUBGHZ_DOWNLOAD_MAX_SIZE * sizeof(int32_t));
|
||||
instance->upload_raw = malloc(SUBGHZ_DOWNLOAD_MAX_SIZE * sizeof(int32_t));
|
||||
instance->file_is_open = RAWFileIsOpenWrite;
|
||||
instance->sample_write = 0;
|
||||
init = true;
|
||||
@@ -234,7 +235,7 @@ void subghz_protocol_raw_save_to_file_stop(SubGhzProtocolRAW* instance) {
|
||||
instance->upload_raw = NULL;
|
||||
}
|
||||
|
||||
flipper_file_close(instance->flipper_file);
|
||||
flipper_format_file_close(instance->flipper_format);
|
||||
instance->file_is_open = RAWFileIsOpenClose;
|
||||
}
|
||||
|
||||
@@ -243,8 +244,8 @@ bool subghz_protocol_raw_save_to_file_write(SubGhzProtocolRAW* instance) {
|
||||
|
||||
bool is_write = false;
|
||||
if(instance->file_is_open == RAWFileIsOpenWrite) {
|
||||
if(!flipper_file_write_int32(
|
||||
instance->flipper_file, "RAW_Data", instance->upload_raw, instance->ind_write)) {
|
||||
if(!flipper_format_write_int32(
|
||||
instance->flipper_format, "RAW_Data", instance->upload_raw, instance->ind_write)) {
|
||||
FURI_LOG_E(TAG, "Unable to add RAW_Data");
|
||||
} else {
|
||||
instance->sample_write += instance->ind_write;
|
||||
@@ -260,10 +261,10 @@ size_t subghz_protocol_raw_get_sample_write(SubGhzProtocolRAW* instance) {
|
||||
}
|
||||
|
||||
bool subghz_protocol_raw_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolRAW* instance,
|
||||
const char* file_path) {
|
||||
furi_assert(file_path);
|
||||
subghz_protocol_raw_set_last_file_name(instance, file_path);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -66,6 +66,6 @@ bool subghz_protocol_raw_save_to_file_write(SubGhzProtocolRAW* instance);
|
||||
size_t subghz_protocol_raw_get_sample_write(SubGhzProtocolRAW* instance);
|
||||
|
||||
bool subghz_protocol_raw_to_load_protocol_from_file(
|
||||
FlipperFile* flipper_file,
|
||||
FlipperFormat* flipper_format,
|
||||
SubGhzProtocolRAW* instance,
|
||||
const char* file_path);
|
@@ -18,7 +18,7 @@ typedef enum {
|
||||
} ScherKhanDecoderStep;
|
||||
|
||||
SubGhzProtocolScherKhan* subghz_protocol_scher_khan_alloc(void) {
|
||||
SubGhzProtocolScherKhan* instance = furi_alloc(sizeof(SubGhzProtocolScherKhan));
|
||||
SubGhzProtocolScherKhan* instance = malloc(sizeof(SubGhzProtocolScherKhan));
|
||||
|
||||
instance->common.name = "Scher-Khan";
|
||||
instance->common.code_min_count_bit_for_found = 35;
|
||||
@@ -241,4 +241,4 @@ void subghz_decoder_scher_khan_to_load_protocol(SubGhzProtocolScherKhan* instanc
|
||||
instance->common.code_last_found = data->code_found;
|
||||
instance->common.code_last_count_bit = data->code_count_bit;
|
||||
subghz_protocol_scher_khan_check_remote_controller(instance);
|
||||
}
|
||||
}
|
||||
|
@@ -19,7 +19,7 @@ typedef enum {
|
||||
} SomfyKeytisDecoderStep;
|
||||
|
||||
SubGhzProtocolSomfyKeytis* subghz_protocol_somfy_keytis_alloc() {
|
||||
SubGhzProtocolSomfyKeytis* instance = furi_alloc(sizeof(SubGhzProtocolSomfyKeytis));
|
||||
SubGhzProtocolSomfyKeytis* instance = malloc(sizeof(SubGhzProtocolSomfyKeytis));
|
||||
|
||||
instance->common.name = "Somfy Keytis";
|
||||
instance->common.code_min_count_bit_for_found = 80;
|
||||
|
@@ -18,7 +18,7 @@ typedef enum {
|
||||
} SomfyTelisDecoderStep;
|
||||
|
||||
SubGhzProtocolSomfyTelis* subghz_protocol_somfy_telis_alloc() {
|
||||
SubGhzProtocolSomfyTelis* instance = furi_alloc(sizeof(SubGhzProtocolSomfyTelis));
|
||||
SubGhzProtocolSomfyTelis* instance = malloc(sizeof(SubGhzProtocolSomfyTelis));
|
||||
|
||||
instance->common.name = "Somfy Telis";
|
||||
instance->common.code_min_count_bit_for_found = 56;
|
||||
|
@@ -22,7 +22,7 @@ typedef enum {
|
||||
} StarLineDecoderStep;
|
||||
|
||||
SubGhzProtocolStarLine* subghz_protocol_star_line_alloc(SubGhzKeystore* keystore) {
|
||||
SubGhzProtocolStarLine* instance = furi_alloc(sizeof(SubGhzProtocolStarLine));
|
||||
SubGhzProtocolStarLine* instance = malloc(sizeof(SubGhzProtocolStarLine));
|
||||
|
||||
instance->keystore = keystore;
|
||||
|
||||
@@ -338,4 +338,4 @@ void subghz_decoder_star_line_to_load_protocol(SubGhzProtocolStarLine* instance,
|
||||
instance->common.code_last_found = data->code_found;
|
||||
instance->common.code_last_count_bit = data->code_count_bit;
|
||||
subghz_protocol_star_line_check_remote_controller(instance);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user