2021-10-25 17:37:14 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "subghz_protocol_common.h"
|
|
|
|
|
2021-11-24 16:59:45 +03:00
|
|
|
typedef void (*SubGhzProtocolRAWCallbackEnd)(void* context);
|
|
|
|
|
2021-10-25 17:37:14 +03:00
|
|
|
typedef struct SubGhzProtocolRAW SubGhzProtocolRAW;
|
|
|
|
|
|
|
|
/** Allocate SubGhzProtocolRAW
|
|
|
|
*
|
|
|
|
* @return SubGhzProtocolRAW*
|
|
|
|
*/
|
|
|
|
SubGhzProtocolRAW* subghz_protocol_raw_alloc();
|
|
|
|
|
|
|
|
/** Free SubGhzProtocolRAW
|
|
|
|
*
|
|
|
|
* @param instance
|
|
|
|
*/
|
|
|
|
void subghz_protocol_raw_free(SubGhzProtocolRAW* instance);
|
|
|
|
|
2021-11-24 16:59:45 +03:00
|
|
|
void subghz_protocol_raw_file_encoder_worker_set_callback_end(
|
|
|
|
SubGhzProtocolRAW* instance,
|
|
|
|
SubGhzProtocolRAWCallbackEnd callback_end,
|
|
|
|
void* context_end);
|
|
|
|
|
2021-10-25 17:37:14 +03:00
|
|
|
/** Reset internal state
|
|
|
|
* @param instance - SubGhzProtocolRAW instance
|
|
|
|
*/
|
|
|
|
void subghz_protocol_raw_reset(SubGhzProtocolRAW* instance);
|
|
|
|
|
|
|
|
/** Get upload protocol
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocolRAW instance
|
|
|
|
* @param encoder - SubGhzProtocolCommonEncoder encoder
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
bool subghz_protocol_raw_send_key(
|
|
|
|
SubGhzProtocolRAW* instance,
|
|
|
|
SubGhzProtocolCommonEncoder* encoder);
|
|
|
|
|
|
|
|
/** Parse accepted duration
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocolRAW instance
|
|
|
|
* @param data - LevelDuration level_duration
|
|
|
|
*/
|
|
|
|
void subghz_protocol_raw_parse(SubGhzProtocolRAW* instance, bool level, uint32_t duration);
|
|
|
|
|
|
|
|
/** Outputting information from the parser
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocolRAW* instance
|
|
|
|
* @param output - output string
|
|
|
|
*/
|
|
|
|
void subghz_protocol_raw_to_str(SubGhzProtocolRAW* instance, string_t output);
|
|
|
|
|
2021-11-11 15:49:19 +03:00
|
|
|
const char* subghz_protocol_raw_get_last_file_name(SubGhzProtocolRAW* instance);
|
2021-10-25 17:37:14 +03:00
|
|
|
|
2021-11-11 15:49:19 +03:00
|
|
|
void subghz_protocol_raw_set_last_file_name(SubGhzProtocolRAW* instance, const char* name);
|
2021-10-25 17:37:14 +03:00
|
|
|
|
2021-10-27 20:37:11 +03:00
|
|
|
bool subghz_protocol_raw_save_to_file_init(
|
2021-10-25 17:37:14 +03:00
|
|
|
SubGhzProtocolRAW* instance,
|
|
|
|
const char* dev_name,
|
|
|
|
uint32_t frequency,
|
2021-11-11 15:49:19 +03:00
|
|
|
const char* preset);
|
2021-10-27 20:37:11 +03:00
|
|
|
void subghz_protocol_raw_save_to_file_stop(SubGhzProtocolRAW* instance);
|
|
|
|
bool subghz_protocol_raw_save_to_file_write(SubGhzProtocolRAW* instance);
|
|
|
|
size_t subghz_protocol_raw_get_sample_write(SubGhzProtocolRAW* instance);
|
2021-10-25 17:37:14 +03:00
|
|
|
|
|
|
|
bool subghz_protocol_raw_to_load_protocol_from_file(
|
2022-02-18 22:53:46 +03:00
|
|
|
FlipperFormat* flipper_format,
|
2021-10-25 17:37:14 +03:00
|
|
|
SubGhzProtocolRAW* instance,
|
|
|
|
const char* file_path);
|