updated decode library to version 1.5.2
This commit is contained in:
5
private-backend/.gitignore
vendored
5
private-backend/.gitignore
vendored
@@ -97,3 +97,8 @@ fabric.properties
|
||||
target
|
||||
private-backend.iml
|
||||
private-server.iml
|
||||
|
||||
# Downloaded bin cache
|
||||
bin_cache/
|
||||
bin_cache/*
|
||||
bin_cache/**
|
||||
|
||||
Binary file not shown.
@@ -27,12 +27,12 @@ public class IRDecode {
|
||||
|
||||
private native int irOpenBinary(int category, int subCate, byte[] binaries, int binLength);
|
||||
|
||||
private native int[] irDecode(int keyCode, ACStatus acStatus, int changeWindDirection);
|
||||
private native int[] irDecode(int keyCode, ACStatus acStatus);
|
||||
|
||||
private native void irClose();
|
||||
|
||||
private native int[] irDecodeCombo(int category, int subCate, byte[] binaries, int binLength,
|
||||
int keyCode, ACStatus acStatus, int changeWindDirection);
|
||||
int keyCode, ACStatus acStatus);
|
||||
|
||||
private native TemperatureRange irACGetTemperatureRange(int acMode);
|
||||
|
||||
@@ -71,22 +71,22 @@ public class IRDecode {
|
||||
return irOpenBinary(category, subCate, binaries, binLength);
|
||||
}
|
||||
|
||||
public int[] decodeBinary(int keyCode, ACStatus acStatus, int changeWindDir) {
|
||||
public int[] decodeBinary(int keyCode, ACStatus acStatus) {
|
||||
int[] decoded;
|
||||
synchronized (mSync) {
|
||||
acStatus = ensureACStatus(acStatus, keyCode);
|
||||
decoded = irDecode(keyCode, acStatus, changeWindDir);
|
||||
decoded = irDecode(keyCode, acStatus);
|
||||
}
|
||||
return decoded;
|
||||
}
|
||||
|
||||
public int[] decodeBinary(int category, int subCate, byte[] binaries, int binLength,
|
||||
int keyCode, ACStatus acStatus, int changeWindDir) {
|
||||
int keyCode, ACStatus acStatus) {
|
||||
int[] decoded;
|
||||
synchronized (mSync) {
|
||||
acStatus = ensureACStatus(acStatus, keyCode);
|
||||
decoded = irDecodeCombo(category, subCate, binaries, binLength,
|
||||
keyCode, acStatus, changeWindDir);
|
||||
keyCode, acStatus);
|
||||
}
|
||||
return decoded;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ public class ACStatus {
|
||||
private int acDisplay;
|
||||
private int acSleep;
|
||||
private int acTimer;
|
||||
private int changeWindDir;
|
||||
|
||||
public ACStatus() {
|
||||
this.acPower = Constants.ACPower.POWER_OFF.getValue();
|
||||
@@ -34,10 +35,11 @@ public class ACStatus {
|
||||
this.acTimer = 0;
|
||||
this.acDisplay = 0;
|
||||
this.acSleep = 0;
|
||||
this.changeWindDir = 0;
|
||||
}
|
||||
|
||||
public ACStatus(int acPower, int acMode, int acTemp, int acWindSpeed, int acWindDir,
|
||||
int acDisplay, int acSleep, int acTimer) {
|
||||
int acDisplay, int acSleep, int acTimer, int changeWindDir) {
|
||||
this.acPower = acPower;
|
||||
this.acTemp = acTemp;
|
||||
this.acMode = acMode;
|
||||
@@ -46,6 +48,7 @@ public class ACStatus {
|
||||
this.acDisplay = acDisplay;
|
||||
this.acSleep = acSleep;
|
||||
this.acTimer = acTimer;
|
||||
this.changeWindDir = changeWindDir;
|
||||
}
|
||||
|
||||
public int getAcPower() {
|
||||
@@ -112,4 +115,11 @@ public class ACStatus {
|
||||
this.acTimer = acTimer;
|
||||
}
|
||||
|
||||
public int getChangeWindDir() {
|
||||
return changeWindDir;
|
||||
}
|
||||
|
||||
public void setChangeWindDir(int changeWindDir) {
|
||||
this.changeWindDir = changeWindDir;
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -31,7 +31,7 @@ public class Constants {
|
||||
public static final String ERROR_CODE_INVALID_BRAND_TEXT = "invalid brand";
|
||||
public static final String ERROR_CODE_INVALID_PARAMETER_TEXT = "invalid parameter";
|
||||
|
||||
public static final String ERROR_CODE_INVALID_SESSION_TEXT = "invalid server session";
|
||||
public static final String ERROR_CODE_INVALID_SESSION_TEXT = "invalid decode session";
|
||||
|
||||
public enum CategoryID {
|
||||
AIR_CONDITIONER(1),
|
||||
@@ -46,7 +46,10 @@ public class Constants {
|
||||
LIGHT(10),
|
||||
BSTB(11),
|
||||
CLEANING_ROBOT(12),
|
||||
AIR_CLEANER(13);
|
||||
AIR_CLEANER(13),
|
||||
DYSON_SERIES(14),
|
||||
CAMERA(15),
|
||||
HEATER(16);
|
||||
|
||||
private final int id;
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ public class OperationLogic {
|
||||
IRDecode irDecode = IRDecode.getInstance();
|
||||
int ret = irDecode.openBinary(categoryId, subCate, binaryContent, binaryContent.length);
|
||||
if (0 == ret) {
|
||||
decoded = irDecode.decodeBinary(keyCode, acStatus, changeWindDirection);
|
||||
decoded = irDecode.decodeBinary(keyCode, acStatus);
|
||||
}
|
||||
irDecode.closeBinary();
|
||||
return decoded;
|
||||
@@ -270,7 +270,6 @@ public class OperationLogic {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private InputStream getBinInputStream(String fileName) {
|
||||
String downloadURL = IR_BIN_DOWNLOAD_PREFIX + fileName;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user