fixed dyson decode for algorithm 0.2.5

This commit is contained in:
strawmanbobi
2020-03-14 20:47:35 +08:00
parent a708479370
commit 7b36eb98f5
4 changed files with 24 additions and 25 deletions

View File

@@ -38,7 +38,9 @@ set(SOURCE_FILES_LIB
src/ir_ac_build_frame.c
src/ir_ac_parse_parameter.c
src/ir_ac_parse_forbidden_info.c
src/ir_ac_parse_frame_info.c
System.out.println("continue downloading"); src/ir_ac_parse_frame_info.c
src/ir_ac_control.c
src/ir_ac_binary_parse.c
src/ir_decode.c)

View File

@@ -212,6 +212,7 @@ typedef enum
REMOTE_CATEGORY_BSTB = 11,
REMOTE_CATEGORY_CLEANING_ROBOT = 12,
REMOTE_CATEGORY_AREMOTE_CLEANER = 13,
REMOTE_CATEGORY_DYSON = 14,
REMOTE_CATEGORY_NEXT,
REMOTE_CATEGORY_MAX = 64,
} t_remote_category;

View File

@@ -468,19 +468,6 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16* user_data, UIN
time_length = create_ir_frame();
#if (defined BOARD_PC)
#if (defined BOARD_PC_JNI)
ir_printf("code count = %d\n", context->code_cnt);
#else
int i = 0;
for (i = 0; i < context->code_cnt; i++)
{
ir_printf("%d,", context->time[i]);
}
#endif
ir_printf("\n");
#endif
return time_length;
}
@@ -724,15 +711,6 @@ static UINT16 ir_tv_control(UINT8 key, UINT16 *l_user_data)
memset(l_user_data, 0x00, USER_DATA_SIZE);
ir_code_length = tv_binary_decode(key, l_user_data);
#if defined BOARD_PC
// have some debug
ir_printf("length of IR code = %d\n", ir_code_length);
for (print_index = 0; print_index < ir_code_length; print_index++)
{
ir_printf("%d ", l_user_data[print_index]);
}
#endif
return ir_code_length;
}

View File

@@ -63,6 +63,8 @@ static INT8 decode_as_ac(char *file_name)
UINT8 function_code = AC_FUNCTION_MAX;
int key_code = 0;
int first_time = 1;
int length = 0;
int index = 0;
// get status
UINT8 supported_mode = 0x00;
@@ -218,7 +220,13 @@ static INT8 decode_as_ac(char *file_name)
ac_status.ac_wind_dir,
function_code);
ir_decode(function_code, user_data, &ac_status, change_wind_dir);
length = ir_decode(function_code, user_data, &ac_status, change_wind_dir);
printf("\n === Binary decoded : %d\n", length);
for (index = 0; index < length; index++)
{
printf("%d, ", user_data[index]);
}
printf("===\n");
}
}
} while (TRUE);
@@ -233,6 +241,8 @@ static INT8 decode_as_tv(char *file_name, UINT8 ir_hex_encode)
// keyboard input
int key_code = 0;
int first_time = 1;
int length = 0;
int index = 0;
// here remote category TV represents for command typed IR code
if (IR_DECODE_FAILED == ir_file_open(REMOTE_CATEGORY_TV, ir_hex_encode, file_name))
@@ -258,7 +268,13 @@ static INT8 decode_as_tv(char *file_name, UINT8 ir_hex_encode)
{
break;
}
ir_decode(key_code, user_data, NULL, 0);
length = ir_decode(key_code, user_data, NULL, 0);
printf("\n === Binary decoded : %d\n", length);
for (index = 0; index < length; index++)
{
printf("%d, ", user_data[index]);
}
printf("===\n");
} while (TRUE);
@@ -303,4 +319,6 @@ int main(int argc, char *argv[])
printf("Decode functionality not supported : %c\n", function);
break;
}
}