SubGhz: Unit_test and bugfixes (#1104)
* SubGhz: CLI add "subghz decode_raw" * SubGhz: unit_test * SubGhz: add Hormann_hsm_raw unit_test * SubGhz: fix duration raw * Unit_test: fix total test timer * SubGHz: fix name display scher_khan * SubGhz: fix deviation protocol kia * SubGhz: return max name length to previous value * FuriHal: correctly handle mute in speaker * UnitTests: fix grammar in subghz Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -95,15 +95,15 @@ void subghz_protocol_decoder_kia_feed(void* context, bool level, uint32_t durati
|
||||
|
||||
switch(instance->decoder.parser_step) {
|
||||
case KIADecoderStepReset:
|
||||
if((!level) && (DURATION_DIFF(duration, subghz_protocol_kia_const.te_short) <
|
||||
subghz_protocol_kia_const.te_delta)) {
|
||||
if((level) && (DURATION_DIFF(duration, subghz_protocol_kia_const.te_short) <
|
||||
subghz_protocol_kia_const.te_delta)) {
|
||||
instance->decoder.parser_step = KIADecoderStepCheckPreambula;
|
||||
instance->decoder.te_last = duration;
|
||||
instance->header_count = 0;
|
||||
}
|
||||
break;
|
||||
case KIADecoderStepCheckPreambula:
|
||||
if(!level) {
|
||||
if(level) {
|
||||
if((DURATION_DIFF(duration, subghz_protocol_kia_const.te_short) <
|
||||
subghz_protocol_kia_const.te_delta) ||
|
||||
(DURATION_DIFF(duration, subghz_protocol_kia_const.te_long) <
|
||||
@@ -139,7 +139,7 @@ void subghz_protocol_decoder_kia_feed(void* context, bool level, uint32_t durati
|
||||
}
|
||||
break;
|
||||
case KIADecoderStepSaveDuration:
|
||||
if(!level) {
|
||||
if(level) {
|
||||
if(duration >=
|
||||
(subghz_protocol_kia_const.te_long + subghz_protocol_kia_const.te_delta * 2)) {
|
||||
//Found stop bit
|
||||
@@ -164,7 +164,7 @@ void subghz_protocol_decoder_kia_feed(void* context, bool level, uint32_t durati
|
||||
}
|
||||
break;
|
||||
case KIADecoderStepCheckDuration:
|
||||
if(level) {
|
||||
if(!level) {
|
||||
if((DURATION_DIFF(instance->decoder.te_last, subghz_protocol_kia_const.te_short) <
|
||||
subghz_protocol_kia_const.te_delta) &&
|
||||
(DURATION_DIFF(duration, subghz_protocol_kia_const.te_short) <
|
||||
|
@@ -15,7 +15,7 @@
|
||||
#define SUBGHZ_DOWNLOAD_MAX_SIZE 512
|
||||
|
||||
static const SubGhzBlockConst subghz_protocol_raw_const = {
|
||||
.te_short = 80,
|
||||
.te_short = 50,
|
||||
.te_long = 32700,
|
||||
.te_delta = 0,
|
||||
.min_count_bit_for_found = 0,
|
||||
@@ -223,8 +223,6 @@ void subghz_protocol_decoder_raw_feed(void* context, bool level, uint32_t durati
|
||||
|
||||
if(instance->upload_raw != NULL) {
|
||||
if(duration > subghz_protocol_raw_const.te_short) {
|
||||
if(duration > subghz_protocol_raw_const.te_long)
|
||||
duration = subghz_protocol_raw_const.te_long;
|
||||
if(instance->last_level != level) {
|
||||
instance->last_level = (level ? true : false);
|
||||
instance->upload_raw[instance->ind_write++] = (level ? duration : -duration);
|
||||
|
@@ -1,25 +1,5 @@
|
||||
#include "registry.h"
|
||||
|
||||
#include "princeton.h"
|
||||
#include "keeloq.h"
|
||||
#include "star_line.h"
|
||||
#include "nice_flo.h"
|
||||
#include "came.h"
|
||||
#include "faac_slh.h"
|
||||
#include "nice_flor_s.h"
|
||||
#include "came_twee.h"
|
||||
#include "came_atomo.h"
|
||||
#include "nero_sketch.h"
|
||||
#include "ido.h"
|
||||
#include "kia.h"
|
||||
#include "hormann.h"
|
||||
#include "nero_radio.h"
|
||||
#include "somfy_telis.h"
|
||||
#include "somfy_keytis.h"
|
||||
#include "scher_khan.h"
|
||||
#include "gate_tx.h"
|
||||
#include "raw.h"
|
||||
|
||||
const SubGhzProtocol* subghz_protocol_registry[] = {
|
||||
&subghz_protocol_princeton, &subghz_protocol_keeloq, &subghz_protocol_star_line,
|
||||
&subghz_protocol_nice_flo, &subghz_protocol_came, &subghz_protocol_faac_slh,
|
||||
|
@@ -2,6 +2,26 @@
|
||||
|
||||
#include "../types.h"
|
||||
|
||||
#include "princeton.h"
|
||||
#include "keeloq.h"
|
||||
#include "star_line.h"
|
||||
#include "nice_flo.h"
|
||||
#include "came.h"
|
||||
#include "faac_slh.h"
|
||||
#include "nice_flor_s.h"
|
||||
#include "came_twee.h"
|
||||
#include "came_atomo.h"
|
||||
#include "nero_sketch.h"
|
||||
#include "ido.h"
|
||||
#include "kia.h"
|
||||
#include "hormann.h"
|
||||
#include "nero_radio.h"
|
||||
#include "somfy_telis.h"
|
||||
#include "somfy_keytis.h"
|
||||
#include "scher_khan.h"
|
||||
#include "gate_tx.h"
|
||||
#include "raw.h"
|
||||
|
||||
/**
|
||||
* Registration by name SubGhzProtocol.
|
||||
* @param name Protocol name
|
||||
|
@@ -207,7 +207,7 @@ void subghz_protocol_decoder_scher_khan_feed(void* context, bool level, uint32_t
|
||||
*/
|
||||
static void subghz_protocol_scher_khan_check_remote_controller(
|
||||
SubGhzBlockGeneric* instance,
|
||||
const char* protocol_name) {
|
||||
const char** protocol_name) {
|
||||
/*
|
||||
* MAGICAR 51 bit 00000001A99121DE83C3 MAGIC CODE, Dinamic
|
||||
* 0E8C1619E830C -> 000011101000110000010110 0001 1001 1110 1000001100001100
|
||||
@@ -222,7 +222,7 @@ static void subghz_protocol_scher_khan_check_remote_controller(
|
||||
// instance->protocol_name = "MAGIC CODE, Static";
|
||||
// break;
|
||||
case 51: //MAGIC CODE, Dinamic
|
||||
protocol_name = "MAGIC CODE, Dinamic";
|
||||
*protocol_name = "MAGIC CODE, Dinamic";
|
||||
instance->serial = ((instance->data >> 24) & 0xFFFFFF0) | ((instance->data >> 20) & 0x0F);
|
||||
instance->btn = (instance->data >> 24) & 0x0F;
|
||||
instance->cnt = instance->data & 0xFFFF;
|
||||
@@ -268,7 +268,7 @@ void subghz_protocol_decoder_scher_khan_get_string(void* context, string_t outpu
|
||||
SubGhzProtocolDecoderScherKhan* instance = context;
|
||||
|
||||
subghz_protocol_scher_khan_check_remote_controller(
|
||||
&instance->generic, instance->protocol_name);
|
||||
&instance->generic, &instance->protocol_name);
|
||||
|
||||
string_cat_printf(
|
||||
output,
|
||||
|
Reference in New Issue
Block a user