updated android example with ir_decoder 0.2.5

This commit is contained in:
strawmanbobi
2020-03-09 21:53:43 +08:00
parent 6a895fb37e
commit c8d2e3ad87
34 changed files with 504 additions and 320 deletions

View File

@@ -3,6 +3,9 @@ package net.irext.decode.sdk;
import net.irext.decode.sdk.bean.ACStatus;
import net.irext.decode.sdk.bean.TemperatureRange;
import net.irext.decode.sdk.utils.Constants;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.ServletContext;
/**
* Filename: IRDecode.java
@@ -18,12 +21,13 @@ public class IRDecode {
private static final String TAG = IRDecode.class.getSimpleName();
static {
System.loadLibrary("irdecode");
}
@Autowired
private static ServletContext context;
private static Object mSync = new Object();
private native String irGetVersion();
private native int irOpen(int category, int subCate, String fileName);
private native int irOpenBinary(int category, int subCate, byte[] binaries, int binLength);
@@ -51,6 +55,16 @@ public class IRDecode {
return mInstance;
}
private IRDecode() {
String libPath = "/data/irext/libirda_decoder.so";
System.out.println("loading decode library " + libPath);
System.load(libPath);
}
public String getVersion() {
return irGetVersion();
}
public int openFile(int category, int subCate, String fileName) {
return irOpen(category, subCate, fileName);
}