Skip to content

Commit ec9683e

Browse files
authored
Merge pull request #5 from cslrfid/release-1.14.0
RFMicron Temperature Tag Functions
2 parents 678e54d + 136d1ba commit ec9683e

File tree

50 files changed

+488
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+488
-230
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 26
9-
versionCode 18
10-
versionName "1.13.0"
9+
versionCode 19
10+
versionName "1.14.0"
1111
}
1212
compileOptions {
1313
sourceCompatibility JavaVersion.VERSION_1_7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

app/release/output.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":18,"versionName":"1.13.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
1+
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":19,"versionName":"1.14.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
import java.util.ArrayList;
1111

1212
public class AccessTask extends AsyncTask<Void, String, String> {
13-
final boolean DEBUG = false;
13+
final boolean DEBUG = true;
14+
final boolean skipSelect = false;
1415
public enum TaskCancelRReason {
1516
NULL, INVALD_REQUEST, DESTORY, STOP, BUTTON_RELEASE, TIMEOUT
1617
}
@@ -37,6 +38,7 @@ public enum TaskCancelRReason {
3738
private String endingMessaage;
3839
int qValue;
3940
boolean repeat, nextNew;
41+
boolean gotInventory;
4042
int batteryCountInventory_old;
4143

4244
public AccessTask(Button button, TextView textViewWriteCount, boolean invalidRequest,
@@ -53,7 +55,7 @@ public AccessTask(Button button, TextView textViewWriteCount, boolean invalidReq
5355
this.registerYield = registerYieldView;
5456
this.registerTotal = registerTotalView;
5557

56-
this.invalidRequest = invalidRequest;
58+
this.invalidRequest = invalidRequest; MainActivity.mCs108Library4a.appendToLog("invalidRequest = " + invalidRequest);
5759
this.selectMask = selectMask;
5860
this.selectBank = selectBank;
5961
this.selectOffset = selectOffset;
@@ -115,14 +117,17 @@ else if (hostCommand == Cs108Connector.HostCommands.CMD_18K6CKILL) {
115117
int matchRep = 0;
116118
if (repeat == false || nextNew) matchRep = 1;
117119
if (powerLevel < 0 || powerLevel > 330) invalidRequest = true;
120+
else if (skipSelect) { }
118121
else if (MainActivity.mCs108Library4a.setSelectedTag(null, selectMask, selectBank, selectOffset, powerLevel, qValue, matchRep) == false) {
119122
invalidRequest = true; MainActivity.mCs108Library4a.appendToLog("setSelectedTag is failed with selectMask = " + selectMask + ", selectBank = " + selectBank + ", selectOffset = " + selectOffset + ", powerLevel = " + powerLevel);
120123
}
121124
}
125+
gotInventory = false;
122126
taskCancelReason = TaskCancelRReason.NULL;
123127
if (invalidRequest) {
124128
cancel(true);
125129
taskCancelReason = TaskCancelRReason.INVALD_REQUEST;
130+
MainActivity.mCs108Library4a.appendToLog("invalidRequest A= " + invalidRequest);
126131
} else {
127132
if (MainActivity.mCs108Library4a.checkHostProcessorVersion(MainActivity.mCs108Library4a.getMacVer(), 2, 6, 8)) {
128133
MainActivity.mCs108Library4a.setInvModeCompact(false);
@@ -192,6 +197,7 @@ protected void onProgressUpdate(String... output) {
192197
if (output[0] != null) {
193198
if (output[0].length() == 2) {
194199
if (output[0].contains("TT")) {
200+
gotInventory = true;
195201
if (registerTagGot != null) registerTagGot.setText(output[1]);
196202
boolean matched = false;
197203
for (int i = 0; i < tagList.size(); i++) {
@@ -260,7 +266,7 @@ void DeviceConnectTask4RegisterEnding() {
260266
strErrorMessage = "";
261267
switch (taskCancelReason) {
262268
case NULL:
263-
if (accessResult == null || (resultError != null && resultError.length() != 0) || (endingMessaage != null && endingMessaage.length() != 0)) strErrorMessage += "Finish as COMMAND END is received";
269+
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");
264270
else Toast.makeText(MainActivity.mContext, R.string.toast_abort_by_SUCCESS, Toast.LENGTH_SHORT).show();
265271
break;
266272
case STOP:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public static DrawerPositions toDrawerPosition(int x) {
5757
addItem(new DrawerItem("8", "Security", R.drawable.dl_access));
5858
addItem(new DrawerItem("9", "Register Tag", R.drawable.dl_rr));
5959
addItem(new DrawerItem("10", "Cold Chain CS8300", R.drawable.dl_loc));
60-
addItem(new DrawerItem("11", "RFMicron Temperature", R.drawable.dl_loc));
60+
addItem(new DrawerItem("11", "RFMicron", R.drawable.dl_loc));
6161
addItem(new DrawerItem("12", "UCODE DNA", R.drawable.dl_loc));
6262
addItem(new DrawerItem("13", "Wedge", R.drawable.dl_rr));
6363
}

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ else if (output[0].contains("WW")) {
257257
String strEpc = MainActivity.mCs108Library4a.byteArrayToString(rx000pkgData.decodedEpc);
258258
String strExtra2 = null; if (rx000pkgData.decodedData2 != null) strExtra2 = MainActivity.mCs108Library4a.byteArrayToString(rx000pkgData.decodedData2);
259259
String strExtra1 = null; if (rx000pkgData.decodedData1 != null) strExtra1 = MainActivity.mCs108Library4a.byteArrayToString(rx000pkgData.decodedData1);
260+
String strAddresss = strEpc; // strEpc, strEpc + strExtra1 + strExtra2
260261
String strCrc16 = null; if (rx000pkgData.decodedCrc != null) strCrc16 = MainActivity.mCs108Library4a.byteArrayToString(rx000pkgData.decodedCrc);
261262
if (strExtra1 != null && strExtra1Filter != null) {
262263
MainActivity.mCs108Library4a.appendToLog("strEpc = " + strEpc + ", strExtra1 = " + strExtra1 + ", strExtra1Filter = " + strExtra1Filter + ", strExtra2 = " + strExtra2 );
@@ -300,7 +301,7 @@ else if (output[0].contains("WW")) {
300301
// MainActivity.mCs108Library4a.appendToLog("Matching Epc = " + strEpc);
301302
iMatchItem = -1;
302303
if (true) {
303-
int index = Collections.binarySearch(MainActivity.sharedObjects.tagsIndexList, new SharedObjects.TagsIndex(strEpc+strExtra1+strExtra2, 0));
304+
int index = Collections.binarySearch(MainActivity.sharedObjects.tagsIndexList, new SharedObjects.TagsIndex(strAddresss, 0));
304305
if (index >= 0) {
305306
iMatchItem = MainActivity.sharedObjects.tagsIndexList.size() - 1 - MainActivity.sharedObjects.tagsIndexList.get(index).getPosition();
306307
// MainActivity.mCs108Library4a.appendToLog("Binary matched index = " + index + ", iMatchItem = " + iMatchItem + ", Epc = " + tagsList.get(iMatchItem).getAddress());
@@ -322,6 +323,8 @@ else if (output[0].contains("WW")) {
322323
readerDevice.setRssi(rssi);
323324
readerDevice.setPhase(phase);
324325
readerDevice.setChannel(chidx);
326+
readerDevice.setExtra1(strExtra1, extra1Bank, data1_offset);
327+
MainActivity.mCs108Library4a.appendToLog("setExtra1 with strExtra1 = " + strExtra1);
325328
tagsList.set(iMatchItem, readerDevice);
326329
match = true;
327330
updated = true;
@@ -342,7 +345,7 @@ else if (output[0].contains("WW")) {
342345
1, rssi, phase, chidx);
343346
if (bAdd2End) tagsList.add(readerDevice);
344347
else tagsList.add(0, readerDevice);
345-
SharedObjects.TagsIndex tagsIndex = new SharedObjects.TagsIndex(strEpc+strExtra1+strExtra2, tagsList.size()-1); MainActivity.sharedObjects.tagsIndexList.add(tagsIndex); Collections.sort(MainActivity.sharedObjects.tagsIndexList);
348+
SharedObjects.TagsIndex tagsIndex = new SharedObjects.TagsIndex(strAddresss, tagsList.size()-1); MainActivity.sharedObjects.tagsIndexList.add(tagsIndex); Collections.sort(MainActivity.sharedObjects.tagsIndexList);
346349
if (serverConnectValid && ALLOW_RTSAVE && true) {
347350
try {
348351
// saveExternalTask = new SaveList2ExternalTask();

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ public class MicronAdapter extends FragmentStatePagerAdapter {
1616
public Fragment getItem(int index) {
1717
Fragment fragment = null;
1818
switch (index) {
19-
case 0:
19+
case 1:
2020
fragment = new AccessMicronFragment();
2121
fragment0 = fragment;
2222
break;
23-
case 1:
24-
fragment = InventoryRfidiMultiFragment.newInstance(true,"E28240", false);
23+
case 0:
24+
String mDid = "E282403"; //"E28240", "E282403"
25+
fragment = InventoryRfidiMultiFragment.newInstance(true, mDid, false);
2526
fragment1 = fragment;
2627
break;
2728
default:

0 commit comments

Comments
 (0)