updated win32 example with latest decode lib

This commit is contained in:
strawmanbobi
2026-01-10 19:47:47 +08:00
parent bf075bdec8
commit 9d25fa7145
24 changed files with 877 additions and 275 deletions

View File

@@ -26,15 +26,15 @@ extern "C"
#define MIN_TAG_LENGTH_TYPE_1 4
#define MIN_TAG_LENGTH_TYPE_2 6
INT8 apply_power(t_remote_ac_status ac_status, UINT8 function_code);
INT8 apply_power(t_remote_ac_status *ac_status, UINT8 function_code);
INT8 apply_mode(t_remote_ac_status ac_status, UINT8 function_code);
INT8 apply_mode(t_remote_ac_status *ac_status, UINT8 function_code);
INT8 apply_wind_speed(t_remote_ac_status ac_status, UINT8 function_code);
INT8 apply_wind_speed(t_remote_ac_status *ac_status, UINT8 function_code);
INT8 apply_swing(t_remote_ac_status ac_status, UINT8 function_code);
INT8 apply_swing(t_remote_ac_status *ac_status, UINT8 function_code);
INT8 apply_temperature(t_remote_ac_status ac_status, UINT8 function_code);
INT8 apply_temperature(t_remote_ac_status *ac_status, UINT8 function_code);
INT8 apply_function(struct ac_protocol *protocol, UINT8 function);

View File

@@ -342,7 +342,7 @@ typedef struct ac_protocol
UINT8 swing_status;
BOOL change_wind_direction;
UINT8 change_wind_direction;
UINT16 dc_cnt;
t_ac_bit_num bit_num[MAX_BITNUM];
@@ -382,10 +382,11 @@ typedef struct REMOTE_AC_STATUS
UINT8 ac_display;
UINT8 ac_sleep;
UINT8 ac_timer;
UINT8 change_wind_direction;
} t_remote_ac_status;
// function polymorphism
typedef INT8 (*lp_apply_ac_parameter)(t_remote_ac_status ac_status, UINT8 function_code);
typedef INT8 (*lp_apply_ac_parameter)(t_remote_ac_status *ac_status, UINT8 function_code);
#define TAG_AC_BOOT_CODE 1
#define TAG_AC_ZERO 2

View File

@@ -276,11 +276,10 @@ extern INT8 ir_binary_open(const UINT8 category, const UINT8 sub_category, UINT8
* parameters: key_code (in) - the code of pressed key
* user_data (out) - output decoded data in INT16 array format
* ac_status(in) - pointer to AC status (optional)
* change_wind_direction (in) - if control changes wind direction for AC (for AC only)
*
* returns: length of decoded data (0 indicates decode failure)
*/
extern UINT16 ir_decode(UINT8 key_code, UINT16* user_data, t_remote_ac_status* ac_status, BOOL change_wind_direction);
extern UINT16 ir_decode(UINT8 key_code, UINT16* user_data, t_remote_ac_status* ac_status);
/**
* function ir_close
@@ -362,7 +361,7 @@ extern void ir_lib_free_inner_buffer();
UINT16 ir_decode_combo(const UINT8 category, const UINT8 sub_category,
UINT8* binary, UINT16 bin_length,
UINT8 key_code, UINT16* user_data,
t_remote_ac_status* ac_status, BOOL change_wind_direction);
t_remote_ac_status* ac_status);
#ifdef __cplusplus
}

View File

@@ -0,0 +1,155 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#if defined BOARD_ANDROID
#include <jni.h>
#elif (defined BOARD_PC) && (defined BOARD_PC_JNI)
#include "include/jni.h"
#endif
/* Header for class net_irext_decode_sdk_IRDecode */
#ifndef _Included_net_irext_decode_sdk_IRDecode
#define _Included_net_irext_decode_sdk_IRDecode
#ifdef __cplusplus
extern "C" {
#endif
#undef net_irext_decode_sdk_IRDecode_BIND_ABOVE_CLIENT
#define net_irext_decode_sdk_IRDecode_BIND_ABOVE_CLIENT 8L
#undef net_irext_decode_sdk_IRDecode_BIND_ADJUST_WITH_ACTIVITY
#define net_irext_decode_sdk_IRDecode_BIND_ADJUST_WITH_ACTIVITY 128L
#undef net_irext_decode_sdk_IRDecode_BIND_ALLOW_OOM_MANAGEMENT
#define net_irext_decode_sdk_IRDecode_BIND_ALLOW_OOM_MANAGEMENT 16L
#undef net_irext_decode_sdk_IRDecode_BIND_AUTO_CREATE
#define net_irext_decode_sdk_IRDecode_BIND_AUTO_CREATE 1L
#undef net_irext_decode_sdk_IRDecode_BIND_DEBUG_UNBIND
#define net_irext_decode_sdk_IRDecode_BIND_DEBUG_UNBIND 2L
#undef net_irext_decode_sdk_IRDecode_BIND_IMPORTANT
#define net_irext_decode_sdk_IRDecode_BIND_IMPORTANT 64L
#undef net_irext_decode_sdk_IRDecode_BIND_NOT_FOREGROUND
#define net_irext_decode_sdk_IRDecode_BIND_NOT_FOREGROUND 4L
#undef net_irext_decode_sdk_IRDecode_BIND_WAIVE_PRIORITY
#define net_irext_decode_sdk_IRDecode_BIND_WAIVE_PRIORITY 32L
#undef net_irext_decode_sdk_IRDecode_CONTEXT_IGNORE_SECURITY
#define net_irext_decode_sdk_IRDecode_CONTEXT_IGNORE_SECURITY 2L
#undef net_irext_decode_sdk_IRDecode_CONTEXT_INCLUDE_CODE
#define net_irext_decode_sdk_IRDecode_CONTEXT_INCLUDE_CODE 1L
#undef net_irext_decode_sdk_IRDecode_CONTEXT_RESTRICTED
#define net_irext_decode_sdk_IRDecode_CONTEXT_RESTRICTED 4L
#undef net_irext_decode_sdk_IRDecode_MODE_APPEND
#define net_irext_decode_sdk_IRDecode_MODE_APPEND 32768L
#undef net_irext_decode_sdk_IRDecode_MODE_ENABLE_WRITE_AHEAD_LOGGING
#define net_irext_decode_sdk_IRDecode_MODE_ENABLE_WRITE_AHEAD_LOGGING 8L
#undef net_irext_decode_sdk_IRDecode_MODE_MULTI_PROCESS
#define net_irext_decode_sdk_IRDecode_MODE_MULTI_PROCESS 4L
#undef net_irext_decode_sdk_IRDecode_MODE_PRIVATE
#define net_irext_decode_sdk_IRDecode_MODE_PRIVATE 0L
#undef net_irext_decode_sdk_IRDecode_MODE_WORLD_READABLE
#define net_irext_decode_sdk_IRDecode_MODE_WORLD_READABLE 1L
#undef net_irext_decode_sdk_IRDecode_MODE_WORLD_WRITEABLE
#define net_irext_decode_sdk_IRDecode_MODE_WORLD_WRITEABLE 2L
#undef net_irext_decode_sdk_IRDecode_START_CONTINUATION_MASK
#define net_irext_decode_sdk_IRDecode_START_CONTINUATION_MASK 15L
#undef net_irext_decode_sdk_IRDecode_START_FLAG_REDELIVERY
#define net_irext_decode_sdk_IRDecode_START_FLAG_REDELIVERY 1L
#undef net_irext_decode_sdk_IRDecode_START_FLAG_RETRY
#define net_irext_decode_sdk_IRDecode_START_FLAG_RETRY 2L
#undef net_irext_decode_sdk_IRDecode_START_NOT_STICKY
#define net_irext_decode_sdk_IRDecode_START_NOT_STICKY 2L
#undef net_irext_decode_sdk_IRDecode_START_REDELIVER_INTENT
#define net_irext_decode_sdk_IRDecode_START_REDELIVER_INTENT 3L
#undef net_irext_decode_sdk_IRDecode_START_STICKY
#define net_irext_decode_sdk_IRDecode_START_STICKY 1L
#undef net_irext_decode_sdk_IRDecode_START_STICKY_COMPATIBILITY
#define net_irext_decode_sdk_IRDecode_START_STICKY_COMPATIBILITY 0L
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irOpen
* Signature: II(Ljava/lang/String;)
*/
JNIEXPORT jint JNICALL Java_net_irext_decode_sdk_IRDecode_irOpen
(JNIEnv *, jobject, jint, jint, jstring);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irOpenBinary
* Signature: II(Ljava/lang/String;)
*/
JNIEXPORT jint JNICALL Java_net_irext_decode_sdk_IRDecode_irOpenBinary
(JNIEnv *, jobject, jint, jint, jbyteArray, jint);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irDecode
* Signature: I(Lnet/irext/decodesdk/bean/ACStatus;I)[I
*/
JNIEXPORT jintArray JNICALL Java_net_irext_decode_sdk_IRDecode_irDecode
(JNIEnv *, jobject, jint, jobject);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irClose
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_net_irext_decode_sdk_IRDecode_irClose
(JNIEnv *, jobject);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irACGetTemperatureRange
* Signature: (I)Lcom/irext/remote/bean/jnibean/TemperatureRange;
*/
JNIEXPORT jobject JNICALL Java_net_irext_decode_sdk_IRDecode_irACGetTemperatureRange
(JNIEnv *, jobject, jint);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irACGetSupportedMode
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_net_irext_decode_sdk_IRDecode_irACGetSupportedMode
(JNIEnv *, jobject);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irACGetSupportedWindSpeed
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_net_irext_decode_sdk_IRDecode_irACGetSupportedWindSpeed
(JNIEnv *, jobject, jint);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irACGetSupportedSwing
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_net_irext_decode_sdk_IRDecode_irACGetSupportedSwing
(JNIEnv *, jobject, jint);
/*
* Class: net_irext_decode_sdk_IRDecode
* Method: irACGetSupportedWindDirection
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_net_irext_decode_sdk_IRDecode_irACGetSupportedWindDirection
(JNIEnv *, jobject);
JNIEXPORT jintArray JNICALL Java_net_irext_decode_sdk_IRDecode_irDecodeCombo
(JNIEnv *env, jobject this_obj, jint category_id, jint sub_cate,
jbyteArray binaries, jint bin_length,
jint key_code, jobject jni_ac_status);
#ifdef __cplusplus
}
#endif
#endif
/* Header for class net_irext_decode_sdk_IRDecode_LocalBinder */
#ifndef _Included_net_irext_decode_sdk_IRDecode_LocalBinder
#define _Included_net_irext_decode_sdk_IRDecode_LocalBinder
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -12,7 +12,7 @@ Revision log:
#ifndef _IR_DEFS_H
#define _IR_DEFS_H
#define IR_DECODE_LIB_VER "1.5.0"
#define IR_DECODE_LIB_VER "1.5.2"
#if defined (BOARD_PC)
#pragma ide diagnostic ignored "OCUnusedGlobalDeclarationInspection"
@@ -29,10 +29,6 @@ extern "C"
#define LOG_TAG "ir_decode"
#endif
#if defined BOARD_CC26XX
#include "OSAL.h"
#endif
#define TRUE 1
#define FALSE 0
@@ -55,13 +51,8 @@ typedef int BOOL;
void noprint(const char *fmt, ...);
#if defined BOARD_CC26XX
#define ir_malloc(A) ICall_malloc(A)
#define ir_free(A) ICall_free(A)
#else
#define ir_malloc(A) malloc(A)
#define ir_free(A) free(A)
#endif
#define ir_memcpy(A, B, C) memcpy(A, B, C)
#define ir_memset(A, B, C) memset(A, B, C)

View File

@@ -78,7 +78,7 @@ typedef struct ir_data
UINT8 index;
} t_ir_data;
#if !defined BOARD_51 && !defined BOARD_STM8
#if !defined BOARD_SOC
#pragma pack(1)
#endif
typedef struct ir_cycles
@@ -88,7 +88,7 @@ typedef struct ir_cycles
UINT16 space;
} t_ir_cycles;
#if !defined BOARD_51 && !defined BOARD_STM8
#if !defined BOARD_SOC
#pragma pack()
#endif