Skip to content

Commit 345b854

Browse files
authored
Merge pull request #21 from cslrfid/release-2.1.15
Release 2.1.15
2 parents d397ec2 + 54291b6 commit 345b854

23 files changed

+773
-1579
lines changed

app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
applicationId "com.csl.cs108ademoapp"
77
minSdkVersion 19
88
targetSdkVersion 30
9-
versionCode 30
10-
versionName "2.0.0"
9+
versionCode 31
10+
versionName "2.1.15"
1111
}
1212
}
1313

app/release/output-metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
{
1111
"type": "SINGLE",
1212
"filters": [],
13-
"versionCode": 30,
14-
"versionName": "2.0.0",
13+
"versionCode": 29,
14+
"versionName": "2.1.1",
1515
"outputFile": "app-release.apk"
1616
}
1717
]

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
android:requestLegacyExternalStorage="true"
1717
android:theme="@style/AppTheme">
1818

19-
<service android:name="com.csl.cs108ademoapp.CustomIME"
19+
<service android:name=".CustomIME"
2020
android:label="@string/app_ime"
2121
android:permission="android.permission.BIND_INPUT_METHOD">
2222
<intent-filter>
@@ -26,7 +26,7 @@
2626
</service>
2727

2828
<activity
29-
android:name="com.csl.cs108ademoapp.MainActivity"
29+
android:name=".MainActivity"
3030
android:screenOrientation="portrait">
3131
<intent-filter>
3232
<action android:name="android.intent.action.MAIN" />

