From 3e336eca229c40a484db4e1e030f7aea35b477f8 Mon Sep 17 00:00:00 2001 From: strawmanbobi Date: Thu, 3 Mar 2022 09:17:26 +0800 Subject: [PATCH] fixed hexadecimal typed decode failure --- src/ir_decoder/src/include/ir_decode.h | 9 +++++---- src/ir_decoder/src/ir_decode.c | 16 ++++++++-------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/ir_decoder/src/include/ir_decode.h b/src/ir_decoder/src/include/ir_decode.h index e0069aa..6d7ebeb 100644 --- a/src/ir_decoder/src/include/ir_decode.h +++ b/src/ir_decoder/src/include/ir_decode.h @@ -221,10 +221,11 @@ typedef enum typedef enum { - SUB_CATEGORY_QUATERNARY = 0, - SUB_CATEGORY_HEXADECIMAL = 1, - SUB_CATEGORY_NEXT = 2, - SUB_CATEGORY_MAX = 7, + SUB_CATEGORY_BINARY = 0, // deprecated + SUB_CATEGORY_QUATERNARY = 1, + SUB_CATEGORY_HEXADECIMAL = 2, + SUB_CATEGORY_NEXT = 3, + SUB_CATEGORY_MAX = 4, } t_remote_sub_category; /** diff --git a/src/ir_decoder/src/ir_decode.c b/src/ir_decoder/src/ir_decode.c index 008439e..1994d5f 100644 --- a/src/ir_decoder/src/ir_decode.c +++ b/src/ir_decoder/src/ir_decode.c @@ -139,13 +139,13 @@ INT8 ir_file_open(const UINT8 category, const UINT8 sub_category, const char* fi else { ir_binary_type = IR_TYPE_COMMANDS; - if (1 == sub_category) + if (SUB_CATEGORY_QUATERNARY == sub_category) { - ir_hexadecimal = SUB_CATEGORY_QUATERNARY; + ir_hexadecimal = 0; } - else if (2 == sub_category) + else if (SUB_CATEGORY_HEXADECIMAL == sub_category) { - ir_hexadecimal = SUB_CATEGORY_HEXADECIMAL; + ir_hexadecimal = 1; } else { @@ -205,13 +205,13 @@ INT8 ir_binary_open(const UINT8 category, const UINT8 sub_category, UINT8* binar else { ir_binary_type = IR_TYPE_COMMANDS; - if (1 == sub_category) + if (SUB_CATEGORY_QUATERNARY == sub_category) { - ir_hexadecimal = SUB_CATEGORY_QUATERNARY; + ir_hexadecimal = 0; } - else if (2 == sub_category) + else if (SUB_CATEGORY_HEXADECIMAL == sub_category) { - ir_hexadecimal = SUB_CATEGORY_HEXADECIMAL; + ir_hexadecimal = 1; } else {