completed jni decode example

This commit is contained in:
strawmanbobi
2019-01-22 22:00:30 +08:00
parent faa3dbe174
commit db1610848a
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: net.irext.decodesdk.IRDecode

View File

@@ -113,4 +113,25 @@ public class IRDecode {
}
return retSupportedSwing;
}
public static void main(String[] args) {
int ret = 0;
System.out.println("This is IR decode test");
IRDecode irDecoder = IRDecode.getInstance();
if (Constants.ERROR_CODE_SUCCESS == irDecoder.irOpen(Constants.CategoryID.TV.getValue(),
1,
"/home/strawmanbobi/Downloads/test.bin")) {
int[] decoded =
irDecoder.decodeBinary(1, null, 0);
for (int i = 0; i < decoded.length; i++) {
System.out.print(decoded[i]);
if (i != decoded.length - 1) {
System.out.print(", ");
}
}
System.out.println();
irDecoder.irClose();
}
System.out.println("library open : " + ret);
}
}