2021-06-29 21:19:20 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "subghz_protocol_common.h"
|
|
|
|
|
|
|
|
typedef void (*SubGhzProtocolTextCallback)(string_t text, void* context);
|
2021-07-07 19:49:45 +00:00
|
|
|
typedef void (*SubGhzProtocolCommonCallbackDump)(SubGhzProtocolCommon *parser, void* context);
|
2021-06-29 21:19:20 +00:00
|
|
|
|
|
|
|
typedef struct SubGhzProtocol SubGhzProtocol;
|
|
|
|
|
2021-07-02 13:25:49 +00:00
|
|
|
/** Allocate SubGhzProtocol
|
|
|
|
*
|
|
|
|
* @return SubGhzProtocol*
|
|
|
|
*/
|
2021-06-29 21:19:20 +00:00
|
|
|
SubGhzProtocol* subghz_protocol_alloc();
|
|
|
|
|
2021-07-02 13:25:49 +00:00
|
|
|
/** Free SubGhzProtocol
|
|
|
|
*
|
|
|
|
* @param instance
|
|
|
|
*/
|
2021-06-29 21:19:20 +00:00
|
|
|
void subghz_protocol_free(SubGhzProtocol* instance);
|
|
|
|
|
2021-07-07 19:49:45 +00:00
|
|
|
/** Outputting data text from all parsers
|
2021-07-02 13:25:49 +00:00
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocol instance
|
|
|
|
* @param callback - SubGhzProtocolTextCallback callback
|
|
|
|
* @param context
|
|
|
|
*/
|
2021-07-18 18:09:00 +00:00
|
|
|
void subghz_protocol_enable_dump_text(SubGhzProtocol* instance, SubGhzProtocolTextCallback callback, void* context);
|
2021-07-07 19:49:45 +00:00
|
|
|
|
|
|
|
/** Outputting data SubGhzProtocol from all parsers
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocol instance
|
|
|
|
* @param callback - SubGhzProtocolTextCallback callback
|
|
|
|
* @param context
|
|
|
|
*/
|
|
|
|
void subghz_protocol_enable_dump( SubGhzProtocol* instance, SubGhzProtocolCommonCallbackDump callback, void* context);
|
2021-07-02 13:25:49 +00:00
|
|
|
|
|
|
|
/** File name rainbow table Nice Flor-S
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocol instance
|
|
|
|
* @param file_name - "path/file_name"
|
|
|
|
*/
|
|
|
|
void subghz_protocol_load_nice_flor_s_file(SubGhzProtocol* instance, const char* file_name);
|
|
|
|
|
|
|
|
/** File upload manufacture keys
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocol instance
|
|
|
|
* @param file_name - "path/file_name"
|
|
|
|
*/
|
2021-06-29 21:19:20 +00:00
|
|
|
void subghz_protocol_load_keeloq_file(SubGhzProtocol* instance, const char* file_name);
|
|
|
|
|
2021-07-02 13:25:49 +00:00
|
|
|
/** Restarting all parsers
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocol instance
|
|
|
|
*/
|
2021-06-29 21:19:20 +00:00
|
|
|
void subghz_protocol_reset(SubGhzProtocol* instance);
|
|
|
|
|
2021-07-02 13:25:49 +00:00
|
|
|
/** Loading data into all parsers
|
|
|
|
*
|
|
|
|
* @param instance - SubGhzProtocol instance
|
2021-07-07 19:49:45 +00:00
|
|
|
* @param level - true is high, false if low
|
|
|
|
* @param duration - level duration in microseconds
|
2021-07-02 13:25:49 +00:00
|
|
|
*/
|
2021-07-07 19:49:45 +00:00
|
|
|
void subghz_protocol_parse(SubGhzProtocol* instance, bool level, uint32_t duration);
|