SubGhz: fix holtek protocol (#1217)
* SubGhz: fix holtek protocol * SubGhz: fix Princeton false positive on GateTx receive Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
7f8d82bd98
commit
a5bb417fd7
@ -13,7 +13,7 @@
|
|||||||
#define CAME_ATOMO_DIR_NAME "/ext/subghz/assets/came_atomo"
|
#define CAME_ATOMO_DIR_NAME "/ext/subghz/assets/came_atomo"
|
||||||
#define NICE_FLOR_S_DIR_NAME "/ext/subghz/assets/nice_flor_s"
|
#define NICE_FLOR_S_DIR_NAME "/ext/subghz/assets/nice_flor_s"
|
||||||
#define TEST_RANDOM_DIR_NAME "/ext/unit_tests/subghz/test_random_raw.sub"
|
#define TEST_RANDOM_DIR_NAME "/ext/unit_tests/subghz/test_random_raw.sub"
|
||||||
#define TEST_RANDOM_COUNT_PARSE 116
|
#define TEST_RANDOM_COUNT_PARSE 113
|
||||||
#define TEST_TIMEOUT 10000
|
#define TEST_TIMEOUT 10000
|
||||||
|
|
||||||
static SubGhzEnvironment* environment_handler;
|
static SubGhzEnvironment* environment_handler;
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
#define HOLTEK_HEADER 0x5000000000
|
#define HOLTEK_HEADER 0x5000000000
|
||||||
|
|
||||||
static const SubGhzBlockConst subghz_protocol_holtek_const = {
|
static const SubGhzBlockConst subghz_protocol_holtek_const = {
|
||||||
.te_short = 500,
|
.te_short = 430,
|
||||||
.te_long = 1000,
|
.te_long = 870,
|
||||||
.te_delta = 100,
|
.te_delta = 100,
|
||||||
.min_count_bit_for_found = 40,
|
.min_count_bit_for_found = 40,
|
||||||
};
|
};
|
||||||
@ -347,8 +347,8 @@ void subghz_protocol_decoder_holtek_get_string(void* context, string_t output) {
|
|||||||
"Sn:0x%05lX BTN:%X ",
|
"Sn:0x%05lX BTN:%X ",
|
||||||
instance->generic.protocol_name,
|
instance->generic.protocol_name,
|
||||||
instance->generic.data_count_bit,
|
instance->generic.data_count_bit,
|
||||||
(uint32_t)((instance->generic.data >> 32) & 0xFFFFFF),
|
(uint32_t)((instance->generic.data >> 32) & 0xFFFFFFFF),
|
||||||
(uint32_t)(instance->generic.data & 0xFFFFFF),
|
(uint32_t)(instance->generic.data & 0xFFFFFFFF),
|
||||||
instance->generic.serial,
|
instance->generic.serial,
|
||||||
instance->generic.btn >> 4);
|
instance->generic.btn >> 4);
|
||||||
|
|
||||||
|
@ -245,7 +245,8 @@ void subghz_protocol_decoder_princeton_feed(void* context, bool level, uint32_t
|
|||||||
instance->decoder.parser_step = PrincetonDecoderStepSaveDuration;
|
instance->decoder.parser_step = PrincetonDecoderStepSaveDuration;
|
||||||
if(instance->decoder.decode_count_bit ==
|
if(instance->decoder.decode_count_bit ==
|
||||||
subghz_protocol_princeton_const.min_count_bit_for_found) {
|
subghz_protocol_princeton_const.min_count_bit_for_found) {
|
||||||
if(instance->last_data == instance->decoder.decode_data) {
|
if((instance->last_data == instance->decoder.decode_data) &&
|
||||||
|
instance->last_data) {
|
||||||
instance->te /= (instance->decoder.decode_count_bit * 4 + 1);
|
instance->te /= (instance->decoder.decode_count_bit * 4 + 1);
|
||||||
|
|
||||||
instance->generic.data = instance->decoder.decode_data;
|
instance->generic.data = instance->decoder.decode_data;
|
||||||
|
Loading…
Reference in New Issue
Block a user