app/src/main/java/com/csl/cs108ademoapp/AccessTask.java

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,16 @@ void preExecute() {
111111
//playerN.start();
112112

113113
buttonText = button.getText().toString().trim();
114-
String buttonText1 = null; String strLastChar = buttonText.substring(buttonText.length()-1);
115-
if (strLastChar.toUpperCase().matches("E")) {
116-
buttonText1 = buttonText.substring(0, buttonText.length()-1);
117-
} else if (buttonText.toUpperCase().matches("STOP")) {
118-
buttonText1 = buttonText; buttonText1 += buttonText1.substring(buttonText.length()-1);
119-
} else buttonText1 = buttonText;
114+
String buttonText1 = ""; String strLastChar = "";
115+
if (buttonText.length() != 0) {
116+
strLastChar = buttonText.substring(buttonText.length() - 1);
117+
if (strLastChar.toUpperCase().matches("E")) {
118+
buttonText1 = buttonText.substring(0, buttonText.length() - 1);
119+
} else if (buttonText.toUpperCase().matches("STOP")) {
120+
buttonText1 = buttonText;
121+
buttonText1 += buttonText1.substring(buttonText.length() - 1);
122+
} else buttonText1 = buttonText;
123+
}
120124
if (repeat || buttonText.length() == 0) button.setText("Stop");
121125
else {
122126
if (Character.isUpperCase(strLastChar.charAt(0))) button.setText(buttonText1 + "ING");
@@ -188,24 +192,27 @@ protected String doInBackground(Void... a) {
188192
Cs108Connector.Rx000pkgData rx000pkgData = MainActivity.mCs108Library4a.onRFIDEvent();
189193
if (MainActivity.mCs108Library4a.mrfidToWriteSize() != 0) timeMillis = System.currentTimeMillis();
190194
else if (rx000pkgData != null) {
195+
//MainActivity.mCs108Library4a.appendToLog("rx000pkgData.responseType = " + rx000pkgData.responseType.toString());
191196
if (rx000pkgData.responseType == null) {
192197
publishProgress("null response");
193198
} else if (rx000pkgData.responseType == Cs108Connector.HostCmdResponseTypes.TYPE_18K6C_TAG_ACCESS) {
194199
if (true) {
195200
if (rx000pkgData.decodedError == null) {
196201
if (done == false) {
197202
accessResult = rx000pkgData.decodedResult;
198-
MainActivity.mCs108Library4a.appendToLog("StreamOut, accResult=" + accessResult);
203+
//MainActivity.mCs108Library4a.appendToLog("StreamOut, accResult=" + accessResult);
199204
if (updateRunnable != null) {
200-
MainActivity.mCs108Library4a.appendToLog("StreamOut: start updateRunnable");
205+
//MainActivity.mCs108Library4a.appendToLog("StreamOut: start updateRunnable");
201206
mHandler.post(updateRunnable);
202207
}
203208
}
204209
done = true;
205210
publishProgress(null, rx000pkgData.decodedResult);
211+
} else {
212+
//MainActivity.mCs108Library4a.appendToLog("decodeError = " + rx000pkgData.decodedError + ", length = " + rx000pkgData.decodedError.length());
213+
publishProgress(rx000pkgData.decodedError);
206214
}
207-
else publishProgress(rx000pkgData.decodedError);
208-
iTimeOut = 500;
215+
iTimeOut = 1000;
209216
}
210217
} else if (rx000pkgData.responseType == Cs108Connector.HostCmdResponseTypes.TYPE_COMMAND_END) {
211218
if (rx000pkgData.decodedError != null) { endingMessaage = rx000pkgData.decodedError; ending = true; }
@@ -224,17 +231,16 @@ else if (repeat && (nextNew == false || resultError.length() != 0)) {
224231
timeMillis = System.currentTimeMillis();
225232
}
226233
else if (notificationData != null) {
227-
MainActivity.mCs108Library4a.appendToLog("resultError=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
234+
//MainActivity.mCs108Library4a.appendToLog("resultError=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
228235
publishProgress("Received notification uplink event 0xA101 with error code=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
229-
timeMillis = System.currentTimeMillis();
230-
iTimeOut = 500;
236+
taskCancelReason = TaskCancelRReason.TIMEOUT;
231237
}
232238
if (System.currentTimeMillis() - timeMillis > iTimeOut) {
233-
MainActivity.mCs108Library4a.appendToLog("endingMessage: iTimeout = " + iTimeOut);
239+
//MainActivity.mCs108Library4a.appendToLog("endingMessage: iTimeout = " + iTimeOut);
234240
taskCancelReason = TaskCancelRReason.TIMEOUT;
235241
}
236242
if (taskCancelReason != TaskCancelRReason.NULL) {
237-
MainActivity.mCs108Library4a.appendToLog("taskCancelReason=" + TaskCancelRReason.values());
243+
//MainActivity.mCs108Library4a.appendToLog("taskCancelReason=" + TaskCancelRReason.values());
238244
cancel(true);
239245
}
240246
}
@@ -248,6 +254,7 @@ else if (notificationData != null) {
248254
protected void onProgressUpdate(String... output) {
249255
if (true) progressUpdate(output);
250256
else if (output[0] != null) {
257+
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[0] = " + output[0]);
251258
if (output[0].length() == 2) {
252259
if (output[0].contains("TT")) {
253260
gotInventory = true;
@@ -275,6 +282,7 @@ else if (output[0] != null) {
275282
taskCancelReason = TaskCancelRReason.ERROR;
276283
}
277284
} else {
285+
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[1] = " + output[1]);
278286
if (registerYield != null) {
279287
if (tagInventoried != null) {
280288
tagList.add(tagInventoried);
@@ -305,6 +313,7 @@ protected void onPostExecute(String result) {
305313

306314
protected void progressUpdate(String... output) {
307315
if (output[0] != null) {
316+
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[0] = " + output[0]);
308317
if (output[0].length() == 2) {
309318
if (output[0].contains("TT")) {
310319
gotInventory = true;
@@ -331,6 +340,7 @@ protected void progressUpdate(String... output) {
331340
MainActivity.mCs108Library4a.appendToLog("output[0]: " + output[0] + ", resultError = " + resultError);
332341
}
333342
} else {
343+
MainActivity.mCs108Library4a.appendToLog("onProgressUpdate output[1] = " + output[1]);
334344
if (registerYield != null) {
335345
if (tagInventoried != null) {
336346
tagList.add(tagInventoried);
@@ -359,6 +369,9 @@ void DeviceConnectTask4RegisterEnding() {
359369
strErrorMessage = "";
360370
switch (taskCancelReason) {
361371
case NULL:
372+
if (accessResult == null) MainActivity.mCs108Library4a.appendToLog("taskCancelReason: NULL accessResult");
373+
if (resultError != null) MainActivity.mCs108Library4a.appendToLog("taskCancelReason: resultError = " + resultError);
374+
if (endingMessaage != null) MainActivity.mCs108Library4a.appendToLog("taskCancelReason: endingMessaage = " + endingMessaage);
362375
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");
363376
//else Toast.makeText(MainActivity.mContext, R.string.toast_abort_by_SUCCESS, Toast.LENGTH_SHORT).show();
364377
break;

app/src/main/java/com/csl/cs108ademoapp/InventoryRfidTask.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void inventoryHandler_tag() {
262262
int extraLength = 0;
263263
if (extra1Bank != -1 && rx000pkgData.decodedData1 != null) extraLength += rx000pkgData.decodedData1.length;
264264
if (extra2Bank != -1 && rx000pkgData.decodedData2 != null) extraLength += rx000pkgData.decodedData2.length;
265-
if (extraLength != 0 && MainActivity.mCs108Library4a.getcsModel() != 710) {
265+
if (extraLength != 0) {
266266
byte[] decodedEpcNew = new byte[rx000pkgData.decodedEpc.length - extraLength];
267267
System.arraycopy(rx000pkgData.decodedEpc, 0, decodedEpcNew, 0, decodedEpcNew.length);
268268
rx000pkgData.decodedEpc = decodedEpcNew;
@@ -650,6 +650,7 @@ public InventoryRfidTask(Context context, int extra1Bank, int extra2Bank, int da
650650

651651
boolean popRequest = false; Toast mytoast;
652652
void DeviceConnectTask4InventoryEnding(TaskCancelRReason taskCancelRReason) {
653+
MainActivity.mCs108Library4a.abortOperation(); //added in case previous command end is received with inventory stopped
653654
MainActivity.mCs108Library4a.appendToLog("serverConnectValid = " + serverConnectValid);
654655
if (serverConnectValid && ALLOW_RTSAVE) {
655656
try {

app/src/main/java/com/csl/cs108ademoapp/adapters/ReaderListAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ public View getView(int position, View convertView, ViewGroup parent) {
156156
int phase = reader.getPhase();
157157
String stringDetailB = null;
158158
if (channel != 0 || phase != 0) {
159-
//double dChannel = MainActivity.mCs108Library4a.getLogicalChannel2PhysicalFreq(reader.getChannel());
160-
//stringDetailB = "Phase=" + phase + "\n" + dChannel + "MHz";
159+
double dChannel = MainActivity.mCs108Library4a.getLogicalChannel2PhysicalFreq(reader.getChannel());
160+
stringDetailB = "Phase=" + phase + "\n" + dChannel + "MHz";
161161
}
162162
if (stringDetailB != null) readerDetailB.setText(stringDetailB);
163163
}

app/src/main/java/com/csl/cs108ademoapp/fragments/AboutFragment.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ public void run() {
7272
TextView productSerial = (TextView) getActivity().findViewById(R.id.module_productserialnumber);
7373
TextView boardVersion = (TextView) getActivity().findViewById(R.id.module_boardversion);
7474
TextView barcodeSerial = (TextView) getActivity().findViewById(R.id.moduleBar_serialNumber);
75+
TextView barcodeDate = (TextView) getActivity().findViewById(R.id.moduleBar_date);
76+
TextView barcodeVersion = (TextView) getActivity().findViewById(R.id.moduleBar_version);
7577

7678
TextView bluetoothVersion = (TextView) getActivity().findViewById(R.id.bluetooth_version);
7779
TextView bluetoothAddress = (TextView) getActivity().findViewById(R.id.bluetooth_address);
@@ -99,7 +101,11 @@ public void run() {
99101
productSerial.setText(MainActivity.mCs108Library4a.getHostProcessorICSerialNumber());
100102
boardVersion.setText(MainActivity.mCs108Library4a.getHostProcessorICBoardVersion());
101103
if (MainActivity.mCs108Library4a.isBarcodeFailure()) barcodeSerial.setText("Not available");
102-
else barcodeSerial.setText(MainActivity.mCs108Library4a.getBarcodeSerial());
104+
else {
105+
barcodeSerial.setText(MainActivity.mCs108Library4a.getBarcodeSerial());
106+
barcodeDate.setText(MainActivity.mCs108Library4a.getBarcodeDate());
107+
barcodeVersion.setText(MainActivity.mCs108Library4a.getBarcodeVersion());
108+
}
103109
bluetoothAddress.setText(MainActivity.mCs108Library4a.getBluetoothDeviceAddress());
104110
bluetoothRssi.setText(String.valueOf(MainActivity.mCs108Library4a.getRssi()));
105111
} else {

0 commit comments

Comments
 (0)