Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "com.csl.cs108ademoapp"
minSdkVersion 19
targetSdkVersion 30
versionCode 30
versionName "2.0.0"
versionCode 31
versionName "2.1.15"
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 30,
"versionName": "2.0.0",
"versionCode": 29,
"versionName": "2.1.1",
"outputFile": "app-release.apk"
}
]
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:requestLegacyExternalStorage="true"
android:theme="@style/AppTheme">

<service android:name="com.csl.cs108ademoapp.CustomIME"
<service android:name=".CustomIME"
android:label="@string/app_ime"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
Expand All @@ -26,7 +26,7 @@
</service>

<activity
android:name="com.csl.cs108ademoapp.MainActivity"
android:name=".MainActivity"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
43 changes: 28 additions & 15 deletions app/src/main/java/com/csl/cs108ademoapp/AccessTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,16 @@ void preExecute() {
//playerN.start();

buttonText = button.getText().toString().trim();
String buttonText1 = null; String strLastChar = buttonText.substring(buttonText.length()-1);
if (strLastChar.toUpperCase().matches("E")) {
buttonText1 = buttonText.substring(0, buttonText.length()-1);
} else if (buttonText.toUpperCase().matches("STOP")) {
buttonText1 = buttonText; buttonText1 += buttonText1.substring(buttonText.length()-1);
} else buttonText1 = buttonText;
String buttonText1 = ""; String strLastChar = "";
if (buttonText.length() != 0) {
strLastChar = buttonText.substring(buttonText.length() - 1);
if (strLastChar.toUpperCase().matches("E")) {
buttonText1 = buttonText.substring(0, buttonText.length() - 1);
} else if (buttonText.toUpperCase().matches("STOP")) {
buttonText1 = buttonText;
buttonText1 += buttonText1.substring(buttonText.length() - 1);
} else buttonText1 = buttonText;
}
if (repeat || buttonText.length() == 0) button.setText("Stop");
else {
if (Character.isUpperCase(strLastChar.charAt(0))) button.setText(buttonText1 + "ING");
Expand Down Expand Up @@ -188,24 +192,27 @@ protected String doInBackground(Void... a) {
Cs108Connector.Rx000pkgData rx000pkgData = MainActivity.mCs108Library4a.onRFIDEvent();
if (MainActivity.mCs108Library4a.mrfidToWriteSize() != 0) timeMillis = System.currentTimeMillis();
else if (rx000pkgData != null) {
//MainActivity.mCs108Library4a.appendToLog("rx000pkgData.responseType = " + rx000pkgData.responseType.toString());
if (rx000pkgData.responseType == null) {
publishProgress("null response");
} else if (rx000pkgData.responseType == Cs108Connector.HostCmdResponseTypes.TYPE_18K6C_TAG_ACCESS) {
if (true) {
if (rx000pkgData.decodedError == null) {
if (done == false) {
accessResult = rx000pkgData.decodedResult;
MainActivity.mCs108Library4a.appendToLog("StreamOut, accResult=" + accessResult);
//MainActivity.mCs108Library4a.appendToLog("StreamOut, accResult=" + accessResult);
if (updateRunnable != null) {
MainActivity.mCs108Library4a.appendToLog("StreamOut: start updateRunnable");
//MainActivity.mCs108Library4a.appendToLog("StreamOut: start updateRunnable");
mHandler.post(updateRunnable);
}
}
done = true;
publishProgress(null, rx000pkgData.decodedResult);
} else {
//MainActivity.mCs108Library4a.appendToLog("decodeError = " + rx000pkgData.decodedError + ", length = " + rx000pkgData.decodedError.length());
publishProgress(rx000pkgData.decodedError);
}
else publishProgress(rx000pkgData.decodedError);
iTimeOut = 500;
iTimeOut = 1000;
}
} else if (rx000pkgData.responseType == Cs108Connector.HostCmdResponseTypes.TYPE_COMMAND_END) {
if (rx000pkgData.decodedError != null) { endingMessaage = rx000pkgData.decodedError; ending = true; }
Expand All @@ -224,17 +231,16 @@ else if (repeat && (nextNew == false || resultError.length() != 0)) {
timeMillis = System.currentTimeMillis();
}
else if (notificationData != null) {
MainActivity.mCs108Library4a.appendToLog("resultError=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
//MainActivity.mCs108Library4a.appendToLog("resultError=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
publishProgress("Received notification uplink event 0xA101 with error code=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
timeMillis = System.currentTimeMillis();
iTimeOut = 500;
taskCancelReason = TaskCancelRReason.TIMEOUT;
}
if (System.currentTimeMillis() - timeMillis > iTimeOut) {
MainActivity.mCs108Library4a.appendToLog("endingMessage: iTimeout = " + iTimeOut);
//MainActivity.mCs108Library4a.appendToLog("endingMessage: iTimeout = " + iTimeOut);
taskCancelReason = TaskCancelRReason.TIMEOUT;
}
if (taskCancelReason != TaskCancelRReason.NULL) {
MainActivity.mCs108Library4a.appendToLog("taskCancelReason=" + TaskCancelRReason.values());
//MainActivity.mCs108Library4a.appendToLog("taskCancelReason=" + TaskCancelRReason.values());
cancel(true);
}
}
Expand All @@ -248,6 +254,7 @@ else if (notificationData != null) {
protected void onProgressUpdate(String... output) {
if (true) progressUpdate(output);
else if (output[0] != null) {
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[0] = " + output[0]);
if (output[0].length() == 2) {
if (output[0].contains("TT")) {
gotInventory = true;
Expand Down Expand Up @@ -275,6 +282,7 @@ else if (output[0] != null) {
taskCancelReason = TaskCancelRReason.ERROR;
}
} else {
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[1] = " + output[1]);
if (registerYield != null) {
if (tagInventoried != null) {
tagList.add(tagInventoried);
Expand Down Expand Up @@ -305,6 +313,7 @@ protected void onPostExecute(String result) {

protected void progressUpdate(String... output) {
if (output[0] != null) {
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[0] = " + output[0]);
if (output[0].length() == 2) {
if (output[0].contains("TT")) {
gotInventory = true;
Expand All @@ -331,6 +340,7 @@ protected void progressUpdate(String... output) {
MainActivity.mCs108Library4a.appendToLog("output[0]: " + output[0] + ", resultError = " + resultError);
}
} else {
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[1] = " + output[1]);
if (registerYield != null) {
if (tagInventoried != null) {
tagList.add(tagInventoried);
Expand Down Expand Up @@ -359,6 +369,9 @@ void DeviceConnectTask4RegisterEnding() {
strErrorMessage = "";
switch (taskCancelReason) {
case NULL:
if (accessResult == null) MainActivity.mCs108Library4a.appendToLog("taskCancelReason: NULL accessResult");
if (resultError != null) MainActivity.mCs108Library4a.appendToLog("taskCancelReason: resultError = " + resultError);
if (endingMessaage != null) MainActivity.mCs108Library4a.appendToLog("taskCancelReason: endingMessaage = " + endingMessaage);
if (accessResult == null || (resultError != null && resultError.length() != 0) || (endingMessaage != null && endingMessaage.length() != 0)) strErrorMessage += ("Finish as COMMAND END is received " + (gotInventory ? "WITH" : "WITHOUT") + " tag response");
//else Toast.makeText(MainActivity.mContext, R.string.toast_abort_by_SUCCESS, Toast.LENGTH_SHORT).show();
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ void inventoryHandler_tag() {
int extraLength = 0;
if (extra1Bank != -1 && rx000pkgData.decodedData1 != null) extraLength += rx000pkgData.decodedData1.length;
if (extra2Bank != -1 && rx000pkgData.decodedData2 != null) extraLength += rx000pkgData.decodedData2.length;
if (extraLength != 0 && MainActivity.mCs108Library4a.getcsModel() != 710) {
if (extraLength != 0) {
byte[] decodedEpcNew = new byte[rx000pkgData.decodedEpc.length - extraLength];
System.arraycopy(rx000pkgData.decodedEpc, 0, decodedEpcNew, 0, decodedEpcNew.length);
rx000pkgData.decodedEpc = decodedEpcNew;
Expand Down Expand Up @@ -650,6 +650,7 @@ public InventoryRfidTask(Context context, int extra1Bank, int extra2Bank, int da

boolean popRequest = false; Toast mytoast;
void DeviceConnectTask4InventoryEnding(TaskCancelRReason taskCancelRReason) {
MainActivity.mCs108Library4a.abortOperation(); //added in case previous command end is received with inventory stopped
MainActivity.mCs108Library4a.appendToLog("serverConnectValid = " + serverConnectValid);
if (serverConnectValid && ALLOW_RTSAVE) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
int phase = reader.getPhase();
String stringDetailB = null;
if (channel != 0 || phase != 0) {
//double dChannel = MainActivity.mCs108Library4a.getLogicalChannel2PhysicalFreq(reader.getChannel());
//stringDetailB = "Phase=" + phase + "\n" + dChannel + "MHz";
double dChannel = MainActivity.mCs108Library4a.getLogicalChannel2PhysicalFreq(reader.getChannel());
stringDetailB = "Phase=" + phase + "\n" + dChannel + "MHz";
}
if (stringDetailB != null) readerDetailB.setText(stringDetailB);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public void run() {
TextView productSerial = (TextView) getActivity().findViewById(R.id.module_productserialnumber);
TextView boardVersion = (TextView) getActivity().findViewById(R.id.module_boardversion);
TextView barcodeSerial = (TextView) getActivity().findViewById(R.id.moduleBar_serialNumber);
TextView barcodeDate = (TextView) getActivity().findViewById(R.id.moduleBar_date);
TextView barcodeVersion = (TextView) getActivity().findViewById(R.id.moduleBar_version);

TextView bluetoothVersion = (TextView) getActivity().findViewById(R.id.bluetooth_version);
TextView bluetoothAddress = (TextView) getActivity().findViewById(R.id.bluetooth_address);
Expand Down Expand Up @@ -99,7 +101,11 @@ public void run() {
productSerial.setText(MainActivity.mCs108Library4a.getHostProcessorICSerialNumber());
boardVersion.setText(MainActivity.mCs108Library4a.getHostProcessorICBoardVersion());
if (MainActivity.mCs108Library4a.isBarcodeFailure()) barcodeSerial.setText("Not available");
else barcodeSerial.setText(MainActivity.mCs108Library4a.getBarcodeSerial());
else {
barcodeSerial.setText(MainActivity.mCs108Library4a.getBarcodeSerial());
barcodeDate.setText(MainActivity.mCs108Library4a.getBarcodeDate());
barcodeVersion.setText(MainActivity.mCs108Library4a.getBarcodeVersion());
}
bluetoothAddress.setText(MainActivity.mCs108Library4a.getBluetoothDeviceAddress());
bluetoothRssi.setText(String.valueOf(MainActivity.mCs108Library4a.getRssi()));
} else {
Expand Down
Loading