fixed decode issues and could run on real device

This commit is contained in:
2017-05-14 20:13:14 +08:00
parent 79205bd92f
commit 2597719ffb
14 changed files with 9 additions and 14 deletions

View File

@@ -35,11 +35,11 @@ android {
}
dependencies {
compile files('libs/irext-web-api.jar')
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
compile project(':decodesdk')
compile files('libs/irext-web-api-0.1.1.jar')
}

View File

@@ -21,8 +21,8 @@ public class IRApplication extends com.activeandroid.app.Application {
private static final String TAG = IRApplication.class.getSimpleName();
private static final String ADDRESS = "http://192.168.137.128:8080";
private static final String APP_NAME = "/irext";
private static final String ADDRESS = "http://irext.net:8080";
private static final String APP_NAME = "/irext-server";
public WebAPIs mWeAPIs = WebAPIs.getInstance(ADDRESS, APP_NAME);

View File

@@ -134,13 +134,12 @@ public class ControlFragment extends Fragment implements View.OnClickListener {
mCurrentRemoteControl.getRemoteMap() + FileUtils.FILE_NAME_EXT;
/* decode SDK - load binary file */
// int ret = mIRDecode.openBinary(category, mCurrentRemoteControl.getSubCategory(), binFileName);
// Log.d(TAG, "open binary result = " + ret);
int ret = mIRDecode.openBinary(category, mCurrentRemoteControl.getSubCategory(), binFileName);
}
}
public void closeIRBinary() {
// mIRDecode.closeBinary();
mIRDecode.closeBinary();
}
@Nullable
@@ -199,8 +198,7 @@ public class ControlFragment extends Fragment implements View.OnClickListener {
/* translate key code for AC according to the mapping above */
/* ac status is useless for decoding devices other than AC, it's an optional parameter */
/* change wind dir is an optional parameter, set to 0 as default */
// return mIRDecode.decodeBinary(inputKeyCode, acStatus, 0);
return null;
return mIRDecode.decodeBinary(inputKeyCode, acStatus, 0);
}
// control
@@ -257,7 +255,9 @@ public class ControlFragment extends Fragment implements View.OnClickListener {
ConsumerIrManager irEmitter =
(ConsumerIrManager) mParent.getSystemService(Context.CONSUMER_IR_SERVICE);
if (irEmitter.hasIrEmitter()) {
irEmitter.transmit(38000, decoded);
if (null != decoded && decoded.length > 0) {
irEmitter.transmit(38000, decoded);
}
}
}

View File

@@ -8,11 +8,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="64dp"
android:textSize="24sp"
android:gravity="center"/>
<LinearLayout
android:layout_width="match_parent"

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB