2021-09-15 18:24:19 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "protocols/subghz_protocol_common.h"
|
|
|
|
|
|
|
|
typedef void (*SubGhzProtocolTextCallback)(string_t text, void* context);
|
2021-10-25 17:37:14 +03:00
|
|
|
typedef void (*SubGhzProtocolCommonCallbackDump)(SubGhzProtocolCommon* parser, void* context);
|
2021-09-15 18:24:19 +03:00
|
|
|
|
|
|
|
typedef struct SubGhzParser SubGhzParser;
|
|
|
|
|
|
|
|
/** Allocate SubGhzParser
|
|
|
|
*
|
|
|
|
* @return SubGhzParser*
|
|
|
|
*/
|
|
|
|
SubGhzParser* subghz_parser_alloc();
|
|
|
|
|
|
|
|
/** Free SubGhzParser
|
|
|
|
*
|
|
|
|
* @param instance
|
|
|
|
*/
|
|
|
|
void subghz_parser_free(SubGhzParser* instance);
|
|
|
|
|
|
|
|
/** Get protocol by name
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
* @param name - name protocol
|
|
|
|
* @param SubGhzProtocolCommon
|
|
|
|
*/
|
|
|
|
SubGhzProtocolCommon* subghz_parser_get_by_name(SubGhzParser* instance, const char* name);
|
|
|
|
|
|
|
|
/** Outputting data text from all parsers
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
* @param callback - SubGhzProtocolTextCallback callback
|
|
|
|
* @param context
|
|
|
|
*/
|
2021-10-25 17:37:14 +03:00
|
|
|
void subghz_parser_enable_dump_text(
|
|
|
|
SubGhzParser* instance,
|
|
|
|
SubGhzProtocolTextCallback callback,
|
|
|
|
void* context);
|
2021-09-15 18:24:19 +03:00
|
|
|
|
|
|
|
/** Outputting data SubGhzParser from all parsers
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
* @param callback - SubGhzProtocolTextCallback callback
|
|
|
|
* @param context
|
|
|
|
*/
|
2021-10-25 17:37:14 +03:00
|
|
|
void subghz_parser_enable_dump(
|
|
|
|
SubGhzParser* instance,
|
|
|
|
SubGhzProtocolCommonCallbackDump callback,
|
|
|
|
void* context);
|
2021-09-15 18:24:19 +03:00
|
|
|
|
|
|
|
/** File name rainbow table Nice Flor-S
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
* @param file_name - "path/file_name"
|
|
|
|
*/
|
|
|
|
void subghz_parser_load_nice_flor_s_file(SubGhzParser* instance, const char* file_name);
|
|
|
|
|
2021-10-25 17:37:14 +03:00
|
|
|
/** File name rainbow table Came Atomo
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
* @param file_name - "path/file_name"
|
|
|
|
*/
|
|
|
|
void subghz_parser_load_came_atomo_file(SubGhzParser* instance, const char* file_name);
|
|
|
|
|
2021-09-15 18:24:19 +03:00
|
|
|
/** File upload manufacture keys
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
* @param file_name - "path/file_name"
|
2021-12-22 16:01:20 +03:00
|
|
|
* @return bool
|
2021-09-15 18:24:19 +03:00
|
|
|
*/
|
2021-12-22 16:01:20 +03:00
|
|
|
bool subghz_parser_load_keeloq_file(SubGhzParser* instance, const char* file_name);
|
2021-09-15 18:24:19 +03:00
|
|
|
|
|
|
|
/** Restarting all parsers
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
*/
|
|
|
|
void subghz_parser_reset(SubGhzParser* instance);
|
|
|
|
|
2021-10-25 17:37:14 +03:00
|
|
|
void subghz_parser_raw_parse(SubGhzParser* instance, bool level, uint32_t duration);
|
|
|
|
|
2021-09-15 18:24:19 +03:00
|
|
|
/** Loading data into all parsers
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzParser instance
|
|
|
|
* @param level - true is high, false if low
|
|
|
|
* @param duration - level duration in microseconds
|
|
|
|
*/
|
|
|
|
void subghz_parser_parse(SubGhzParser* instance, bool level, uint32_t duration);
|