diff --git a/src/ir_decoder/ir_decode.def b/src/ir_decoder/ir_decode.def index a4cf6cf..e2dfa6d 100644 --- a/src/ir_decoder/ir_decode.def +++ b/src/ir_decoder/ir_decode.def @@ -2,20 +2,19 @@ LIBRARY EXPORTS -irda_context_init @1 -irda_ac_file_open @2 -irda_ac_lib_open @3 -irda_ac_lib_parse @4 -irda_ac_lib_control @5 -irda_ac_lib_close @6 +ir_ac_file_open @1 +ir_ac_lib_open @2 +ir_ac_lib_parse @3 +ir_ac_lib_control @4 +ir_ac_lib_close @5 -irda_tv_file_open @7 -irda_tv_lib_open @8 -irda_tv_lib_parse @9 -irda_tv_lib_control @10 -irda_tv_lib_close @11 -get_temperature_range @12 -get_supported_mode @13 -get_supported_wind_speed @14 -get_supported_swing @15 -get_supported_wind_direction @16 \ No newline at end of file +ir_tv_file_open @6 +ir_tv_lib_open @7 +ir_tv_lib_parse @8 +ir_tv_lib_control @9 +ir_tv_lib_close @19 +get_temperature_range @11 +get_supported_mode @12 +get_supported_wind_speed @13 +get_supported_swing @14 +get_supported_wind_direction @15 \ No newline at end of file diff --git a/src/ir_decoder/ir_decoder.vcxproj b/src/ir_decoder/ir_decoder.vcxproj index f9cbb45..5ceed47 100644 --- a/src/ir_decoder/ir_decoder.vcxproj +++ b/src/ir_decoder/ir_decoder.vcxproj @@ -147,15 +147,17 @@ - - - - - - - - - + + + + + + + + + + + @@ -174,14 +176,17 @@ - - - - - - - - + + + + + + + + + + + Create Create diff --git a/src/ir_decoder/src/ir_ac_apply.c b/src/ir_decoder/src/ir_ac_apply.c index add9a1e..912d1ab 100644 --- a/src/ir_decoder/src/ir_ac_apply.c +++ b/src/ir_decoder/src/ir_ac_apply.c @@ -9,28 +9,10 @@ Revision log: * 2016-10-12: created by strawmanbobi **************************************************************************************************/ -/* - *inclusion - */ - -#if defined WIN32 -#include "stdafx.h" -#endif - #include "../include/ir_utils.h" #include "../include/ir_ac_apply.h" -/* - * global vars - */ -/* - * external vars - */ - -/* - * function declaration - */ static INT8 apply_ac_power(struct ac_protocol *protocol, UINT8 power_status); static INT8 apply_ac_mode(struct ac_protocol *protocol, UINT8 mode_status); @@ -43,9 +25,6 @@ static INT8 apply_ac_swing(struct ac_protocol *protocol, UINT8 swing_status); static UINT8 has_function(struct ac_protocol *protocol, UINT8 function); -/* - * function definition - */ INT8 apply_ac_parameter_type_1(UINT8 *dc_data, tag_comp *comp_data, UINT8 current_seg, UINT8 is_temp) { @@ -167,7 +146,7 @@ static INT8 apply_ac_power(struct ac_protocol *protocol, UINT8 power_status) } for (i = 0; i < protocol->power1.comp_data[power_status].seg_len; i += 2) { - apply_ac_parameter_type_1(ir_hex_code, &(protocol->power1.comp_data[power_status]), i, FALSE); + apply_ac_parameter_type_1(ir_hex_code, &(protocol->power1.comp_data[power_status]), (UINT8)i, FALSE); } return IR_DECODE_SUCCEEDED; } @@ -188,7 +167,7 @@ static INT8 apply_ac_mode(struct ac_protocol *protocol, UINT8 mode_status) for (i = 0; i < protocol->mode1.comp_data[mode_status].seg_len; i += 2) { - apply_ac_parameter_type_1(ir_hex_code, &(protocol->mode1.comp_data[mode_status]), i, FALSE); + apply_ac_parameter_type_1(ir_hex_code, &(protocol->mode1.comp_data[mode_status]), (UINT8)i, FALSE); } // get return here since wind mode 1 is already applied @@ -208,8 +187,8 @@ static INT8 apply_ac_mode(struct ac_protocol *protocol, UINT8 mode_status) for (i = 0; i < protocol->mode2.comp_data[mode_status].seg_len; i += 3) { apply_ac_parameter_type_2(ir_hex_code, - &(protocol->mode2.comp_data[mode_status]), - i, FALSE); + &(protocol->mode2.comp_data[mode_status]), + (UINT8)i, FALSE); } return IR_DECODE_SUCCEEDED; } @@ -230,7 +209,7 @@ static INT8 apply_ac_wind_speed(struct ac_protocol *protocol, UINT8 wind_speed) for (i = 0; i < protocol->speed1.comp_data[wind_speed].seg_len; i += 2) { - apply_ac_parameter_type_1(ir_hex_code, &(protocol->speed1.comp_data[wind_speed]), i, FALSE); + apply_ac_parameter_type_1(ir_hex_code, &(protocol->speed1.comp_data[wind_speed]), (UINT8)i, FALSE); } // get return here since wind speed 1 is already applied @@ -250,8 +229,8 @@ static INT8 apply_ac_wind_speed(struct ac_protocol *protocol, UINT8 wind_speed) for (i = 0; i < protocol->speed2.comp_data[wind_speed].seg_len; i += 3) { apply_ac_parameter_type_2(ir_hex_code, - &(protocol->speed2.comp_data[wind_speed]), - i, FALSE); + &(protocol->speed2.comp_data[wind_speed]), + (UINT8)i, FALSE); } return IR_DECODE_SUCCEEDED; } @@ -274,11 +253,11 @@ static INT8 apply_ac_temperature(struct ac_protocol *protocol, UINT8 temp_diff) { if (TEMP_TYPE_DYNAMIC == protocol->temp1.type) { - apply_ac_parameter_type_1(ir_hex_code, &(protocol->temp1.comp_data[temp_diff]), i, TRUE); + apply_ac_parameter_type_1(ir_hex_code, &(protocol->temp1.comp_data[temp_diff]), (UINT8)i, TRUE); } else if (TEMP_TYPE_STATIC == protocol->temp1.type) { - apply_ac_parameter_type_1(ir_hex_code, &(protocol->temp1.comp_data[temp_diff]), i, FALSE); + apply_ac_parameter_type_1(ir_hex_code, &(protocol->temp1.comp_data[temp_diff]), (UINT8)i, FALSE); } } @@ -302,11 +281,11 @@ static INT8 apply_ac_temperature(struct ac_protocol *protocol, UINT8 temp_diff) { if (TEMP_TYPE_DYNAMIC == protocol->temp2.type) { - apply_ac_parameter_type_2(ir_hex_code, &(protocol->temp2.comp_data[temp_diff]), i, TRUE); + apply_ac_parameter_type_2(ir_hex_code, &(protocol->temp2.comp_data[temp_diff]), (UINT8)i, TRUE); } else if (TEMP_TYPE_STATIC == protocol->temp2.type) { - apply_ac_parameter_type_2(ir_hex_code, &(protocol->temp2.comp_data[temp_diff]), i, FALSE); + apply_ac_parameter_type_2(ir_hex_code, &(protocol->temp2.comp_data[temp_diff]), (UINT8)i, FALSE); } } } @@ -335,7 +314,7 @@ static INT8 apply_ac_swing(struct ac_protocol *protocol, UINT8 swing_mode) for (i = 0; i < protocol->swing1.comp_data[swing_mode].seg_len; i += 2) { - apply_ac_parameter_type_1(ir_hex_code, &(protocol->swing1.comp_data[swing_mode]), i, FALSE); + apply_ac_parameter_type_1(ir_hex_code, &(protocol->swing1.comp_data[swing_mode]), (UINT8)i, FALSE); } // get return here since temperature 1 is already applied @@ -361,8 +340,8 @@ static INT8 apply_ac_swing(struct ac_protocol *protocol, UINT8 swing_mode) for (i = 0; i < protocol->swing2.comp_data[swing_mode].seg_len; i += 3) { apply_ac_parameter_type_2(ir_hex_code, - &(protocol->swing2.comp_data[swing_mode]), - i, FALSE); + &(protocol->swing2.comp_data[swing_mode]), + (UINT8)i, FALSE); } return IR_DECODE_SUCCEEDED; } @@ -569,7 +548,7 @@ INT8 apply_function(struct ac_protocol *protocol, UINT8 function) for (i = 0; i < protocol->function1.comp_data[function - 1].seg_len; i += 2) { - apply_ac_parameter_type_1(ir_hex_code, &(protocol->function1.comp_data[function - 1]), i, FALSE); + apply_ac_parameter_type_1(ir_hex_code, &(protocol->function1.comp_data[function - 1]), (UINT8)i, FALSE); } // get return here since function 1 is already applied @@ -589,8 +568,8 @@ INT8 apply_function(struct ac_protocol *protocol, UINT8 function) for (i = 0; i < protocol->function2.comp_data[function - 1].seg_len; i += 3) { apply_ac_parameter_type_2(ir_hex_code, - &(protocol->function2.comp_data[function - 1]), - i, FALSE); + &(protocol->function2.comp_data[function - 1]), + (UINT8)i, FALSE); } return IR_DECODE_SUCCEEDED; } diff --git a/src/ir_decoder/src/ir_ac_build_frame.c b/src/ir_decoder/src/ir_ac_build_frame.c index 5fef1eb..145396f 100644 --- a/src/ir_decoder/src/ir_ac_build_frame.c +++ b/src/ir_decoder/src/ir_ac_build_frame.c @@ -9,10 +9,6 @@ Revision log: * 2016-10-01: created by strawmanbobi **************************************************************************************************/ -#if defined WIN32 -#include "stdafx.h" -#endif - #include #include "../include/ir_ac_build_frame.h" @@ -20,6 +16,7 @@ Revision log: extern protocol* context; + //return bit number per byte,default value is 8 UINT8 bits_per_byte(UINT8 index) { @@ -32,12 +29,12 @@ UINT8 bits_per_byte(UINT8 index) if (context->bitnum_cnt >= MAX_BITNUM) size = MAX_BITNUM; else - size = context->bitnum_cnt; + size = (UINT8)context->bitnum_cnt; for (i = 0; i < size; i++) { if (context->bitnum[i].pos == index) - return context->bitnum[i].bits; + return (UINT8)context->bitnum[i].bits; if (context->bitnum[i].pos > index) return 8; } @@ -53,7 +50,7 @@ UINT16 add_delaycode(UINT8 index) if(context->dc_cnt != 0) { - size = context->dc_cnt; + size = (UINT8)context->dc_cnt; for (i = 0; i < size; i++) { @@ -110,7 +107,7 @@ UINT16 create_ir_frame() for (i = 0; i < ir_hex_len; i++) { - bitnum = bits_per_byte(i); + bitnum = bits_per_byte((UINT8)i); //IR_PRINTF("bitnum:%d\n", bitnum); for (j = 0; j < bitnum; j++) { @@ -132,7 +129,7 @@ UINT16 create_ir_frame() context->time[context->code_cnt++] = context->zero.high; } } - add_delaycode(i); + add_delaycode((UINT8)i); } framelen = context->code_cnt; diff --git a/src/ir_decoder/src/ir_ac_parse_forbidden_info.c b/src/ir_decoder/src/ir_ac_parse_forbidden_info.c index 4fc1fa9..be608cd 100644 --- a/src/ir_decoder/src/ir_ac_parse_forbidden_info.c +++ b/src/ir_decoder/src/ir_ac_parse_forbidden_info.c @@ -9,36 +9,18 @@ Revision log: * 2016-10-05: created by strawmanbobi **************************************************************************************************/ -/* - *inclusion - */ - -#if defined WIN32 -#include "stdafx.h" -#endif - #include #include #include #include "../include/ir_decode.h" #include "../include/ir_ac_parse_forbidden_info.h" -/* - * global vars - */ -/* - * external vars - */ + extern protocol* context; -/* - * function declaration - */ -/* - * function definition - */ + INT8 parse_nmode_data_speed(char *pdata, ac_n_mode seq) { char buf[16] = {0}; @@ -56,7 +38,7 @@ INT8 parse_nmode_data_speed(char *pdata, ac_n_mode seq) pos = index + 1; index = pos; context->n_mode[seq].speed[cnt++] = atoi(buf); - context->n_mode[seq].speed_cnt = cnt; + context->n_mode[seq].speed_cnt = (UINT8)cnt; irda_memset(buf, 0, 16); } @@ -81,7 +63,7 @@ INT8 parse_nmode_data_temp(char *pdata, ac_n_mode seq) pos = index + 1; index = pos; context->n_mode[seq].temp[cnt++] = atoi(buf) - 16; - context->n_mode[seq].temp_cnt = cnt; + context->n_mode[seq].temp_cnt = (UINT8)cnt; irda_memset(buf, 0, 16); } return IR_DECODE_SUCCEEDED; diff --git a/src/ir_decoder/src/ir_ac_parse_frame_info.c b/src/ir_decoder/src/ir_ac_parse_frame_info.c index 287fcd9..ade2f90 100644 --- a/src/ir_decoder/src/ir_ac_parse_frame_info.c +++ b/src/ir_decoder/src/ir_ac_parse_frame_info.c @@ -9,14 +9,6 @@ Revision log: * 2016-10-11: created by strawmanbobi **************************************************************************************************/ -/* - *inclusion - */ - -#if defined WIN32 -#include "stdafx.h" -#endif - #include #include #include @@ -24,22 +16,7 @@ Revision log: #include "../include/ir_utils.h" #include "../include/ir_ac_parse_frame_info.h" -/* - * global vars - */ -/* - * external vars - */ - -/* - * function declaration - */ - - -/* - * function definition - */ INT8 parse_bootcode(struct tag_head *tag) { UINT8 buf[16] = {0}; diff --git a/src/ir_decoder/src/ir_ac_parse_parameter.c b/src/ir_decoder/src/ir_ac_parse_parameter.c index 58bc64b..63b7775 100644 --- a/src/ir_decoder/src/ir_ac_parse_parameter.c +++ b/src/ir_decoder/src/ir_ac_parse_parameter.c @@ -9,14 +9,6 @@ Revision log: * 2016-10-12: created by strawmanbobi **************************************************************************************************/ -/* - *inclusion - */ - -#if defined WIN32 -#include "stdafx.h" -#endif - #include #include #include @@ -24,21 +16,7 @@ Revision log: #include "../include/ir_utils.h" #include "../include/ir_ac_parse_parameter.h" -/* - * global vars - */ -/* - * external vars - */ - -/* - * function declaration - */ - -/* - * function definition - */ INT8 parse_comp_data_type_1(UINT8 *data, UINT16 *trav_offset, tag_comp *comp) { UINT8 seg_len = data[*trav_offset]; @@ -205,7 +183,7 @@ INT8 parse_power_1(struct tag_head *tag, power_1 *power1) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to power1 data structure - power1->len = hex_len; + power1->len = (UINT8)hex_len; for (seg_index = AC_POWER_ON; seg_index < AC_POWER_MAX; seg_index++) { @@ -257,7 +235,7 @@ INT8 parse_temp_1(struct tag_head *tag, temp_1 *temp1) { // dynamic temperature tag temp1->type = TEMP_TYPE_DYNAMIC; - temp1->len = hex_len; + temp1->len = (UINT8)hex_len; UINT8 seg_len = hex_data[0]; for (seg_index = AC_TEMP_16; seg_index < AC_TEMP_MAX; seg_index++) @@ -284,7 +262,7 @@ INT8 parse_temp_1(struct tag_head *tag, temp_1 *temp1) else { // static temperature tag - temp1->len = hex_len; + temp1->len = (UINT8)hex_len; temp1->type = TEMP_TYPE_STATIC; for (seg_index = AC_TEMP_16; seg_index < AC_TEMP_MAX; seg_index++) { @@ -330,7 +308,7 @@ INT8 parse_mode_1(struct tag_head *tag, mode_1 *mode1) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to mode1 data structure - mode1->len = hex_len; + mode1->len = (UINT8)hex_len; for (seg_index = AC_MODE_COOL; seg_index < AC_MODE_MAX; seg_index++) { @@ -376,7 +354,7 @@ INT8 parse_speed_1(struct tag_head *tag, speed_1 *speed1) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to speed1 data structure - speed1->len = hex_len; + speed1->len = (UINT8)hex_len; for (seg_index = AC_WS_AUTO; seg_index < AC_WS_MAX; seg_index++) { @@ -423,7 +401,7 @@ INT8 parse_swing_1(struct tag_head *tag, swing_1 *swing1, UINT16 swing_count) // parse hex data to swing1 data structure swing1->count = swing_count; - swing1->len = hex_len; + swing1->len = (UINT8)hex_len; swing1->comp_data = (tag_comp *) irda_malloc(sizeof(tag_comp) * swing_count); if (NULL == swing1->comp_data) { @@ -760,7 +738,7 @@ INT8 parse_function_1_tag29(struct tag_head *tag, function_1 *function1) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to mode1 data structure - function1->len = hex_len; + function1->len = (UINT8)hex_len; // seg_index in TAG only refers to functional count for (seg_index = AC_FUNCTION_POWER; seg_index < AC_FUNCTION_MAX; seg_index++) @@ -821,7 +799,7 @@ INT8 parse_temp_2(struct tag_head *tag, temp_2 *temp2) { // dynamic temperature tag temp2->type = TEMP_TYPE_DYNAMIC; - temp2->len = hex_len; + temp2->len = (UINT8)hex_len; UINT8 seg_len = hex_data[0]; for (seg_index = AC_TEMP_16; seg_index < AC_TEMP_MAX; seg_index++) @@ -848,7 +826,7 @@ INT8 parse_temp_2(struct tag_head *tag, temp_2 *temp2) else { // static temperature tag - temp2->len = hex_len; + temp2->len = (UINT8)hex_len; temp2->type = TEMP_TYPE_STATIC; for (seg_index = AC_TEMP_16; seg_index < AC_TEMP_MAX; seg_index++) { @@ -899,7 +877,7 @@ INT8 parse_mode_2(struct tag_head *tag, mode_2 *mode2) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to mode1 data structure - mode2->len = hex_len; + mode2->len = (UINT8)hex_len; for (seg_index = AC_MODE_COOL; seg_index < AC_MODE_MAX; seg_index++) { @@ -950,7 +928,7 @@ INT8 parse_speed_2(struct tag_head *tag, speed_2 *speed2) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to speed1 data structure - speed2->len = hex_len; + speed2->len = (UINT8)hex_len; for (seg_index = AC_WS_AUTO; seg_index < AC_WS_MAX; seg_index++) { @@ -1002,7 +980,7 @@ INT8 parse_swing_2(struct tag_head *tag, swing_2 *swing2, UINT16 swing_count) // parse hex data to swing2 data structure swing2->count = swing_count; - swing2->len = hex_len; + swing2->len = (UINT8)hex_len; swing2->comp_data = (tag_comp *) irda_malloc(sizeof(tag_comp) * swing_count); if (NULL == swing2->comp_data) { @@ -1128,7 +1106,7 @@ INT8 parse_function_2_tag34(struct tag_head *tag, function_2 *function2) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to mode1 data structure - function2->len = hex_len; + function2->len = (UINT8)hex_len; // seg_index in TAG only refers to functional count for (seg_index = AC_FUNCTION_POWER; seg_index < AC_FUNCTION_MAX; seg_index++) @@ -1233,7 +1211,7 @@ INT8 parse_solo_code(struct tag_head *tag, solo_code *sc) string_to_hex_common(tag->pdata, hex_data, hex_len); // parse hex data to mode1 data structure - sc->len = hex_len; + sc->len = (UINT8)hex_len; sc->solo_func_count = hex_len - 1; // per each function takes just 1 byte of length diff --git a/src/ir_decoder/src/ir_decode.c b/src/ir_decoder/src/ir_decode.c index 7323e84..919858d 100644 --- a/src/ir_decoder/src/ir_decode.c +++ b/src/ir_decoder/src/ir_decode.c @@ -9,10 +9,6 @@ Revision log: * 2016-10-01: created by strawmanbobi **************************************************************************************************/ -#if defined WIN32 -#include "stdafx.h" -#endif - #include #include diff --git a/src/ir_decoder/src/ir_test_main.c b/src/ir_decoder/src/ir_test_main.c index c1dac38..cd02dd2 100644 --- a/src/ir_decoder/src/ir_test_main.c +++ b/src/ir_decoder/src/ir_test_main.c @@ -9,10 +9,6 @@ Revision log: * 2016-11-05: created by strawmanbobi **************************************************************************************************/ -#if defined WIN32 -#include "stdafx.h" -#endif - #include #if !defined WIN32 diff --git a/src/ir_decoder/src/ir_tv_control.c b/src/ir_decoder/src/ir_tv_control.c index f398074..baf86c7 100644 --- a/src/ir_decoder/src/ir_tv_control.c +++ b/src/ir_decoder/src/ir_tv_control.c @@ -9,10 +9,6 @@ Revision log: * 2016-10-21: created by strawmanbobi **************************************************************************************************/ -#if defined WIN32 -#include "stdafx.h" -#endif - #include #include "../include/ir_defs.h" diff --git a/src/ir_decoder/src/ir_utils.c b/src/ir_decoder/src/ir_utils.c index 15400cf..a85b85b 100644 --- a/src/ir_decoder/src/ir_utils.c +++ b/src/ir_decoder/src/ir_utils.c @@ -9,10 +9,6 @@ Revision log: * 2016-10-01: created by strawmanbobi **************************************************************************************************/ -#ifdef WIN32 -#include "stdafx.h" -#endif - #include "../include/ir_utils.h" UINT8 char_to_hex(char chr)