更新 src/android/ubxredscan.java

This commit is contained in:
2025-08-14 11:24:38 +08:00
parent 943779d6e3
commit 611dbff6d9
+3 -1
View File
@@ -140,7 +140,7 @@ public class ubxredscan extends CordovaPlugin {
return; return;
} }
} }
mScanManager.switchOutputMode(0); mScanManager.switchOutputMode(1);
IntentFilter filter = new IntentFilter(); IntentFilter filter = new IntentFilter();
int[] idbuf = new int[]{PropertyID.WEDGE_INTENT_ACTION_NAME, PropertyID.WEDGE_INTENT_DATA_STRING_TAG}; int[] idbuf = new int[]{PropertyID.WEDGE_INTENT_ACTION_NAME, PropertyID.WEDGE_INTENT_DATA_STRING_TAG};
String[] value_buf = mScanManager.getParameterString(idbuf); String[] value_buf = mScanManager.getParameterString(idbuf);
@@ -175,6 +175,7 @@ public class ubxredscan extends CordovaPlugin {
} }
if (mScanManager != null) { if (mScanManager != null) {
this.callbackContext = callbackContext; this.callbackContext = callbackContext;
mScanManager.switchOutputMode(0);
mScanManager.openScanner(); mScanManager.openScanner();
mScanManager.startDecode(); mScanManager.startDecode();
} }
@@ -187,6 +188,7 @@ public class ubxredscan extends CordovaPlugin {
} }
if (mScanManager != null) { if (mScanManager != null) {
mScanManager.stopDecode(); mScanManager.stopDecode();
mScanManager.switchOutputMode(1);
callbackContext.success("OK"); callbackContext.success("OK");
} }
} }