refactored decode algorithms
This commit is contained in:
43
src/ir_decoder/include/ir_ac_apply.h
Normal file
43
src/ir_decoder/include/ir_ac_apply.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/**************************************************************************************************
|
||||
Filename: irda_ac_apply.h
|
||||
Revised: Date: 2016-10-12
|
||||
Revision: Revision: 1.0
|
||||
|
||||
Description: This file provides methods for AC IR applying functionalities
|
||||
|
||||
Revision log:
|
||||
* 2016-10-12: created by strawmanbobi
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef _IRDA_APPLY_H_
|
||||
#define _IRDA_APPLY_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "ir_decode.h"
|
||||
|
||||
#define MIN_TAG_LENGTH_TYPE_1 4
|
||||
#define MIN_TAG_LENGTH_TYPE_2 6
|
||||
|
||||
INT8 apply_power(remote_ac_status_t ac_status, UINT8 function_code);
|
||||
|
||||
INT8 apply_mode(remote_ac_status_t ac_status, UINT8 function_code);
|
||||
|
||||
INT8 apply_wind_speed(remote_ac_status_t ac_status, UINT8 function_code);
|
||||
|
||||
INT8 apply_swing(remote_ac_status_t ac_status, UINT8 function_code);
|
||||
|
||||
INT8 apply_temperature(remote_ac_status_t ac_status, UINT8 function_code);
|
||||
|
||||
INT8 apply_function(struct ac_protocol *protocol, UINT8 function);
|
||||
|
||||
INT8 apply_checksum(struct ac_protocol *protocol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //_IRDA_APPLY_H_
|
||||
35
src/ir_decoder/include/ir_ac_binary_parse.h
Normal file
35
src/ir_decoder/include/ir_ac_binary_parse.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/**************************************************************************************************
|
||||
Filename: irda_ac_binary_parse.h
|
||||
Revised: Date: 2017-01-03
|
||||
Revision: Revision: 1.0
|
||||
|
||||
Description: This file provides methods for AC binary parse
|
||||
|
||||
Revision log:
|
||||
* 2017-01-03: created by strawmanbobi
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef IRDA_DECODER_IR_AC_BINARY_PARSE_H
|
||||
#define IRDA_DECODER_IR_AC_BINARY_PARSE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "ir_defs.h"
|
||||
|
||||
extern INT8 binary_parse_offset();
|
||||
|
||||
extern INT8 binary_parse_len();
|
||||
|
||||
extern void binary_tags_info();
|
||||
|
||||
extern INT8 binary_parse_data();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif //IRDA_DECODER_IR_AC_BINARY_PARSE_H
|
||||
@@ -17,7 +17,7 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "irda_defs.h"
|
||||
#include "ir_defs.h"
|
||||
|
||||
extern UINT16 create_ir_frame();
|
||||
|
||||
31
src/ir_decoder/include/ir_ac_control.h
Normal file
31
src/ir_decoder/include/ir_ac_control.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/**************************************************************************************************
|
||||
Filename: irda_ac_control.h
|
||||
Revised: Date: 2016-12-31
|
||||
Revision: Revision: 1.0
|
||||
|
||||
Description: This file provides methods for AC IR control
|
||||
|
||||
Revision log:
|
||||
* 2016-10-12: created by strawmanbobi
|
||||
**************************************************************************************************/
|
||||
#ifndef IRDA_DECODER_IR_AC_CONTROL_H
|
||||
#define IRDA_DECODER_IR_AC_CONTROL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "ir_defs.h"
|
||||
|
||||
extern INT8 irda_ac_lib_parse();
|
||||
|
||||
extern INT8 free_ac_context();
|
||||
|
||||
extern BOOL is_solo_function(UINT8 function_code);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //IRDA_DECODER_IR_AC_CONTROL_H
|
||||
@@ -17,9 +17,9 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "irda_decode.h"
|
||||
#include "ir_decode.h"
|
||||
|
||||
extern INT8 parse_nmode(struct tag_head *tag, ac_n_mode index);
|
||||
extern INT8 parse_nmode(struct tag_head *tag, ac_n_mode index);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
@@ -17,7 +17,7 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "irda_decode.h"
|
||||
#include "ir_decode.h"
|
||||
|
||||
extern INT8 parse_bootcode(struct tag_head *tag);
|
||||
|
||||
@@ -17,11 +17,11 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "irda_decode.h"
|
||||
#include "ir_decode.h"
|
||||
|
||||
extern INT8 parse_common_ac_parameter(t_tag_head *tag, tag_comp *comp_data, UINT8 with_end, UINT8 type);
|
||||
|
||||
extern INT8 parse_defaultcode(struct tag_head *tag, ac_hex *default_code);
|
||||
extern INT8 parse_default_code(struct tag_head *tag, ac_hex *default_code);
|
||||
|
||||
extern INT8 parse_power_1(struct tag_head *tag, power_1 *power1);
|
||||
|
||||
@@ -18,7 +18,7 @@ extern "C"
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include "irda_defs.h"
|
||||
#include "ir_defs.h"
|
||||
|
||||
#define TAG_COUNT_FOR_PROTOCOL 29
|
||||
|
||||
@@ -437,15 +437,6 @@ extern UINT16 user_data[];
|
||||
|
||||
/* exported functions */
|
||||
///////////////////////////////////////////////// AC Begin /////////////////////////////////////////////////
|
||||
/*
|
||||
* function irda_context_init
|
||||
*
|
||||
* parameters:
|
||||
*
|
||||
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
|
||||
*/
|
||||
extern INT8 irda_context_init();
|
||||
|
||||
/*
|
||||
* function irda_ac_file_open
|
||||
*
|
||||
@@ -596,6 +587,11 @@ extern INT8 get_supported_swing(UINT8 ac_mode, UINT8* supported_swing);
|
||||
*/
|
||||
extern INT8 get_supported_wind_direction(UINT8* supported_wind_direction);
|
||||
|
||||
// private extern function
|
||||
#if (defined BOARD_PC || defined BOARD_PC_DLL)
|
||||
extern void irda_lib_free_inner_buffer();
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////// Utils End /////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -29,6 +29,8 @@ typedef unsigned char UINT8;
|
||||
typedef signed char INT8;
|
||||
typedef unsigned short UINT16;
|
||||
typedef signed short INT16;
|
||||
typedef signed int INT;
|
||||
typedef unsigned int UINT;
|
||||
typedef int BOOL;
|
||||
|
||||
#define irda_malloc(A) malloc(A)
|
||||
@@ -17,7 +17,7 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "irda_defs.h"
|
||||
#include "ir_defs.h"
|
||||
|
||||
#define STB_CHANNEL_OFFSET 14
|
||||
|
||||
@@ -17,8 +17,8 @@ extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "irda_defs.h"
|
||||
#include "irda_decode.h"
|
||||
#include "ir_defs.h"
|
||||
#include "ir_decode.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
/**************************************************************************************************
|
||||
Filename: irda_apply.h
|
||||
Revised: Date: 2016-10-12
|
||||
Revision: Revision: 1.0
|
||||
|
||||
Description: This file provides methods for AC IR applying functionalities
|
||||
|
||||
Revision log:
|
||||
* 2016-10-12: created by strawmanbobi
|
||||
**************************************************************************************************/
|
||||
|
||||
#ifndef _IRDA_APPLY_H_
|
||||
#define _IRDA_APPLY_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include "irda_decode.h"
|
||||
|
||||
#define MIN_TAG_LENGTH_TYPE_1 4
|
||||
#define MIN_TAG_LENGTH_TYPE_2 6
|
||||
|
||||
extern INT8 apply_ac_power(struct ac_protocol *protocol, UINT8 power_status);
|
||||
|
||||
extern INT8 apply_ac_mode(struct ac_protocol *protocol, UINT8 mode_status);
|
||||
|
||||
extern INT8 apply_ac_temperature(struct ac_protocol *protocol, UINT8 temperature);
|
||||
|
||||
extern INT8 apply_ac_wind_speed(struct ac_protocol *protocol, UINT8 wind_speed);
|
||||
|
||||
extern INT8 apply_ac_swing(struct ac_protocol *protocol, UINT8 swing_status);
|
||||
|
||||
extern INT8 apply_ac_function(struct ac_protocol *protocol, UINT8 function);
|
||||
|
||||
extern INT8 apply_checksum(struct ac_protocol *protocol);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //_IRDA_APPLY_H_
|
||||
@@ -1,160 +0,0 @@
|
||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class net_irext_remote_service_DecodeService */
|
||||
|
||||
#ifndef _Included_net_irext_remote_service_DecodeService
|
||||
#define _Included_net_irext_remote_service_DecodeService
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#undef net_irext_remote_service_DecodeService_BIND_ABOVE_CLIENT
|
||||
#define net_irext_remote_service_DecodeService_BIND_ABOVE_CLIENT 8L
|
||||
#undef net_irext_remote_service_DecodeService_BIND_ADJUST_WITH_ACTIVITY
|
||||
#define net_irext_remote_service_DecodeService_BIND_ADJUST_WITH_ACTIVITY 128L
|
||||
#undef net_irext_remote_service_DecodeService_BIND_ALLOW_OOM_MANAGEMENT
|
||||
#define net_irext_remote_service_DecodeService_BIND_ALLOW_OOM_MANAGEMENT 16L
|
||||
#undef net_irext_remote_service_DecodeService_BIND_AUTO_CREATE
|
||||
#define net_irext_remote_service_DecodeService_BIND_AUTO_CREATE 1L
|
||||
#undef net_irext_remote_service_DecodeService_BIND_DEBUG_UNBIND
|
||||
#define net_irext_remote_service_DecodeService_BIND_DEBUG_UNBIND 2L
|
||||
#undef net_irext_remote_service_DecodeService_BIND_IMPORTANT
|
||||
#define net_irext_remote_service_DecodeService_BIND_IMPORTANT 64L
|
||||
#undef net_irext_remote_service_DecodeService_BIND_NOT_FOREGROUND
|
||||
#define net_irext_remote_service_DecodeService_BIND_NOT_FOREGROUND 4L
|
||||
#undef net_irext_remote_service_DecodeService_BIND_WAIVE_PRIORITY
|
||||
#define net_irext_remote_service_DecodeService_BIND_WAIVE_PRIORITY 32L
|
||||
#undef net_irext_remote_service_DecodeService_CONTEXT_IGNORE_SECURITY
|
||||
#define net_irext_remote_service_DecodeService_CONTEXT_IGNORE_SECURITY 2L
|
||||
#undef net_irext_remote_service_DecodeService_CONTEXT_INCLUDE_CODE
|
||||
#define net_irext_remote_service_DecodeService_CONTEXT_INCLUDE_CODE 1L
|
||||
#undef net_irext_remote_service_DecodeService_CONTEXT_RESTRICTED
|
||||
#define net_irext_remote_service_DecodeService_CONTEXT_RESTRICTED 4L
|
||||
#undef net_irext_remote_service_DecodeService_MODE_APPEND
|
||||
#define net_irext_remote_service_DecodeService_MODE_APPEND 32768L
|
||||
#undef net_irext_remote_service_DecodeService_MODE_ENABLE_WRITE_AHEAD_LOGGING
|
||||
#define net_irext_remote_service_DecodeService_MODE_ENABLE_WRITE_AHEAD_LOGGING 8L
|
||||
#undef net_irext_remote_service_DecodeService_MODE_MULTI_PROCESS
|
||||
#define net_irext_remote_service_DecodeService_MODE_MULTI_PROCESS 4L
|
||||
#undef net_irext_remote_service_DecodeService_MODE_PRIVATE
|
||||
#define net_irext_remote_service_DecodeService_MODE_PRIVATE 0L
|
||||
#undef net_irext_remote_service_DecodeService_MODE_WORLD_READABLE
|
||||
#define net_irext_remote_service_DecodeService_MODE_WORLD_READABLE 1L
|
||||
#undef net_irext_remote_service_DecodeService_MODE_WORLD_WRITEABLE
|
||||
#define net_irext_remote_service_DecodeService_MODE_WORLD_WRITEABLE 2L
|
||||
#undef net_irext_remote_service_DecodeService_START_CONTINUATION_MASK
|
||||
#define net_irext_remote_service_DecodeService_START_CONTINUATION_MASK 15L
|
||||
#undef net_irext_remote_service_DecodeService_START_FLAG_REDELIVERY
|
||||
#define net_irext_remote_service_DecodeService_START_FLAG_REDELIVERY 1L
|
||||
#undef net_irext_remote_service_DecodeService_START_FLAG_RETRY
|
||||
#define net_irext_remote_service_DecodeService_START_FLAG_RETRY 2L
|
||||
#undef net_irext_remote_service_DecodeService_START_NOT_STICKY
|
||||
#define net_irext_remote_service_DecodeService_START_NOT_STICKY 2L
|
||||
#undef net_irext_remote_service_DecodeService_START_REDELIVER_INTENT
|
||||
#define net_irext_remote_service_DecodeService_START_REDELIVER_INTENT 3L
|
||||
#undef net_irext_remote_service_DecodeService_START_STICKY
|
||||
#define net_irext_remote_service_DecodeService_START_STICKY 1L
|
||||
#undef net_irext_remote_service_DecodeService_START_STICKY_COMPATIBILITY
|
||||
#define net_irext_remote_service_DecodeService_START_STICKY_COMPATIBILITY 0L
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACLibOpen
|
||||
* Signature: (Ljava/lang/String;)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_irext_remote_service_DecodeService_irdaACLibOpen
|
||||
(JNIEnv *, jobject, jstring);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACControl
|
||||
* Signature: (Lcom/irext/remote/bean/jnibean/JNIACStatus;II)[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_net_irext_remote_service_DecodeService_irdaACControl
|
||||
(JNIEnv *, jobject, jobject, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACLibClose
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_irext_remote_service_DecodeService_irdaACLibClose
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACGetTemperatureRange
|
||||
* Signature: (I)Lcom/irext/remote/bean/jnibean/JNITemperatureRange;
|
||||
*/
|
||||
JNIEXPORT jobject JNICALL Java_net_irext_remote_service_DecodeService_irdaACGetTemperatureRange
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACGetSupportedMode
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_irext_remote_service_DecodeService_irdaACGetSupportedMode
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACGetSupportedWindSpeed
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_irext_remote_service_DecodeService_irdaACGetSupportedWindSpeed
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACGetSupportedSwing
|
||||
* Signature: (I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_irext_remote_service_DecodeService_irdaACGetSupportedSwing
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaACGetSupportedWindDirection
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_irext_remote_service_DecodeService_irdaACGetSupportedWindDirection
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaTVLibOpen
|
||||
* Signature: (Ljava/lang/String;I)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_net_irext_remote_service_DecodeService_irdaTVLibOpen
|
||||
(JNIEnv *, jobject, jstring, jint);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaTVControl
|
||||
* Signature: (I)[I
|
||||
*/
|
||||
JNIEXPORT jintArray JNICALL Java_net_irext_remote_service_DecodeService_irdaTVControl
|
||||
(JNIEnv *, jobject, jint);
|
||||
|
||||
/*
|
||||
* Class: net_irext_remote_service_DecodeService
|
||||
* Method: irdaTVLibClose
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_net_irext_remote_service_DecodeService_irdaTVLibClose
|
||||
(JNIEnv *, jobject);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
/* Header for class net_irext_remote_service_DecodeService_LocalBinder */
|
||||
|
||||
#ifndef _Included_net_irext_remote_service_DecodeService_LocalBinder
|
||||
#define _Included_net_irext_remote_service_DecodeService_LocalBinder
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user