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
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ android {
minSdkVersion 19
targetSdkVersion 30
versionCode 31
versionName "2.1.15"
versionName "2.1.30"
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/csl/cs108ademoapp/AccessTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public enum TaskCancelRReason {
long timeMillis, startTimeMillis, runTimeMillis;
int accessError, backscatterError;
boolean timeoutError, crcError;
String resultError = "";
public String resultError = "";
boolean success;
boolean done = false;
boolean ending = false;
Expand Down Expand Up @@ -233,7 +233,7 @@ else if (repeat && (nextNew == false || resultError.length() != 0)) {
else if (notificationData != null) {
//MainActivity.mCs108Library4a.appendToLog("resultError=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
publishProgress("Received notification uplink event 0xA101 with error code=" + MainActivity.mCs108Library4a.byteArrayToString(notificationData));
taskCancelReason = TaskCancelRReason.TIMEOUT;
taskCancelReason = TaskCancelRReason.ERROR;
}
if (System.currentTimeMillis() - timeMillis > iTimeOut) {
//MainActivity.mCs108Library4a.appendToLog("endingMessage: iTimeout = " + iTimeOut);
Expand Down
78 changes: 63 additions & 15 deletions app/src/main/java/com/csl/cs108ademoapp/InventoryRfidTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ protected String doInBackground(Void... a) {
long firstTimeOld = 0, timeMillisSound = 0; int totalOld = 0;
@Override
protected void onProgressUpdate(String... output) {
if (false) MainActivity.mCs108Library4a.appendToLog("InventoryRfidTask: output[0] = " + output[0]);
if (output[0] != null) {
if (output[0].length() == 1) inventoryHandler_endReason();
else if (output[0].length() == 2) {
Expand Down Expand Up @@ -307,7 +308,7 @@ void inventoryHandler_tag() {
MainActivity.mCs108Library4a.appendToLog("HelloK: strMdid = " + strMdid + ", MainMdid = " + MainActivity.mDid + ", bFastId = " + bFastId);

int iPc = Integer.parseInt(strPc, 16);
String strXpc = null; int iSensorData = ReaderDevice.INVALID_SENSORDATA; if ((iPc & 0x0200) != 0) {
String strXpc = null; int iSensorData = ReaderDevice.INVALID_SENSORDATA; if ((iPc & 0x0200) != 0 && strEpc != null && strEpc.length() >= 8) {
int iXpcw1 = Integer.parseInt(strEpc.substring(0, 4), 16);
if ((iXpcw1 & 0x8000) != 0) {
strXpc = strEpc.substring(0, 8);
Expand Down Expand Up @@ -349,32 +350,72 @@ void inventoryHandler_tag() {
}
if (bValidFastId == false) return;
MainActivity.mCs108Library4a.appendToLog("HelloK: Doing IMPINJ Inventory with strMdid = " + strMdid + ", strEpc1 = " + strEpc1 + ":, strTid = " + strTid);
} else if (strMdid != null && MainActivity.mDid != null) {
} else if (MainActivity.mDid != null) {
MainActivity.mCs108Library4a.appendToLog("HelloK: MainActivity.mDid = " + MainActivity.mDid);
if (MainActivity.mDid.matches("E2806894B")) {
if (strEpc.length() >= 24) {
String strEpc1 = strEpc.substring(0, strEpc.length() - 24);
String strTid = strEpc.substring(strEpc.length() - 24, strEpc.length());
MainActivity.mCs108Library4a.appendToLog("HelloK: matched E2806894B with strEpc = " + strEpc + ", strEpc1 = " + strEpc1 + ", strTid = " + strTid + ", strExtra1 = " + strExtra1);
boolean matched = true;
if (strExtra1 != null) {
if (strExtra1.length() == 8 && strTid.contains(strExtra1)) {
strEpc = strEpc1; strAddresss = strEpc;
strExtra2 = strTid;
extra2Bank = 2;
data2_offset = 0;
}
if (!(strExtra1.length() == 8 && strTid.contains(strExtra1))) matched = false;
}
if (matched) {
strEpc = strEpc1;
strAddresss = strEpc;
strExtra2 = strTid;
extra2Bank = 2;
data2_offset = 0;
}
/*if (strTid.contains("E2806894") == false) {
MainActivity.mCs108Library4a.appendToLog("HelloK: Skip the record without strExtra1 E2806894: " + strEpc);
return;
}*/
}
} else if (MainActivity.mDid.matches("E2806894C")) {
if (strExtra1 != null && strEpc.length() >= 4) {
if (strExtra1.contains("E2806894")) {
String strEpc1 = strEpc.substring(0, strEpc.length() - 4);
String strTid = strEpc.substring(strEpc.length() - 4, strEpc.length());
} else if (MainActivity.mDid.matches("E2806894C") || MainActivity.mDid.matches("E2806894d")) {
if (strEpc.length() >= 4) {
String strEpc1 = strEpc.substring(0, strEpc.length() - 4);
String strBrand = strEpc.substring(strEpc.length() - 4, strEpc.length());
MainActivity.mCs108Library4a.appendToLog("HelloK: matched E2806894B with strEpc = " + strEpc + ", strEpc1 = " + strEpc1 + ", strBrand = " + strBrand + ", strExtra1 = " + strExtra1);
boolean matched = true;
if (strExtra1 != null || MainActivity.mDid.matches("E2806894d")) {
if (!(strExtra1 != null && strExtra1.length() == 8 && strExtra1.contains("E2806894"))) {
matched = false;
/*if (MainActivity.mDid.matches("E2806894d")) {
MainActivity.mCs108Library4a.appendToLog("HelloK: Skip the record without strExtra1 E2806894: " + strEpc);
return;
}*/
}
}
if (matched) {
strEpc = strEpc1; strAddresss = strEpc;
brand = strTid;
brand = strBrand;
MainActivity.mCs108Library4a.appendToLog("HelloK: brand 1 = " + brand + ", strEpc = " + strEpc);
}
}
}
}

MainActivity.mCs108Library4a.appendToLog("strTidCompared = " + strMdid + ", MainActivity.mDid = " + MainActivity.mDid + ", strExtra1 = " + strExtra1 + ", strExtra2 = " + strExtra2);
if (strMdid != null) {
String strTidCompared = strMdid;
if (strTidCompared.indexOf("E28011") == 0) strTidCompared = "E28011";
if (strTidCompared.matches("E282402")) { }
else if (strTidCompared.matches("E282403")) { }
else if (strTidCompared.matches("E282405")) { }
else if (strTidCompared.matches("E2806894") && MainActivity.mDid.matches("E2806894C")) { }
else { //if (strMdid.matches("E280B0"))
boolean bMatched = false;
if (strExtra1 != null && strExtra1.indexOf(strTidCompared) == 0) {
bMatched = true; MainActivity.mCs108Library4a.appendToLog("strExtra1 contains strTidCompared");
} else if (strExtra2 != null && strExtra2.indexOf(strTidCompared) == 0) {
bMatched = true; MainActivity.mCs108Library4a.appendToLog("strEXTRA2 contains strTidCompared");
}
if (bMatched == false) return;
}
}

rssi = rx000pkgData.decodedRssi;
phase = rx000pkgData.decodedPhase;
chidx = rx000pkgData.decodedChidx;
Expand Down Expand Up @@ -429,7 +470,14 @@ void inventoryHandler_tag() {
readerDevice.setBrand(brand);
readerDevice.setCodeTempC(codeTempC);
readerDevice.setSensorData(iSensorData);
readerDevice.setExtra(strExtra1, extra1Bank, data1_offset, strExtra2, extra2Bank, data2_offset);
if (strExtra1 != null) readerDevice.setExtra1(strExtra1, extra1Bank, data1_offset);
else if (readerDevice.getstrExtra1() != null) {
MainActivity.mCs108Library4a.appendToLog("HelloK: no null replacement of StrExtra1");
}
if (strExtra2 != null) readerDevice.setExtra2(strExtra2, extra2Bank, data2_offset);
else if (readerDevice.getstrExtra2() != null) {
MainActivity.mCs108Library4a.appendToLog("HelloK: no null replacement of StrExtra2");
}
tagsList.set(iMatchItem, readerDevice);
match = true;
updated = true;
Expand Down
11 changes: 0 additions & 11 deletions app/src/main/java/com/csl/cs108ademoapp/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,6 @@ public void run() {
CustomProgressDialog progressDialog;
private void selectItem(DrawerPositions position) {
Log.i(TAG, "MainActivity.selectItem: position = " + position);
if (false && position != DrawerPositions.MAIN && position != DrawerPositions.ABOUT && position != DrawerPositions.CONNECT && mCs108Library4a != null) {
if (MainActivity.mCs108Library4a.isRfidFailure() == false && mCs108Library4a.mrfidToWriteSize() != 0) {
if (configureDisplaying == false) {
progressDialog = new CustomProgressDialog(this, "Initializing reader. Please wait.");
progressDialog.show();
mHandler.post(configureRunnable);
}
return;
}
}
if (true && position != DrawerPositions.MAIN && position != DrawerPositions.ABOUT && position != DrawerPositions.CONNECT && mCs108Library4a.isBleConnected() == false) {
Toast.makeText(MainActivity.mContext, "Bluetooth Disconnected. Please Connect.", Toast.LENGTH_SHORT).show();
return;
Expand All @@ -208,7 +198,6 @@ private void selectItem(DrawerPositions position) {
fragment = new InventoryRfidSearchFragment();
break;
case MULTIBANK:
mDid = null;
fragment = InventoryRfidiMultiFragment.newInstance(true, null);
break;
case SETTING:
Expand Down
Loading