diff --git a/android-example/decodesdk/ir_decoder/Android.mk b/android-example/decodesdk/ir_decoder/Android.mk index a2fbb34..c928a23 100644 --- a/android-example/decodesdk/ir_decoder/Android.mk +++ b/android-example/decodesdk/ir_decoder/Android.mk @@ -4,7 +4,7 @@ include $(CLEAR_VARS) LOCAL_CFLAGS := -DBOARD_ANDROID LOCAL_MODULE := libirdecode -LOCAL_SRC_FILES := ./jni/ir_decode_jni.c \ +LOCAL_SRC_FILES := ./jni/src/ir_decode_jni.c \ ./src/ir_decode.c \ ./src/ir_tv_control.c \ ./src/ir_ac_apply.c \ diff --git a/android-example/decodesdk/ir_decoder/include/ir_decode.h b/android-example/decodesdk/ir_decoder/include/ir_decode.h index 4132128..75353ae 100644 --- a/android-example/decodesdk/ir_decoder/include/ir_decode.h +++ b/android-example/decodesdk/ir_decoder/include/ir_decode.h @@ -51,11 +51,12 @@ extern "C" #define KEY_TV_SETTINGS 13 #define KEY_AC_POWER 0 -#define KEY_AC_TEMP_PLUS 1 -#define KEY_AC_TEMP_MINUS 2 -#define KEY_AC_MODE_SWITCH 8 +#define KEY_AC_MODE_SWITCH 1 +#define KEY_AC_TEMP_PLUS 2 +#define KEY_AC_TEMP_MINUS 3 #define KEY_AC_WIND_SPEED 9 -#define KEY_AC_WIND_DIRECTION 10 +#define KEY_AC_WIND_SWING 10 +#define KEY_AC_WIND_FIX 11 #define KEY_STB_POWER 0 #define KEY_STB_MUTE 1 diff --git a/android-example/decodesdk/ir_decoder/src/ir_ac_parse_parameter.c b/android-example/decodesdk/ir_decoder/src/ir_ac_parse_parameter.c index e5c8cea..77cc351 100644 --- a/android-example/decodesdk/ir_decoder/src/ir_ac_parse_parameter.c +++ b/android-example/decodesdk/ir_decoder/src/ir_ac_parse_parameter.c @@ -1136,7 +1136,14 @@ INT8 parse_swing_info(struct tag_head *tag, t_swing_info *si) */ // count how many swing types are there si->type = SWING_TYPE_NORMAL; - si->mode_count = (UINT8) ((tag->len + 1) >> 1); + si->mode_count = 1; + for (i = 0; i < tag->len; i++) + { + if (tag->p_data[i] == ',') + { + si->mode_count++; + } + } return IR_DECODE_SUCCEEDED; } diff --git a/android-example/decodesdk/ir_decoder/src/ir_decode.c b/android-example/decodesdk/ir_decoder/src/ir_decode.c index b2de0eb..d8c3e6b 100644 --- a/android-example/decodesdk/ir_decoder/src/ir_decode.c +++ b/android-example/decodesdk/ir_decoder/src/ir_decode.c @@ -22,7 +22,7 @@ Revision log: struct ir_bin_buffer binary_file; struct ir_bin_buffer *p_ir_buffer = &binary_file; -const char* release = "0.2.1"; +const char* release = "0.2.2"; #if defined USE_DYNAMIC_TAG struct tag_head *tags; @@ -55,12 +55,19 @@ lp_apply_ac_parameter apply_table[AC_APPLY_MAX] = }; // static functions declarations +#if !defined NO_FS static INT8 ir_ac_file_open(const char *file_name); +#endif + static INT8 ir_ac_binary_open(UINT8 *binary, UINT16 binary_length); static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UINT8 function_code, BOOL change_wind_direction); static INT8 ir_ac_binary_close(); + +#if !defined NO_FS static INT8 ir_tv_file_open(const char *file_name); +#endif + static INT8 ir_tv_binary_open(UINT8 *binary, UINT16 binary_length); static INT8 ir_tv_binary_parse(UINT8 ir_hex_encode); static UINT16 ir_tv_control(UINT8 key, UINT16 *l_user_data); @@ -218,9 +225,9 @@ void ir_lib_free_inner_buffer(); // static function definitions //////// AC Begin //////// +#if !defined NO_FS static INT8 ir_ac_file_open(const char *file_name) { -#if !defined NO_FS size_t ret = 0; #if !defined WIN32 FILE *stream = fopen(file_name, "rb"); @@ -264,9 +271,9 @@ static INT8 ir_ac_file_open(const char *file_name) binary_length = 0; return IR_DECODE_FAILED; } -#endif return IR_DECODE_SUCCEEDED; } +#endif static INT8 ir_ac_binary_open(UINT8 *binary, UINT16 binary_length) { @@ -298,14 +305,10 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN function_code = AC_FUNCTION_MODE; break; case 2: - function_code = AC_FUNCTION_TEMPERATURE_UP; - break; - case 3: - function_code = AC_FUNCTION_TEMPERATURE_DOWN; - break; case 7: function_code = AC_FUNCTION_TEMPERATURE_UP; break; + case 3: case 8: function_code = AC_FUNCTION_TEMPERATURE_DOWN; break; @@ -315,6 +318,9 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN case 10: function_code = AC_FUNCTION_WIND_SWING; break; + case 11: + function_code = AC_FUNCTION_WIND_FIX; + break; } if (0 == context->default_code.len) @@ -585,9 +591,9 @@ INT8 get_supported_wind_direction(UINT8 *supported_wind_direction) //////// AC End //////// //////// TV Begin //////// +#if !defined NO_FS static INT8 ir_tv_file_open(const char *file_name) { -#if !defined NO_FS size_t ret = 0; #if !defined WIN32 @@ -632,9 +638,9 @@ static INT8 ir_tv_file_open(const char *file_name) binary_length = 0; return IR_DECODE_FAILED; } -#endif return IR_DECODE_SUCCEEDED; } +#endif static INT8 ir_tv_binary_open(UINT8 *binary, UINT16 binary_length) { diff --git a/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/include/ir_decode.h b/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/include/ir_decode.h index 4132128..75353ae 100644 --- a/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/include/ir_decode.h +++ b/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/include/ir_decode.h @@ -51,11 +51,12 @@ extern "C" #define KEY_TV_SETTINGS 13 #define KEY_AC_POWER 0 -#define KEY_AC_TEMP_PLUS 1 -#define KEY_AC_TEMP_MINUS 2 -#define KEY_AC_MODE_SWITCH 8 +#define KEY_AC_MODE_SWITCH 1 +#define KEY_AC_TEMP_PLUS 2 +#define KEY_AC_TEMP_MINUS 3 #define KEY_AC_WIND_SPEED 9 -#define KEY_AC_WIND_DIRECTION 10 +#define KEY_AC_WIND_SWING 10 +#define KEY_AC_WIND_FIX 11 #define KEY_STB_POWER 0 #define KEY_STB_MUTE 1 diff --git a/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_ac_parse_parameter.c b/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_ac_parse_parameter.c index e5c8cea..77cc351 100644 --- a/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_ac_parse_parameter.c +++ b/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_ac_parse_parameter.c @@ -1136,7 +1136,14 @@ INT8 parse_swing_info(struct tag_head *tag, t_swing_info *si) */ // count how many swing types are there si->type = SWING_TYPE_NORMAL; - si->mode_count = (UINT8) ((tag->len + 1) >> 1); + si->mode_count = 1; + for (i = 0; i < tag->len; i++) + { + if (tag->p_data[i] == ',') + { + si->mode_count++; + } + } return IR_DECODE_SUCCEEDED; } diff --git a/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_decode.c b/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_decode.c index ce86a3a..d8c3e6b 100644 --- a/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_decode.c +++ b/cc26xx-example/ti/BLE-CC264x/ble_cc26xx/Projects/ble/SimpleBLEPeripheral-IREXT/CC26xx/Source/Application/ir_decoder/src/ir_decode.c @@ -22,7 +22,7 @@ Revision log: struct ir_bin_buffer binary_file; struct ir_bin_buffer *p_ir_buffer = &binary_file; -const char* release = "0.2.1"; +const char* release = "0.2.2"; #if defined USE_DYNAMIC_TAG struct tag_head *tags; @@ -305,14 +305,10 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN function_code = AC_FUNCTION_MODE; break; case 2: - function_code = AC_FUNCTION_TEMPERATURE_UP; - break; - case 3: - function_code = AC_FUNCTION_TEMPERATURE_DOWN; - break; case 7: function_code = AC_FUNCTION_TEMPERATURE_UP; break; + case 3: case 8: function_code = AC_FUNCTION_TEMPERATURE_DOWN; break; @@ -322,6 +318,9 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN case 10: function_code = AC_FUNCTION_WIND_SWING; break; + case 11: + function_code = AC_FUNCTION_WIND_FIX; + break; } if (0 == context->default_code.len) diff --git a/win32-example/DecodeTestWin/ir_decoder/include/ir_decode.h b/win32-example/DecodeTestWin/ir_decoder/include/ir_decode.h index 4132128..75353ae 100644 --- a/win32-example/DecodeTestWin/ir_decoder/include/ir_decode.h +++ b/win32-example/DecodeTestWin/ir_decoder/include/ir_decode.h @@ -51,11 +51,12 @@ extern "C" #define KEY_TV_SETTINGS 13 #define KEY_AC_POWER 0 -#define KEY_AC_TEMP_PLUS 1 -#define KEY_AC_TEMP_MINUS 2 -#define KEY_AC_MODE_SWITCH 8 +#define KEY_AC_MODE_SWITCH 1 +#define KEY_AC_TEMP_PLUS 2 +#define KEY_AC_TEMP_MINUS 3 #define KEY_AC_WIND_SPEED 9 -#define KEY_AC_WIND_DIRECTION 10 +#define KEY_AC_WIND_SWING 10 +#define KEY_AC_WIND_FIX 11 #define KEY_STB_POWER 0 #define KEY_STB_MUTE 1 diff --git a/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c b/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c index 01eb776..77cc351 100644 --- a/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c +++ b/win32-example/DecodeTestWin/ir_decoder/src/ir_ac_parse_parameter.c @@ -1099,8 +1099,6 @@ INT8 parse_function_2_tag34(struct tag_head *tag, t_function_2 *function2) INT8 parse_swing_info(struct tag_head *tag, t_swing_info *si) { - int i; - if (NULL == tag) { return IR_DECODE_FAILED; @@ -1137,16 +1135,15 @@ INT8 parse_swing_info(struct tag_head *tag, t_swing_info *si) * length greater than 1 indicates both auto-swing and some swing angles are supported */ // count how many swing types are there - si->type = SWING_TYPE_NORMAL; - //si->mode_count = (UINT8) ((tag->len + 1) >> 1); - si->mode_count = 1; - for (i = 0; i < tag->len; i++) - { - if (tag->p_data[i] == ',') - { - si->mode_count++; - } - } + si->type = SWING_TYPE_NORMAL; + si->mode_count = 1; + for (i = 0; i < tag->len; i++) + { + if (tag->p_data[i] == ',') + { + si->mode_count++; + } + } return IR_DECODE_SUCCEEDED; } diff --git a/win32-example/DecodeTestWin/ir_decoder/src/ir_decode.c b/win32-example/DecodeTestWin/ir_decoder/src/ir_decode.c index 227fbe2..5df23ee 100644 --- a/win32-example/DecodeTestWin/ir_decoder/src/ir_decode.c +++ b/win32-example/DecodeTestWin/ir_decoder/src/ir_decode.c @@ -22,7 +22,7 @@ Revision log: struct ir_bin_buffer binary_file; struct ir_bin_buffer *p_ir_buffer = &binary_file; -const char* release = "0.2.1"; +const char* release = "0.2.2"; #if defined USE_DYNAMIC_TAG struct tag_head *tags; @@ -305,14 +305,10 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN function_code = AC_FUNCTION_MODE; break; case 2: - function_code = AC_FUNCTION_TEMPERATURE_UP; - break; - case 3: - function_code = AC_FUNCTION_TEMPERATURE_DOWN; - break; case 7: function_code = AC_FUNCTION_TEMPERATURE_UP; break; + case 3: case 8: function_code = AC_FUNCTION_TEMPERATURE_DOWN; break; @@ -322,6 +318,9 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN case 10: function_code = AC_FUNCTION_WIND_SWING; break; + case 11: + function_code = AC_FUNCTION_WIND_FIX; + break; } if (0 == context->default_code.len)