18
18
static const SubGhzBlockConst subghz_protocol_linear_const = {
19
19
.te_short = 500 ,
20
20
.te_long = 1500 ,
21
- .te_delta = 150 ,
21
+ .te_delta = 350 ,
22
22
.min_count_bit_for_found = 10 ,
23
23
};
24
24
@@ -116,30 +116,30 @@ static bool subghz_protocol_encoder_linear_get_upload(SubGhzProtocolEncoderLinea
116
116
if (bit_read (instance -> generic .data , i - 1 )) {
117
117
//send bit 1
118
118
instance -> encoder .upload [index ++ ] =
119
- level_duration_make (true, (uint32_t )subghz_protocol_linear_const .te_short * 3 );
119
+ level_duration_make (true, (uint32_t )subghz_protocol_linear_const .te_long );
120
120
instance -> encoder .upload [index ++ ] =
121
121
level_duration_make (false, (uint32_t )subghz_protocol_linear_const .te_short );
122
122
} else {
123
123
//send bit 0
124
124
instance -> encoder .upload [index ++ ] =
125
125
level_duration_make (true, (uint32_t )subghz_protocol_linear_const .te_short );
126
126
instance -> encoder .upload [index ++ ] =
127
- level_duration_make (false, (uint32_t )subghz_protocol_linear_const .te_short * 3 );
127
+ level_duration_make (false, (uint32_t )subghz_protocol_linear_const .te_long );
128
128
}
129
129
}
130
130
//Send end bit
131
131
if (bit_read (instance -> generic .data , 0 )) {
132
132
//send bit 1
133
133
instance -> encoder .upload [index ++ ] =
134
- level_duration_make (true, (uint32_t )subghz_protocol_linear_const .te_short * 3 );
135
- //Send PT_GUARD
134
+ level_duration_make (true, (uint32_t )subghz_protocol_linear_const .te_long );
135
+ //Send gap
136
136
instance -> encoder .upload [index ++ ] =
137
137
level_duration_make (false, (uint32_t )subghz_protocol_linear_const .te_short * 42 );
138
138
} else {
139
139
//send bit 0
140
140
instance -> encoder .upload [index ++ ] =
141
141
level_duration_make (true, (uint32_t )subghz_protocol_linear_const .te_short );
142
- //Send PT_GUARD
142
+ //Send gap
143
143
instance -> encoder .upload [index ++ ] =
144
144
level_duration_make (false, (uint32_t )subghz_protocol_linear_const .te_short * 44 );
145
145
}
@@ -223,7 +223,7 @@ void subghz_protocol_decoder_linear_feed(void* context, bool level, uint32_t dur
223
223
switch (instance -> decoder .parser_step ) {
224
224
case LinearDecoderStepReset :
225
225
if ((!level ) && (DURATION_DIFF (duration , subghz_protocol_linear_const .te_short * 42 ) <
226
- subghz_protocol_linear_const .te_delta * 20 )) {
226
+ subghz_protocol_linear_const .te_delta * 15 )) {
227
227
//Found header Linear
228
228
instance -> decoder .decode_data = 0 ;
229
229
instance -> decoder .decode_count_bit = 0 ;
@@ -244,7 +244,7 @@ void subghz_protocol_decoder_linear_feed(void* context, bool level, uint32_t dur
244
244
instance -> decoder .parser_step = LinearDecoderStepReset ;
245
245
//checking that the duration matches the guardtime
246
246
if (DURATION_DIFF (duration , subghz_protocol_linear_const .te_short * 42 ) >
247
- subghz_protocol_linear_const .te_delta * 20 ) {
247
+ subghz_protocol_linear_const .te_delta * 15 ) {
248
248
break ;
249
249
}
250
250
if (DURATION_DIFF (instance -> decoder .te_last , subghz_protocol_linear_const .te_short ) <
@@ -321,18 +321,21 @@ void subghz_protocol_decoder_linear_get_string(void* context, FuriString* output
321
321
furi_assert (context );
322
322
SubGhzProtocolDecoderLinear * instance = context ;
323
323
324
- uint32_t code_found_lo = instance -> generic .data & 0x00000000ffffffff ;
324
+ // Protocol is actually implemented wrong way around, bits are inverted.
325
+ // Instead of fixing it and breaking old saved remotes,
326
+ // only the display here is inverted (~) to show correct values.
327
+ uint32_t code_found_lo = ~instance -> generic .data & 0x00000000000003ff ;
325
328
326
329
uint64_t code_found_reverse = subghz_protocol_blocks_reverse_key (
327
- instance -> generic .data , instance -> generic .data_count_bit );
330
+ ~ instance -> generic .data , instance -> generic .data_count_bit );
328
331
329
- uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000ffffffff ;
332
+ uint32_t code_found_reverse_lo = code_found_reverse & 0x00000000000003ff ;
330
333
331
334
furi_string_cat_printf (
332
335
output ,
333
336
"%s %dbit\r\n"
334
- "Key:0x%08lX \r\n"
335
- "Yek:0x%08lX \r\n"
337
+ "Key:0x%03lX \r\n"
338
+ "Yek:0x%03lX \r\n"
336
339
"DIP:" DIP_PATTERN "\r\n" ,
337
340
instance -> generic .protocol_name ,
338
341
instance -> generic .data_count_bit ,
0 commit comments