updated embeded, windows and jni examples
This commit is contained in:
@@ -34,6 +34,168 @@ extern "C"
|
|||||||
#define SUB_CATEGORY_QUATERNARY 0
|
#define SUB_CATEGORY_QUATERNARY 0
|
||||||
#define SUB_CATEGORY_HEXADECIMAL 1
|
#define SUB_CATEGORY_HEXADECIMAL 1
|
||||||
|
|
||||||
|
// remote control key definition
|
||||||
|
#define KEY_TV_POWER 0
|
||||||
|
#define KEY_TV_MUTE 1
|
||||||
|
#define KEY_TV_UP 2
|
||||||
|
#define KEY_TV_DOWN 3
|
||||||
|
#define KEY_TV_LEFT 4
|
||||||
|
#define KEY_TV_RIGHT 5
|
||||||
|
#define KEY_TV_OK 6
|
||||||
|
#define KEY_TV_VOL_PLUS 7
|
||||||
|
#define KEY_TV_VOL_MINUS 8
|
||||||
|
#define KEY_TV_BACK 9
|
||||||
|
#define KEY_TV_INPUT 10
|
||||||
|
#define KEY_TV_MENU 11
|
||||||
|
#define KEY_TV_HOME 12
|
||||||
|
#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_WIND_SPEED 9
|
||||||
|
#define KEY_AC_WIND_DIRECTION 10
|
||||||
|
|
||||||
|
#define KEY_STB_POWER 0
|
||||||
|
#define KEY_STB_MUTE 1
|
||||||
|
#define KEY_STB_UP 2
|
||||||
|
#define KEY_STB_DOWN 3
|
||||||
|
#define KEY_STB_LEFT 4
|
||||||
|
#define KEY_STB_RIGHT 5
|
||||||
|
#define KEY_STB_OK 6
|
||||||
|
#define KEY_STB_VOL_PLUS 7
|
||||||
|
#define KEY_STB_VOL_MINUS 8
|
||||||
|
#define KEY_STB_BACK 9
|
||||||
|
#define KEY_STB_INPUT 10
|
||||||
|
#define KEY_STB_MENU 11
|
||||||
|
#define KEY_STB_PAGE_UP 12
|
||||||
|
#define KEY_STB_PAGE_DOWN 13
|
||||||
|
|
||||||
|
#define KEY_NETBOX_POWER 0
|
||||||
|
#define KEY_NETBOX_UP 1
|
||||||
|
#define KEY_NETBOX_DOWN 2
|
||||||
|
#define KEY_NETBOX_LEFT 3
|
||||||
|
#define KEY_NETBOX_RIGHT 4
|
||||||
|
#define KEY_NETBOX_OK 5
|
||||||
|
#define KEY_NETBOX_VOL_PLUS 6
|
||||||
|
#define KEY_NETBOX_VOL_MINUS 7
|
||||||
|
#define KEY_NETBOX_BACK 8
|
||||||
|
#define KEY_NETBOX_MENU 9
|
||||||
|
#define KEY_NETBOX_HOME 10
|
||||||
|
|
||||||
|
#define KEY_IPTV_POWER 0
|
||||||
|
#define KEY_IPTV_MUTE 1
|
||||||
|
#define KEY_IPTV_UP 2
|
||||||
|
#define KEY_IPTV_DOWN 3
|
||||||
|
#define KEY_IPTV_LEFT 4
|
||||||
|
#define KEY_IPTV_RIGHT 5
|
||||||
|
#define KEY_IPTV_OK 6
|
||||||
|
#define KEY_IPTV_VOL_PLUS 7
|
||||||
|
#define KEY_IPTV_VOL_MINUS 8
|
||||||
|
#define KEY_IPTV_BACK 9
|
||||||
|
#define KEY_IPTV_INPUT 10
|
||||||
|
#define KEY_IPTV_MENU 11
|
||||||
|
#define KEY_IPTV_PAGE_UP 12
|
||||||
|
#define KEY_IPTV_PAGE_DOWN 13
|
||||||
|
|
||||||
|
#define KEY_DVD_POWER 0
|
||||||
|
#define KEY_DVD_UP 1
|
||||||
|
#define KEY_DVD_DOWN 2
|
||||||
|
#define KEY_DVD_LEFT 3
|
||||||
|
#define KEY_DVD_RIGHT 4
|
||||||
|
#define KEY_DVD_OK 5
|
||||||
|
#define KEY_DVD_VOL_PLUS 6
|
||||||
|
#define KEY_DVD_VOL_MINUS 7
|
||||||
|
#define KEY_DVD_PLAY 8
|
||||||
|
#define KEY_DVD_PAUSE 9
|
||||||
|
#define KEY_DVD_EJECT 10
|
||||||
|
#define KEY_DVD_REWIND 11
|
||||||
|
#define KEY_DVD_FASTFORWARD 12
|
||||||
|
#define KEY_DVD_MENU 13
|
||||||
|
|
||||||
|
#define KEY_FAN_POWER 0
|
||||||
|
#define KEY_FAN_WIND_PLUS 6
|
||||||
|
#define KEY_FAN_WIND_MUNIS 7
|
||||||
|
#define KEY_FAN_SWING 8
|
||||||
|
#define KEY_FAN_WIND_SPEED 9
|
||||||
|
#define KEY_FAN_WIND_TYPE 10
|
||||||
|
|
||||||
|
#define KEY_PROJECTOR_POWER 0
|
||||||
|
#define KEY_PROJECTOR_UP 1
|
||||||
|
#define KEY_PROJECTOR_DOWN 2
|
||||||
|
#define KEY_PROJECTOR_LEFT 3
|
||||||
|
#define KEY_PROJECTOR_RIGHT 4
|
||||||
|
#define KEY_PROJECTOR_OK 5
|
||||||
|
#define KEY_PROJECTOR_VOL_PLUS 6
|
||||||
|
#define KEY_PROJECTOR_VOL_MINUS 7
|
||||||
|
#define KEY_PROJECTOR_ZOOM_OUT 8
|
||||||
|
#define KEY_PROJECTOR_MENU 9
|
||||||
|
#define KEY_PROJECTOR_ZOOM_IN 10
|
||||||
|
#define KEY_PROJECTOR_BACK 11
|
||||||
|
|
||||||
|
#define KEY_STEREO_POWER 0
|
||||||
|
#define KEY_STEREO_UP 1
|
||||||
|
#define KEY_STEREO_DOWN 2
|
||||||
|
#define KEY_STEREO_LEFT 3
|
||||||
|
#define KEY_STEREO_RIGHT 4
|
||||||
|
#define KEY_STEREO_OK 5
|
||||||
|
#define KEY_STEREO_VOL_PLUS 6
|
||||||
|
#define KEY_STEREO_VOL_MINUS 7
|
||||||
|
#define KEY_STEREO_MUTE 8
|
||||||
|
#define KEY_STEREO_MENU 9
|
||||||
|
|
||||||
|
#define KEY_BULB_POWER 0
|
||||||
|
#define KEY_BULB_COLOR_1 1
|
||||||
|
#define KEY_BULB_COLOR_2 2
|
||||||
|
#define KEY_BULB_COLOR_3 3
|
||||||
|
#define KEY_BULB_COLOR_4 4
|
||||||
|
#define KEY_BULB_COLOR_0 5
|
||||||
|
#define KEY_BULB_BRIGHT_PLUS 6
|
||||||
|
#define KEY_BULB_BRIGHT_MINUS 7
|
||||||
|
#define KEY_BULB_BRIGHT_POWER_ON 8
|
||||||
|
#define KEY_BULB_BRIGHT_RAINBOW 9
|
||||||
|
#define KEY_BULB_BRIGHT_POWER_OFF 10
|
||||||
|
|
||||||
|
#define KEY_CLEANROBOT_POWER 0
|
||||||
|
#define KEY_CLEANROBOT_FOWWARD 1
|
||||||
|
#define KEY_CLEANROBOT_BACKWARD 2
|
||||||
|
#define KEY_CLEANROBOT_LEFT 3
|
||||||
|
#define KEY_CLEANROBOT_RIGHT 4
|
||||||
|
#define KEY_CLEANROBOT_START 5
|
||||||
|
#define KEY_CLEANROBOT_STOP 6
|
||||||
|
#define KEY_CLEANROBOT_AUTO 8
|
||||||
|
#define KEY_CLEANROBOT_SPOT 9
|
||||||
|
#define KEY_CLEANROBOT_SPEED 10
|
||||||
|
#define KEY_CLEANROBOT_TIMER 11
|
||||||
|
#define KEY_CLEANROBOT_CHARGE 12
|
||||||
|
#define KEY_CLEANROBOT_PRESERVE 13
|
||||||
|
|
||||||
|
#define KEY_AIRCLEANER_POWER 0
|
||||||
|
#define KEY_AIRCLEANER_ION 5
|
||||||
|
#define KEY_AIRCLEANER_AUTO 8
|
||||||
|
#define KEY_AIRCLEANER_WIND_SPEED 9
|
||||||
|
#define KEY_AIRCLEANER_MODE_SWITCH 10
|
||||||
|
#define KEY_AIRCLEANER_TIMER 11
|
||||||
|
#define KEY_AIRCLEANER_LIGHT 12
|
||||||
|
#define KEY_AIRCLEANER_FORCE 13
|
||||||
|
|
||||||
|
#define KEY_DYSON_POWER 0
|
||||||
|
#define KEY_DYSON_WIND_SPEED_PLUS 1
|
||||||
|
#define KEY_DYSON_WIND_SPEED_MINUS 2
|
||||||
|
#define KEY_DYSON_TIMER_MINUS 3
|
||||||
|
#define KEY_DYSON_TIMER_PLUS 4
|
||||||
|
#define KEY_DYSON_AUTO 5
|
||||||
|
#define KEY_DYSON_TEMP_PLUS 6
|
||||||
|
#define KEY_DYSON_TEMP_MINUS 7
|
||||||
|
#define KEY_DYSON_SWING 8
|
||||||
|
#define KEY_DYSON_DIFFUSION 9
|
||||||
|
#define KEY_DYSON_FAV 10
|
||||||
|
#define KEY_DYSON_TIMER 11
|
||||||
|
#define KEY_DYSON_SLEEP 12
|
||||||
|
#define KEY_DYSON_COOL 13
|
||||||
|
|
||||||
|
|
||||||
// exported functions
|
// exported functions
|
||||||
/**
|
/**
|
||||||
* function ir_file_open
|
* function ir_file_open
|
||||||
@@ -153,6 +315,12 @@ extern INT8 get_supported_wind_direction(UINT8 *supported_wind_direction);
|
|||||||
extern void ir_lib_free_inner_buffer();
|
extern void ir_lib_free_inner_buffer();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// this function is preferred being called by JNI only
|
||||||
|
UINT16 ir_decode_combo(const UINT8 category, const UINT8 sub_category,
|
||||||
|
UINT8* binary, UINT16 binary_length,
|
||||||
|
UINT8 key_code, UINT16* user_data,
|
||||||
|
t_remote_ac_status* ac_status, BOOL change_wind_direction);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ extern "C"
|
|||||||
#define FORMAT_HEX 16
|
#define FORMAT_HEX 16
|
||||||
#define FORMAT_DECIMAL 10
|
#define FORMAT_DECIMAL 10
|
||||||
|
|
||||||
|
// #define USE_DYNAMIC_TAG 1
|
||||||
|
|
||||||
|
#if defined USE_DYNAMIC_TAG
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef unsigned char UINT8;
|
typedef unsigned char UINT8;
|
||||||
typedef signed char INT8;
|
typedef signed char INT8;
|
||||||
@@ -54,12 +59,13 @@ void noprint(const char *fmt, ...);
|
|||||||
#define ir_memcpy(A, B, C) memcpy(A, B, C)
|
#define ir_memcpy(A, B, C) memcpy(A, B, C)
|
||||||
#define ir_memset(A, B, C) memset(A, B, C)
|
#define ir_memset(A, B, C) memset(A, B, C)
|
||||||
#define ir_strlen(A) strlen(A)
|
#define ir_strlen(A) strlen(A)
|
||||||
#if (defined BOARD_PC) && (!defined BOARD_PC_JNI)
|
#if ((defined BOARD_PC) || (defined BOARD_PC_JNI)) && (defined DEBUG)
|
||||||
#define ir_printf printf
|
#define ir_printf printf
|
||||||
#else
|
#else
|
||||||
#define ir_printf noprint
|
#define ir_printf noprint
|
||||||
#endif
|
#endif
|
||||||
#define USER_DATA_SIZE 1636
|
#define USER_DATA_SIZE 1636
|
||||||
|
// #define USER_DATA_SIZE 4096
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -495,6 +495,11 @@ static INT8 apply_checksum_spec_byte_onebyte(UINT8 *ac_code, t_tag_checksum_data
|
|||||||
|
|
||||||
static UINT8 has_function(struct ac_protocol *protocol, UINT8 function)
|
static UINT8 has_function(struct ac_protocol *protocol, UINT8 function)
|
||||||
{
|
{
|
||||||
|
if (function < AC_FUNCTION_POWER || function > AC_FUNCTION_WIND_FIX)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (0 != protocol->function1.len)
|
if (0 != protocol->function1.len)
|
||||||
{
|
{
|
||||||
if (0 != protocol->function1.comp_data[function - 1].seg_len)
|
if (0 != protocol->function1.comp_data[function - 1].seg_len)
|
||||||
@@ -518,6 +523,11 @@ INT8 apply_function(struct ac_protocol *protocol, UINT8 function)
|
|||||||
{
|
{
|
||||||
UINT16 i = 0;
|
UINT16 i = 0;
|
||||||
|
|
||||||
|
if (function < AC_FUNCTION_POWER || function > AC_FUNCTION_WIND_FIX)
|
||||||
|
{
|
||||||
|
return IR_DECODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
// function index starts from 1 (AC_FUNCTION_POWER), do -1 operation at first
|
// function index starts from 1 (AC_FUNCTION_POWER), do -1 operation at first
|
||||||
if (0 == protocol->function1.len)
|
if (0 == protocol->function1.len)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ Revision log:
|
|||||||
struct ir_bin_buffer binary_file;
|
struct ir_bin_buffer binary_file;
|
||||||
struct ir_bin_buffer *p_ir_buffer = &binary_file;
|
struct ir_bin_buffer *p_ir_buffer = &binary_file;
|
||||||
|
|
||||||
|
const char* release = "0.2.1";
|
||||||
|
|
||||||
#if defined USE_DYNAMIC_TAG
|
#if defined USE_DYNAMIC_TAG
|
||||||
struct tag_head *tags;
|
struct tag_head *tags;
|
||||||
#else
|
#else
|
||||||
@@ -175,7 +177,8 @@ INT8 ir_binary_open(const UINT8 category, const UINT8 sub_category, UINT8* binar
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UINT16 ir_decode(UINT8 key_code, UINT16* user_data, t_remote_ac_status* ac_status, BOOL change_wind_direction)
|
UINT16 ir_decode(UINT8 key_code, UINT16* user_data,
|
||||||
|
t_remote_ac_status* ac_status, BOOL change_wind_direction)
|
||||||
{
|
{
|
||||||
if (IR_TYPE_COMMANDS == ir_binary_type)
|
if (IR_TYPE_COMMANDS == ir_binary_type)
|
||||||
{
|
{
|
||||||
@@ -187,6 +190,13 @@ UINT16 ir_decode(UINT8 key_code, UINT16* user_data, t_remote_ac_status* ac_statu
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
ir_printf("ac status is not null in decode core : power = %d, mode = %d, "
|
||||||
|
"temp = %d, wind_dir = %d, wind_speed = %d, "
|
||||||
|
"keycode = %d, change_wind_direction = %d\n",
|
||||||
|
ac_status->ac_power, ac_status->ac_mode,
|
||||||
|
ac_status->ac_temp, ac_status->ac_wind_dir,
|
||||||
|
ac_status->ac_wind_speed,
|
||||||
|
key_code, change_wind_direction);
|
||||||
return ir_ac_control(*ac_status, user_data, key_code, change_wind_direction);
|
return ir_ac_control(*ac_status, user_data, key_code, change_wind_direction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -196,10 +206,12 @@ INT8 ir_close()
|
|||||||
{
|
{
|
||||||
if (IR_TYPE_COMMANDS == ir_binary_type)
|
if (IR_TYPE_COMMANDS == ir_binary_type)
|
||||||
{
|
{
|
||||||
|
ir_printf("tv binary close\n");
|
||||||
return ir_tv_binary_close();
|
return ir_tv_binary_close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ir_printf("ac binary close\n");
|
||||||
return ir_ac_binary_close();
|
return ir_ac_binary_close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -273,7 +285,7 @@ static INT8 ir_ac_binary_open(UINT8 *binary, UINT16 binary_length)
|
|||||||
return IR_DECODE_SUCCEEDED;
|
return IR_DECODE_SUCCEEDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UINT8 function_code,
|
static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UINT8 key_code,
|
||||||
BOOL change_wind_direction)
|
BOOL change_wind_direction)
|
||||||
{
|
{
|
||||||
UINT16 time_length = 0;
|
UINT16 time_length = 0;
|
||||||
@@ -282,6 +294,36 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN
|
|||||||
UINT16 i = 0;
|
UINT16 i = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
UINT8 function_code = 0;
|
||||||
|
|
||||||
|
switch(key_code)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
function_code = AC_FUNCTION_POWER;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
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 8:
|
||||||
|
function_code = AC_FUNCTION_TEMPERATURE_DOWN;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
function_code = AC_FUNCTION_WIND_SPEED;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
function_code = AC_FUNCTION_WIND_SWING;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (0 == context->default_code.len)
|
if (0 == context->default_code.len)
|
||||||
{
|
{
|
||||||
ir_printf("\ndefault code is empty\n");
|
ir_printf("\ndefault code is empty\n");
|
||||||
@@ -646,6 +688,25 @@ static INT8 ir_tv_binary_close()
|
|||||||
}
|
}
|
||||||
//////// TV End ////////
|
//////// TV End ////////
|
||||||
|
|
||||||
|
// combo decode for JNI which means call open, decode and then close in one JNI call
|
||||||
|
UINT16 ir_decode_combo(const UINT8 category, const UINT8 sub_category,
|
||||||
|
UINT8* binary, UINT16 binary_length,
|
||||||
|
UINT8 key_code, UINT16* user_data,
|
||||||
|
t_remote_ac_status* ac_status, BOOL change_wind_direction)
|
||||||
|
{
|
||||||
|
UINT16 decoded_length = 0;
|
||||||
|
if (IR_DECODE_SUCCEEDED ==
|
||||||
|
ir_binary_open(category, sub_category, binary, binary_length))
|
||||||
|
{
|
||||||
|
decoded_length = ir_decode(key_code, user_data, ac_status, change_wind_direction);
|
||||||
|
ir_close();
|
||||||
|
return decoded_length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if (defined BOARD_PC || defined BOARD_PC_DLL)
|
#if (defined BOARD_PC || defined BOARD_PC_DLL)
|
||||||
void ir_lib_free_inner_buffer()
|
void ir_lib_free_inner_buffer()
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ static void print_ir_time(t_ir_data *data, UINT8 key_index, UINT16 *ir_time)
|
|||||||
}
|
}
|
||||||
else if (ir_decode_flag == IRDA_DECODE_2_BITS)
|
else if (ir_decode_flag == IRDA_DECODE_2_BITS)
|
||||||
{
|
{
|
||||||
// for quanternary formatted code
|
// for quaternary formatted code
|
||||||
process_decode_number(key_code, data, 2, ir_time);
|
process_decode_number(key_code, data, 2, ir_time);
|
||||||
}
|
}
|
||||||
else if (ir_decode_flag == IRDA_DECODE_4_BITS)
|
else if (ir_decode_flag == IRDA_DECODE_4_BITS)
|
||||||
|
|||||||
BIN
jni-example/decodesdk/libs/ir_decode_0.2.1-linux-x64.so
Normal file
BIN
jni-example/decodesdk/libs/ir_decode_0.2.1-linux-x64.so
Normal file
Binary file not shown.
Binary file not shown.
@@ -49,7 +49,7 @@ public class IRDecode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private IRDecode() {
|
private IRDecode() {
|
||||||
String libPath = "/data/irext/libirda_decoder.so";
|
String libPath = "/data/irext/ir_decode_0.2.1-linux-x64.so";
|
||||||
System.out.println("loading decode library " + libPath);
|
System.out.println("loading decode library " + libPath);
|
||||||
System.load(libPath);
|
System.load(libPath);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,168 @@ extern "C"
|
|||||||
#define SUB_CATEGORY_QUATERNARY 0
|
#define SUB_CATEGORY_QUATERNARY 0
|
||||||
#define SUB_CATEGORY_HEXADECIMAL 1
|
#define SUB_CATEGORY_HEXADECIMAL 1
|
||||||
|
|
||||||
|
// remote control key definition
|
||||||
|
#define KEY_TV_POWER 0
|
||||||
|
#define KEY_TV_MUTE 1
|
||||||
|
#define KEY_TV_UP 2
|
||||||
|
#define KEY_TV_DOWN 3
|
||||||
|
#define KEY_TV_LEFT 4
|
||||||
|
#define KEY_TV_RIGHT 5
|
||||||
|
#define KEY_TV_OK 6
|
||||||
|
#define KEY_TV_VOL_PLUS 7
|
||||||
|
#define KEY_TV_VOL_MINUS 8
|
||||||
|
#define KEY_TV_BACK 9
|
||||||
|
#define KEY_TV_INPUT 10
|
||||||
|
#define KEY_TV_MENU 11
|
||||||
|
#define KEY_TV_HOME 12
|
||||||
|
#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_WIND_SPEED 9
|
||||||
|
#define KEY_AC_WIND_DIRECTION 10
|
||||||
|
|
||||||
|
#define KEY_STB_POWER 0
|
||||||
|
#define KEY_STB_MUTE 1
|
||||||
|
#define KEY_STB_UP 2
|
||||||
|
#define KEY_STB_DOWN 3
|
||||||
|
#define KEY_STB_LEFT 4
|
||||||
|
#define KEY_STB_RIGHT 5
|
||||||
|
#define KEY_STB_OK 6
|
||||||
|
#define KEY_STB_VOL_PLUS 7
|
||||||
|
#define KEY_STB_VOL_MINUS 8
|
||||||
|
#define KEY_STB_BACK 9
|
||||||
|
#define KEY_STB_INPUT 10
|
||||||
|
#define KEY_STB_MENU 11
|
||||||
|
#define KEY_STB_PAGE_UP 12
|
||||||
|
#define KEY_STB_PAGE_DOWN 13
|
||||||
|
|
||||||
|
#define KEY_NETBOX_POWER 0
|
||||||
|
#define KEY_NETBOX_UP 1
|
||||||
|
#define KEY_NETBOX_DOWN 2
|
||||||
|
#define KEY_NETBOX_LEFT 3
|
||||||
|
#define KEY_NETBOX_RIGHT 4
|
||||||
|
#define KEY_NETBOX_OK 5
|
||||||
|
#define KEY_NETBOX_VOL_PLUS 6
|
||||||
|
#define KEY_NETBOX_VOL_MINUS 7
|
||||||
|
#define KEY_NETBOX_BACK 8
|
||||||
|
#define KEY_NETBOX_MENU 9
|
||||||
|
#define KEY_NETBOX_HOME 10
|
||||||
|
|
||||||
|
#define KEY_IPTV_POWER 0
|
||||||
|
#define KEY_IPTV_MUTE 1
|
||||||
|
#define KEY_IPTV_UP 2
|
||||||
|
#define KEY_IPTV_DOWN 3
|
||||||
|
#define KEY_IPTV_LEFT 4
|
||||||
|
#define KEY_IPTV_RIGHT 5
|
||||||
|
#define KEY_IPTV_OK 6
|
||||||
|
#define KEY_IPTV_VOL_PLUS 7
|
||||||
|
#define KEY_IPTV_VOL_MINUS 8
|
||||||
|
#define KEY_IPTV_BACK 9
|
||||||
|
#define KEY_IPTV_INPUT 10
|
||||||
|
#define KEY_IPTV_MENU 11
|
||||||
|
#define KEY_IPTV_PAGE_UP 12
|
||||||
|
#define KEY_IPTV_PAGE_DOWN 13
|
||||||
|
|
||||||
|
#define KEY_DVD_POWER 0
|
||||||
|
#define KEY_DVD_UP 1
|
||||||
|
#define KEY_DVD_DOWN 2
|
||||||
|
#define KEY_DVD_LEFT 3
|
||||||
|
#define KEY_DVD_RIGHT 4
|
||||||
|
#define KEY_DVD_OK 5
|
||||||
|
#define KEY_DVD_VOL_PLUS 6
|
||||||
|
#define KEY_DVD_VOL_MINUS 7
|
||||||
|
#define KEY_DVD_PLAY 8
|
||||||
|
#define KEY_DVD_PAUSE 9
|
||||||
|
#define KEY_DVD_EJECT 10
|
||||||
|
#define KEY_DVD_REWIND 11
|
||||||
|
#define KEY_DVD_FASTFORWARD 12
|
||||||
|
#define KEY_DVD_MENU 13
|
||||||
|
|
||||||
|
#define KEY_FAN_POWER 0
|
||||||
|
#define KEY_FAN_WIND_PLUS 6
|
||||||
|
#define KEY_FAN_WIND_MUNIS 7
|
||||||
|
#define KEY_FAN_SWING 8
|
||||||
|
#define KEY_FAN_WIND_SPEED 9
|
||||||
|
#define KEY_FAN_WIND_TYPE 10
|
||||||
|
|
||||||
|
#define KEY_PROJECTOR_POWER 0
|
||||||
|
#define KEY_PROJECTOR_UP 1
|
||||||
|
#define KEY_PROJECTOR_DOWN 2
|
||||||
|
#define KEY_PROJECTOR_LEFT 3
|
||||||
|
#define KEY_PROJECTOR_RIGHT 4
|
||||||
|
#define KEY_PROJECTOR_OK 5
|
||||||
|
#define KEY_PROJECTOR_VOL_PLUS 6
|
||||||
|
#define KEY_PROJECTOR_VOL_MINUS 7
|
||||||
|
#define KEY_PROJECTOR_ZOOM_OUT 8
|
||||||
|
#define KEY_PROJECTOR_MENU 9
|
||||||
|
#define KEY_PROJECTOR_ZOOM_IN 10
|
||||||
|
#define KEY_PROJECTOR_BACK 11
|
||||||
|
|
||||||
|
#define KEY_STEREO_POWER 0
|
||||||
|
#define KEY_STEREO_UP 1
|
||||||
|
#define KEY_STEREO_DOWN 2
|
||||||
|
#define KEY_STEREO_LEFT 3
|
||||||
|
#define KEY_STEREO_RIGHT 4
|
||||||
|
#define KEY_STEREO_OK 5
|
||||||
|
#define KEY_STEREO_VOL_PLUS 6
|
||||||
|
#define KEY_STEREO_VOL_MINUS 7
|
||||||
|
#define KEY_STEREO_MUTE 8
|
||||||
|
#define KEY_STEREO_MENU 9
|
||||||
|
|
||||||
|
#define KEY_BULB_POWER 0
|
||||||
|
#define KEY_BULB_COLOR_1 1
|
||||||
|
#define KEY_BULB_COLOR_2 2
|
||||||
|
#define KEY_BULB_COLOR_3 3
|
||||||
|
#define KEY_BULB_COLOR_4 4
|
||||||
|
#define KEY_BULB_COLOR_0 5
|
||||||
|
#define KEY_BULB_BRIGHT_PLUS 6
|
||||||
|
#define KEY_BULB_BRIGHT_MINUS 7
|
||||||
|
#define KEY_BULB_BRIGHT_POWER_ON 8
|
||||||
|
#define KEY_BULB_BRIGHT_RAINBOW 9
|
||||||
|
#define KEY_BULB_BRIGHT_POWER_OFF 10
|
||||||
|
|
||||||
|
#define KEY_CLEANROBOT_POWER 0
|
||||||
|
#define KEY_CLEANROBOT_FOWWARD 1
|
||||||
|
#define KEY_CLEANROBOT_BACKWARD 2
|
||||||
|
#define KEY_CLEANROBOT_LEFT 3
|
||||||
|
#define KEY_CLEANROBOT_RIGHT 4
|
||||||
|
#define KEY_CLEANROBOT_START 5
|
||||||
|
#define KEY_CLEANROBOT_STOP 6
|
||||||
|
#define KEY_CLEANROBOT_AUTO 8
|
||||||
|
#define KEY_CLEANROBOT_SPOT 9
|
||||||
|
#define KEY_CLEANROBOT_SPEED 10
|
||||||
|
#define KEY_CLEANROBOT_TIMER 11
|
||||||
|
#define KEY_CLEANROBOT_CHARGE 12
|
||||||
|
#define KEY_CLEANROBOT_PRESERVE 13
|
||||||
|
|
||||||
|
#define KEY_AIRCLEANER_POWER 0
|
||||||
|
#define KEY_AIRCLEANER_ION 5
|
||||||
|
#define KEY_AIRCLEANER_AUTO 8
|
||||||
|
#define KEY_AIRCLEANER_WIND_SPEED 9
|
||||||
|
#define KEY_AIRCLEANER_MODE_SWITCH 10
|
||||||
|
#define KEY_AIRCLEANER_TIMER 11
|
||||||
|
#define KEY_AIRCLEANER_LIGHT 12
|
||||||
|
#define KEY_AIRCLEANER_FORCE 13
|
||||||
|
|
||||||
|
#define KEY_DYSON_POWER 0
|
||||||
|
#define KEY_DYSON_WIND_SPEED_PLUS 1
|
||||||
|
#define KEY_DYSON_WIND_SPEED_MINUS 2
|
||||||
|
#define KEY_DYSON_TIMER_MINUS 3
|
||||||
|
#define KEY_DYSON_TIMER_PLUS 4
|
||||||
|
#define KEY_DYSON_AUTO 5
|
||||||
|
#define KEY_DYSON_TEMP_PLUS 6
|
||||||
|
#define KEY_DYSON_TEMP_MINUS 7
|
||||||
|
#define KEY_DYSON_SWING 8
|
||||||
|
#define KEY_DYSON_DIFFUSION 9
|
||||||
|
#define KEY_DYSON_FAV 10
|
||||||
|
#define KEY_DYSON_TIMER 11
|
||||||
|
#define KEY_DYSON_SLEEP 12
|
||||||
|
#define KEY_DYSON_COOL 13
|
||||||
|
|
||||||
|
|
||||||
// exported functions
|
// exported functions
|
||||||
/**
|
/**
|
||||||
* function ir_file_open
|
* function ir_file_open
|
||||||
@@ -153,6 +315,12 @@ extern INT8 get_supported_wind_direction(UINT8 *supported_wind_direction);
|
|||||||
extern void ir_lib_free_inner_buffer();
|
extern void ir_lib_free_inner_buffer();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// this function is preferred being called by JNI only
|
||||||
|
UINT16 ir_decode_combo(const UINT8 category, const UINT8 sub_category,
|
||||||
|
UINT8* binary, UINT16 binary_length,
|
||||||
|
UINT8 key_code, UINT16* user_data,
|
||||||
|
t_remote_ac_status* ac_status, BOOL change_wind_direction);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -32,6 +32,11 @@ extern "C"
|
|||||||
#define FORMAT_HEX 16
|
#define FORMAT_HEX 16
|
||||||
#define FORMAT_DECIMAL 10
|
#define FORMAT_DECIMAL 10
|
||||||
|
|
||||||
|
// #define USE_DYNAMIC_TAG 1
|
||||||
|
|
||||||
|
#if defined USE_DYNAMIC_TAG
|
||||||
|
#include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef unsigned char UINT8;
|
typedef unsigned char UINT8;
|
||||||
typedef signed char INT8;
|
typedef signed char INT8;
|
||||||
@@ -54,12 +59,13 @@ void noprint(const char *fmt, ...);
|
|||||||
#define ir_memcpy(A, B, C) memcpy(A, B, C)
|
#define ir_memcpy(A, B, C) memcpy(A, B, C)
|
||||||
#define ir_memset(A, B, C) memset(A, B, C)
|
#define ir_memset(A, B, C) memset(A, B, C)
|
||||||
#define ir_strlen(A) strlen(A)
|
#define ir_strlen(A) strlen(A)
|
||||||
#if (defined BOARD_PC) && (!defined BOARD_PC_JNI)
|
#if ((defined BOARD_PC) || (defined BOARD_PC_JNI)) && (defined DEBUG)
|
||||||
#define ir_printf printf
|
#define ir_printf printf
|
||||||
#else
|
#else
|
||||||
#define ir_printf noprint
|
#define ir_printf noprint
|
||||||
#endif
|
#endif
|
||||||
#define USER_DATA_SIZE 1636
|
#define USER_DATA_SIZE 1636
|
||||||
|
// #define USER_DATA_SIZE 4096
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -495,6 +495,11 @@ static INT8 apply_checksum_spec_byte_onebyte(UINT8 *ac_code, t_tag_checksum_data
|
|||||||
|
|
||||||
static UINT8 has_function(struct ac_protocol *protocol, UINT8 function)
|
static UINT8 has_function(struct ac_protocol *protocol, UINT8 function)
|
||||||
{
|
{
|
||||||
|
if (function < AC_FUNCTION_POWER || function > AC_FUNCTION_WIND_FIX)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (0 != protocol->function1.len)
|
if (0 != protocol->function1.len)
|
||||||
{
|
{
|
||||||
if (0 != protocol->function1.comp_data[function - 1].seg_len)
|
if (0 != protocol->function1.comp_data[function - 1].seg_len)
|
||||||
@@ -518,6 +523,11 @@ INT8 apply_function(struct ac_protocol *protocol, UINT8 function)
|
|||||||
{
|
{
|
||||||
UINT16 i = 0;
|
UINT16 i = 0;
|
||||||
|
|
||||||
|
if (function < AC_FUNCTION_POWER || function > AC_FUNCTION_WIND_FIX)
|
||||||
|
{
|
||||||
|
return IR_DECODE_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
// function index starts from 1 (AC_FUNCTION_POWER), do -1 operation at first
|
// function index starts from 1 (AC_FUNCTION_POWER), do -1 operation at first
|
||||||
if (0 == protocol->function1.len)
|
if (0 == protocol->function1.len)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ Revision log:
|
|||||||
struct ir_bin_buffer binary_file;
|
struct ir_bin_buffer binary_file;
|
||||||
struct ir_bin_buffer *p_ir_buffer = &binary_file;
|
struct ir_bin_buffer *p_ir_buffer = &binary_file;
|
||||||
|
|
||||||
|
const char* release = "0.2.1";
|
||||||
|
|
||||||
#if defined USE_DYNAMIC_TAG
|
#if defined USE_DYNAMIC_TAG
|
||||||
struct tag_head *tags;
|
struct tag_head *tags;
|
||||||
#else
|
#else
|
||||||
@@ -53,12 +55,19 @@ lp_apply_ac_parameter apply_table[AC_APPLY_MAX] =
|
|||||||
};
|
};
|
||||||
|
|
||||||
// static functions declarations
|
// static functions declarations
|
||||||
|
#if !defined NO_FS
|
||||||
static INT8 ir_ac_file_open(const char *file_name);
|
static INT8 ir_ac_file_open(const char *file_name);
|
||||||
|
#endif
|
||||||
|
|
||||||
static INT8 ir_ac_binary_open(UINT8 *binary, UINT16 binary_length);
|
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,
|
static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UINT8 function_code,
|
||||||
BOOL change_wind_direction);
|
BOOL change_wind_direction);
|
||||||
static INT8 ir_ac_binary_close();
|
static INT8 ir_ac_binary_close();
|
||||||
|
|
||||||
|
#if !defined NO_FS
|
||||||
static INT8 ir_tv_file_open(const char *file_name);
|
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_open(UINT8 *binary, UINT16 binary_length);
|
||||||
static INT8 ir_tv_binary_parse(UINT8 ir_hex_encode);
|
static INT8 ir_tv_binary_parse(UINT8 ir_hex_encode);
|
||||||
static UINT16 ir_tv_control(UINT8 key, UINT16 *l_user_data);
|
static UINT16 ir_tv_control(UINT8 key, UINT16 *l_user_data);
|
||||||
@@ -118,7 +127,7 @@ INT8 ir_file_open(const UINT8 category, const UINT8 sub_category, const char* fi
|
|||||||
#else
|
#else
|
||||||
INT8 ir_file_open(const UINT8 category, const UINT8 sub_category, const char* file_name)
|
INT8 ir_file_open(const UINT8 category, const UINT8 sub_category, const char* file_name)
|
||||||
{
|
{
|
||||||
return IR_DECODE_SUCCESS;
|
return IR_DECODE_SUCCEEDED;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -168,7 +177,8 @@ INT8 ir_binary_open(const UINT8 category, const UINT8 sub_category, UINT8* binar
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UINT16 ir_decode(UINT8 key_code, UINT16* user_data, t_remote_ac_status* ac_status, BOOL change_wind_direction)
|
UINT16 ir_decode(UINT8 key_code, UINT16* user_data,
|
||||||
|
t_remote_ac_status* ac_status, BOOL change_wind_direction)
|
||||||
{
|
{
|
||||||
if (IR_TYPE_COMMANDS == ir_binary_type)
|
if (IR_TYPE_COMMANDS == ir_binary_type)
|
||||||
{
|
{
|
||||||
@@ -180,6 +190,13 @@ UINT16 ir_decode(UINT8 key_code, UINT16* user_data, t_remote_ac_status* ac_statu
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
ir_printf("ac status is not null in decode core : power = %d, mode = %d, "
|
||||||
|
"temp = %d, wind_dir = %d, wind_speed = %d, "
|
||||||
|
"keycode = %d, change_wind_direction = %d\n",
|
||||||
|
ac_status->ac_power, ac_status->ac_mode,
|
||||||
|
ac_status->ac_temp, ac_status->ac_wind_dir,
|
||||||
|
ac_status->ac_wind_speed,
|
||||||
|
key_code, change_wind_direction);
|
||||||
return ir_ac_control(*ac_status, user_data, key_code, change_wind_direction);
|
return ir_ac_control(*ac_status, user_data, key_code, change_wind_direction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -189,10 +206,12 @@ INT8 ir_close()
|
|||||||
{
|
{
|
||||||
if (IR_TYPE_COMMANDS == ir_binary_type)
|
if (IR_TYPE_COMMANDS == ir_binary_type)
|
||||||
{
|
{
|
||||||
|
ir_printf("tv binary close\n");
|
||||||
return ir_tv_binary_close();
|
return ir_tv_binary_close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
ir_printf("ac binary close\n");
|
||||||
return ir_ac_binary_close();
|
return ir_ac_binary_close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,9 +225,9 @@ void ir_lib_free_inner_buffer();
|
|||||||
// static function definitions
|
// static function definitions
|
||||||
|
|
||||||
//////// AC Begin ////////
|
//////// AC Begin ////////
|
||||||
|
#if !defined NO_FS
|
||||||
static INT8 ir_ac_file_open(const char *file_name)
|
static INT8 ir_ac_file_open(const char *file_name)
|
||||||
{
|
{
|
||||||
#if !defined NO_FS
|
|
||||||
size_t ret = 0;
|
size_t ret = 0;
|
||||||
#if !defined WIN32
|
#if !defined WIN32
|
||||||
FILE *stream = fopen(file_name, "rb");
|
FILE *stream = fopen(file_name, "rb");
|
||||||
@@ -252,9 +271,9 @@ static INT8 ir_ac_file_open(const char *file_name)
|
|||||||
binary_length = 0;
|
binary_length = 0;
|
||||||
return IR_DECODE_FAILED;
|
return IR_DECODE_FAILED;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return IR_DECODE_SUCCEEDED;
|
return IR_DECODE_SUCCEEDED;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static INT8 ir_ac_binary_open(UINT8 *binary, UINT16 binary_length)
|
static INT8 ir_ac_binary_open(UINT8 *binary, UINT16 binary_length)
|
||||||
{
|
{
|
||||||
@@ -266,7 +285,7 @@ static INT8 ir_ac_binary_open(UINT8 *binary, UINT16 binary_length)
|
|||||||
return IR_DECODE_SUCCEEDED;
|
return IR_DECODE_SUCCEEDED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UINT8 function_code,
|
static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UINT8 key_code,
|
||||||
BOOL change_wind_direction)
|
BOOL change_wind_direction)
|
||||||
{
|
{
|
||||||
UINT16 time_length = 0;
|
UINT16 time_length = 0;
|
||||||
@@ -275,6 +294,36 @@ static UINT16 ir_ac_control(t_remote_ac_status ac_status, UINT16 *user_data, UIN
|
|||||||
UINT16 i = 0;
|
UINT16 i = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
UINT8 function_code = 0;
|
||||||
|
|
||||||
|
switch(key_code)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
function_code = AC_FUNCTION_POWER;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
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 8:
|
||||||
|
function_code = AC_FUNCTION_TEMPERATURE_DOWN;
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
function_code = AC_FUNCTION_WIND_SPEED;
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
function_code = AC_FUNCTION_WIND_SWING;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (0 == context->default_code.len)
|
if (0 == context->default_code.len)
|
||||||
{
|
{
|
||||||
ir_printf("\ndefault code is empty\n");
|
ir_printf("\ndefault code is empty\n");
|
||||||
@@ -543,9 +592,9 @@ INT8 get_supported_wind_direction(UINT8 *supported_wind_direction)
|
|||||||
//////// AC End ////////
|
//////// AC End ////////
|
||||||
|
|
||||||
//////// TV Begin ////////
|
//////// TV Begin ////////
|
||||||
|
#if !defined NO_FS
|
||||||
static INT8 ir_tv_file_open(const char *file_name)
|
static INT8 ir_tv_file_open(const char *file_name)
|
||||||
{
|
{
|
||||||
#if !defined NO_FS
|
|
||||||
size_t ret = 0;
|
size_t ret = 0;
|
||||||
|
|
||||||
#if !defined WIN32
|
#if !defined WIN32
|
||||||
@@ -590,9 +639,9 @@ static INT8 ir_tv_file_open(const char *file_name)
|
|||||||
binary_length = 0;
|
binary_length = 0;
|
||||||
return IR_DECODE_FAILED;
|
return IR_DECODE_FAILED;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
return IR_DECODE_SUCCEEDED;
|
return IR_DECODE_SUCCEEDED;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static INT8 ir_tv_binary_open(UINT8 *binary, UINT16 binary_length)
|
static INT8 ir_tv_binary_open(UINT8 *binary, UINT16 binary_length)
|
||||||
{
|
{
|
||||||
@@ -639,6 +688,25 @@ static INT8 ir_tv_binary_close()
|
|||||||
}
|
}
|
||||||
//////// TV End ////////
|
//////// TV End ////////
|
||||||
|
|
||||||
|
// combo decode for JNI which means call open, decode and then close in one JNI call
|
||||||
|
UINT16 ir_decode_combo(const UINT8 category, const UINT8 sub_category,
|
||||||
|
UINT8* binary, UINT16 binary_length,
|
||||||
|
UINT8 key_code, UINT16* user_data,
|
||||||
|
t_remote_ac_status* ac_status, BOOL change_wind_direction)
|
||||||
|
{
|
||||||
|
UINT16 decoded_length = 0;
|
||||||
|
if (IR_DECODE_SUCCEEDED ==
|
||||||
|
ir_binary_open(category, sub_category, binary, binary_length))
|
||||||
|
{
|
||||||
|
decoded_length = ir_decode(key_code, user_data, ac_status, change_wind_direction);
|
||||||
|
ir_close();
|
||||||
|
return decoded_length;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#if (defined BOARD_PC || defined BOARD_PC_DLL)
|
#if (defined BOARD_PC || defined BOARD_PC_DLL)
|
||||||
void ir_lib_free_inner_buffer()
|
void ir_lib_free_inner_buffer()
|
||||||
|
|||||||
@@ -315,7 +315,7 @@ static void print_ir_time(t_ir_data *data, UINT8 key_index, UINT16 *ir_time)
|
|||||||
}
|
}
|
||||||
else if (ir_decode_flag == IRDA_DECODE_2_BITS)
|
else if (ir_decode_flag == IRDA_DECODE_2_BITS)
|
||||||
{
|
{
|
||||||
// for quanternary formatted code
|
// for quaternary formatted code
|
||||||
process_decode_number(key_code, data, 2, ir_time);
|
process_decode_number(key_code, data, 2, ir_time);
|
||||||
}
|
}
|
||||||
else if (ir_decode_flag == IRDA_DECODE_4_BITS)
|
else if (ir_decode_flag == IRDA_DECODE_4_BITS)
|
||||||
|
|||||||
Reference in New Issue
Block a user