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 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_COUNT_PARSE 116 | ||||
| #define TEST_RANDOM_COUNT_PARSE 113 | ||||
| #define TEST_TIMEOUT 10000 | ||||
| 
 | ||||
| static SubGhzEnvironment* environment_handler; | ||||
|  | ||||
| @ -19,8 +19,8 @@ | ||||
| #define HOLTEK_HEADER 0x5000000000 | ||||
| 
 | ||||
| static const SubGhzBlockConst subghz_protocol_holtek_const = { | ||||
|     .te_short = 500, | ||||
|     .te_long = 1000, | ||||
|     .te_short = 430, | ||||
|     .te_long = 870, | ||||
|     .te_delta = 100, | ||||
|     .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 ", | ||||
|         instance->generic.protocol_name, | ||||
|         instance->generic.data_count_bit, | ||||
|         (uint32_t)((instance->generic.data >> 32) & 0xFFFFFF), | ||||
|         (uint32_t)(instance->generic.data & 0xFFFFFF), | ||||
|         (uint32_t)((instance->generic.data >> 32) & 0xFFFFFFFF), | ||||
|         (uint32_t)(instance->generic.data & 0xFFFFFFFF), | ||||
|         instance->generic.serial, | ||||
|         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; | ||||
|                 if(instance->decoder.decode_count_bit == | ||||
|                    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->generic.data = instance->decoder.decode_data; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Skorpionm
						Skorpionm