2022-03-03 09:48:56 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "base.h"
|
|
|
|
|
|
|
|
/** SubGhzDecoderPrinceton anonymous type */
|
|
|
|
typedef struct SubGhzDecoderPrinceton SubGhzDecoderPrinceton;
|
|
|
|
/** SubGhzEncoderPrinceton anonymous type */
|
|
|
|
typedef struct SubGhzEncoderPrinceton SubGhzEncoderPrinceton;
|
|
|
|
|
|
|
|
typedef void (*SubGhzDecoderPrincetonCallback)(SubGhzDecoderPrinceton* parser, void* context);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Allocate SubGhzEncoderPrinceton
|
2022-03-03 09:48:56 +00:00
|
|
|
* @return pointer to SubGhzEncoderPrinceton instance
|
|
|
|
*/
|
|
|
|
SubGhzEncoderPrinceton* subghz_encoder_princeton_for_testing_alloc();
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Free SubGhzEncoderPrinceton instance
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance - SubGhzEncoderPrinceton instance
|
|
|
|
*/
|
|
|
|
void subghz_encoder_princeton_for_testing_free(SubGhzEncoderPrinceton* instance);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Forced transmission stop.
|
|
|
|
* @param instance Pointer to a SubGhzEncoderPrinceton instance
|
|
|
|
* @param time_stop Transmission stop time, ms
|
|
|
|
*/
|
2022-03-03 09:48:56 +00:00
|
|
|
void subghz_encoder_princeton_for_testing_stop(
|
|
|
|
SubGhzEncoderPrinceton* instance,
|
|
|
|
uint32_t time_stop);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Set new encoder params
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance - SubGhzEncoderPrinceton instance
|
|
|
|
* @param key - 24bit key
|
|
|
|
* @param repeat - how many times to repeat
|
|
|
|
* @param frequency - frequency
|
|
|
|
*/
|
|
|
|
void subghz_encoder_princeton_for_testing_set(
|
|
|
|
SubGhzEncoderPrinceton* instance,
|
|
|
|
uint32_t key,
|
|
|
|
size_t repeat,
|
|
|
|
uint32_t frequency);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Get repeat count left
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance - SubGhzEncoderPrinceton instance
|
|
|
|
* @return repeat count left
|
|
|
|
*/
|
|
|
|
size_t subghz_encoder_princeton_for_testing_get_repeat_left(SubGhzEncoderPrinceton* instance);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Print encoder log
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance - SubGhzEncoderPrinceton instance
|
|
|
|
*/
|
|
|
|
void subghz_encoder_princeton_for_testing_print_log(void* context);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Get level duration
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance - SubGhzEncoderPrinceton instance
|
|
|
|
* @return level duration
|
|
|
|
*/
|
|
|
|
LevelDuration subghz_encoder_princeton_for_testing_yield(void* context);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Allocate SubGhzDecoderPrinceton
|
2022-03-03 09:48:56 +00:00
|
|
|
* @return SubGhzDecoderPrinceton*
|
|
|
|
*/
|
|
|
|
SubGhzDecoderPrinceton* subghz_decoder_princeton_for_testing_alloc();
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Free SubGhzDecoderPrinceton
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance
|
|
|
|
*/
|
|
|
|
void subghz_decoder_princeton_for_testing_free(SubGhzDecoderPrinceton* instance);
|
|
|
|
|
|
|
|
void subghz_decoder_princeton_for_testing_set_callback(
|
|
|
|
SubGhzDecoderPrinceton* instance,
|
|
|
|
SubGhzDecoderPrincetonCallback callback,
|
|
|
|
void* context);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Reset internal state
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance - SubGhzDecoderPrinceton instance
|
|
|
|
*/
|
|
|
|
void subghz_decoder_princeton_for_testing_reset(SubGhzDecoderPrinceton* instance);
|
|
|
|
|
2022-03-16 09:18:48 +00:00
|
|
|
/**
|
|
|
|
* Parse accepted duration
|
2022-03-03 09:48:56 +00:00
|
|
|
* @param instance - SubGhzDecoderPrinceton instance
|
|
|
|
* @param data - LevelDuration level_duration
|
|
|
|
*/
|
|
|
|
void subghz_decoder_princeton_for_testing_parse(
|
|
|
|
SubGhzDecoderPrinceton* instance,
|
|
|
|
bool level,
|
|
|
|
uint32_t duration);
|