Skip to content

Commit c637910

Browse files
WallaceSitWallaceSit
authored andcommitted
v2.12.1-2
v2.12.1-2: • App: Solve “after changing EPC of the selected tag, do inventory again without clearing all. It crashes” problem • App: relocate some codes • App, Library108: correct “valid/invalid display always 0” problem in the inventory page • Library108: solve “first installation without bluetooth on, after selecting location. It goes to background” problem • Library108: relocate some codes, add some exception preventive codes, revise debug messages, rename some variables, remove some unused codes v2.12.0-0: • App: update to v12.0 o Add impinj verification demonstration • Library108: update to v12.0 o Add impinj verification demonstration o Solve “set normal filter and test in normal inventory. After scan protected tags in impinj page, return to normal inventory. Incorrect filtering is done” problem o Relocate some codes • App, Library108: o Remove some unused codes, change some debug messages v2.11.1-2: • App: update to the v11.1 o modify little for impinj authentication verification o Solve “during scan for protected only tag in impinj page, it may crash due to exception” problem o Disable the Kiloway selection in Special Functions page o Revise the text, color and location of different control in Impinj special features page o Correct the title bar text in N2ESL page o correct the trigger key not function in N2ESL page o remove read access tab in N2ESL page o update selected tag when switching from scan tab to Geiger tab in N2ESL page o stop read access when switching from Access tab to other tabs in N2ESL page o add tid checking during duplicate elimination o Rename tab names and add Geiger tab in N2ESL page o add N2ESL user bank reading to turn on led in multibank inventory, and Geiger search • Library108: update to the v11.2 o Solve “after tag lock, unable to turn on led during N2ESL inventory” problem o Solve the permission problem caused by previous code relocation o Solve “after access write, led tag does not turn on during led inventory” problem. • App, Library108: relocate some codes, change some debug messages, remove some unused codes
1 parent fd0cb88 commit c637910

Some content is hidden

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

46 files changed

+10432
-3553
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ android {
1212
minSdk 21
1313
targetSdk 34
1414
versionCode 39
15-
versionName "2.10.5"
15+
versionName "2.12.1"
1616
}
1717
}
1818

-6.67 MB
Binary file not shown.
6.73 MB
Binary file not shown.

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ public static DrawerPositions toDrawerPosition(int x) {
5555
case 14: return BAPCARD;
5656
case 15: return COLDCHAIN;
5757
case 16: return AURASENSE;
58-
case 17: return KILOWAY;
59-
case 18: return LONGJING;
60-
case 19: return AXZON;
61-
//case 15: return RFMICRON;
62-
case 20: return FDMICRO;
63-
case 21: return CTESIUS;
64-
case 22: return ASYGNTAG;
65-
66-
case 23: return REGISTER;
67-
case 24: return READWRITEUSER;
68-
case 25: return WEDGE;
69-
case 26: return DIRECTWEDGE;
58+
//case 17: return KILOWAY;
59+
case 17: return LONGJING;
60+
case 18: return AXZON;
61+
//case 18: return RFMICRON;
62+
case 19: return FDMICRO;
63+
case 20: return CTESIUS;
64+
case 21: return ASYGNTAG;
65+
66+
case 22: return REGISTER;
67+
case 23: return READWRITEUSER;
68+
case 24: return WEDGE;
69+
case 25: return DIRECTWEDGE;
7070
}
7171
return null;
7272
}
@@ -92,7 +92,8 @@ public static DrawerPositions toDrawerPosition(int x) {
9292
addItem(new DrawerItem("14", "uEm CS9010 BAP ID Card", R.drawable.dl_loc));
9393
addItem(new DrawerItem("15", "uEm Cold Chain CS8300", R.drawable.dl_loc));
9494
addItem(new DrawerItem("16", "uEm Aura-sense", R.drawable.dl_loc));
95-
addItem(new DrawerItem("17", "Kiloway KX2005X-BL", R.drawable.dl_rr));
95+
//addItem(new DrawerItem("17", "Kiloway KX2005X-BL", R.drawable.dl_rr));
96+
addItem(new DrawerItem("17", "EL-N2ESL CS6861", R.drawable.dl_rr));
9697
addItem(new DrawerItem("18", "Axzon", R.drawable.dl_loc));
9798
addItem(new DrawerItem("19", "FM13DT160", R.drawable.dl_loc));
9899
addItem(new DrawerItem("20", "Landa CTESIUS", R.drawable.dl_loc));

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

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,7 @@ void inventoryHandler_setup() {
7272
}
7373
MainActivity.csLibrary4A.appendToLog("yield = " + yield + ", allTotal = " + allTotal);
7474
}
75-
MainActivity.csLibrary4A.invalidata = 0;
76-
MainActivity.csLibrary4A.invalidUpdata = 0;
77-
MainActivity.csLibrary4A.validata = 0;
75+
MainActivity.csLibrary4A.clearInvalidata();
7876

7977
timeMillis = System.currentTimeMillis(); startTimeMillis = System.currentTimeMillis(); runTimeMillis = startTimeMillis;
8078
firstTime = 0;
@@ -94,9 +92,9 @@ void inventoryHandler_setup() {
9492
MainActivity.mSensorConnector.mLocationDevice.turnOn(true);
9593
MainActivity.mSensorConnector.mSensorDevice.turnOn(true);
9694
if (ALLOW_RTSAVE) {
97-
saveExternalTask = new SaveList2ExternalTask();
95+
saveExternalTask = new SaveList2ExternalTask(false);
9896
try {
99-
saveExternalTask.openServer();
97+
saveExternalTask.openServer(false);
10098
serverConnectValid = true;
10199
MainActivity.csLibrary4A.appendToLog("openServer is done");
102100
} catch (Exception ex) {
@@ -490,16 +488,28 @@ else if (strTidCompared.matches("E28011")) { }
490488
} else if (readerListAdapter.getSelectDupElim()) {
491489
ReaderDevice readerDevice = null;
492490
int iMatchItem = -1;
493-
if (true) {
491+
if (false) {
494492
int index = Collections.binarySearch(MainActivity.sharedObjects.tagsIndexList, new SharedObjects.TagsIndex(strAddresss, 0));
495493
if (index >= 0) {
496494
iMatchItem = MainActivity.sharedObjects.tagsIndexList.size() - 1 - MainActivity.sharedObjects.tagsIndexList.get(index).getPosition();
497495
}
498496
} else {
497+
String strCompare = null;
498+
if (extra1Bank == 2) {
499+
strCompare = strExtra1; //MainActivity.csLibrary4A.appendToLog("1strExtra = " + strExtra1 + ", " + readerDevice.getTid() + ", " + readerDevice.getTid().matches(strCompare));
500+
} else if (extra2Bank == 2) {
501+
strCompare = strExtra2; //MainActivity.csLibrary4A.appendToLog("2strExtra = " + strExtra2 + ", " + readerDevice.getTid() + ", " + readerDevice.getTid().matches(strCompare));
502+
}
499503
for (int i = 0; i < tagsList.size(); i++) {
500-
if (strEpc.matches(tagsList.get(i).getAddress())) {
501-
iMatchItem = i;
502-
break;
504+
//MainActivity.csLibrary4A.appendToLog("strEpc = " + strEpc + ", tagsList.get(" + i + ").getAdddress = " + tagsList.get(i).getAddress());
505+
if (strEpc == null || tagsList.get(i).getAddress() == null) { }
506+
else if (strEpc.matches(tagsList.get(i).getAddress())) {
507+
boolean bTidMatched = true;
508+
if (strCompare != null && tagsList.get(i).getTid() != null) bTidMatched = tagsList.get(i).getTid().matches(strCompare);
509+
if (bTidMatched) {
510+
iMatchItem = i;
511+
break;
512+
}
503513
}
504514
}
505515
}
@@ -544,11 +554,13 @@ else if (readerDevice.getstrExtra2() != null) {
544554
MainActivity.csLibrary4A.appendToLog("bSgtinOnly = " + bSgtinOnly + ", strValue = " + (strValue == null ? "null" : strValue));
545555
if (strValue == null) bAddDevice = false;
546556
} else if (bProtectOnly) {
547-
bAddDevice = false;
548-
strValue = strExtra1.substring(strExtra1.length()-1);
549-
int iValue = Integer.parseInt(strValue, 16);
550-
MainActivity.csLibrary4A.appendToLog("bProtectOnly = " + bProtectOnly + ", strExtra1 = " + (strExtra1 == null ? "null" : strExtra1) + ", iValue = " + iValue);
551-
if ((iValue & 0x02) != 0) bAddDevice = true;
557+
if (strExtra1 != null) {
558+
bAddDevice = false;
559+
strValue = strExtra1.substring(strExtra1.length() - 1);
560+
int iValue = Integer.parseInt(strValue, 16);
561+
MainActivity.csLibrary4A.appendToLog("bProtectOnly = " + bProtectOnly + ", strExtra1 = " + (strExtra1 == null ? "null" : strExtra1) + ", iValue = " + iValue);
562+
if ((iValue & 0x02) != 0) bAddDevice = true;
563+
} else MainActivity.csLibrary4A.appendToLog("NULL strExtra1");
552564
}
553565
if (bAddDevice == false) { }
554566
else if (match == false) {
@@ -604,15 +616,15 @@ else if (match == false) {
604616
if (requestSound && requestNewSound) requestSoundCount = 0;
605617
if (readerListAdapter != null) readerListAdapter.notifyDataSetChanged();
606618
if (invalidDisplay) {
607-
if (rfidYieldView != null) rfidYieldView.setText(String.valueOf(total) + "," + String.valueOf(MainActivity.csLibrary4A.validata));
608-
if (rfidRateView != null) rfidRateView.setText(String.valueOf(MainActivity.csLibrary4A.invalidata) + "," + String.valueOf(MainActivity.csLibrary4A.invalidUpdata));
619+
if (rfidYieldView != null) rfidYieldView.setText(String.valueOf(total) + "," + String.valueOf(MainActivity.csLibrary4A.getValidata()));
620+
if (rfidRateView != null) rfidRateView.setText(String.valueOf(MainActivity.csLibrary4A.getInvalidata()) + "," + String.valueOf(MainActivity.csLibrary4A.getInvalidUpdata()));
609621
} else {
610622
String stringTemp = "Unique:" + String.valueOf(yield);
611623
if (true) {
612-
float fErrorRate = (float) MainActivity.csLibrary4A.invalidata / ((float) MainActivity.csLibrary4A.validata + (float) MainActivity.csLibrary4A.invalidata) * 100;
613-
stringTemp += "\nE" + String.valueOf(MainActivity.csLibrary4A.invalidata) + "/" + String.valueOf(MainActivity.csLibrary4A.validata) + "/" + String.valueOf((int) fErrorRate);
624+
float fErrorRate = (float) MainActivity.csLibrary4A.getInvalidata() / ((float) MainActivity.csLibrary4A.getValidata() + (float) MainActivity.csLibrary4A.getInvalidata()) * 100;
625+
stringTemp += "\nE" + String.valueOf(MainActivity.csLibrary4A.getInvalidata()) + "/" + String.valueOf(MainActivity.csLibrary4A.getValidata()) + "/" + String.valueOf((int) fErrorRate);
614626
} else if (true) {
615-
stringTemp += "\nE" + String.valueOf(MainActivity.csLibrary4A.invalidata) + "," + String.valueOf(MainActivity.csLibrary4A.invalidUpdata) + "/" + String.valueOf(MainActivity.csLibrary4A.validata);
627+
stringTemp += "\nE" + String.valueOf(MainActivity.csLibrary4A.getInvalidata()) + "," + String.valueOf(MainActivity.csLibrary4A.getInvalidUpdata()) + "/" + String.valueOf(MainActivity.csLibrary4A.getValidata());
616628
}
617629
if (rfidYieldView != null) rfidYieldView.setText(stringTemp);
618630
if (total != 0 && currentTime - firstTimeOld > 500) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private void selectItem(DrawerPositions position) {
180180
fragment = new InventoryFragment();
181181
break;
182182
case SEARCH:
183-
fragment = new InventoryRfidSearchFragment();
183+
fragment = new InventoryRfidSearchFragment(false);
184184
break;
185185
case MULTIBANK:
186186
fragment = InventoryRfidiMultiFragment.newInstance(true, null);

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

Lines changed: 51 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import android.os.Build;
1111
import android.os.Environment;
1212
import android.provider.Settings;
13+
import android.util.Log;
1314
import android.widget.Toast;
1415

1516
import com.csl.cslibrary4a.ReaderDevice;
@@ -52,14 +53,15 @@
5253
import static com.csl.cs108ademoapp.MainActivity.csLibrary4A;
5354

5455
public class SaveList2ExternalTask extends AsyncTask<Void,Void,String> {
55-
String messageStr;
56-
String resultDisplay = "", errorDisplay;
56+
public String messageStr;
57+
String resultDisplay = "";
58+
public String errorDisplay;
5759
ArrayList<ReaderDevice> tagsList; ReaderDevice tagDevice1;
5860
CustomPopupWindow customPopupWindow;
5961
boolean savedFile = false;
6062
int fileFormat = 0;
6163

62-
String url = null;
64+
public String url = null, strBearer = null;
6365
HttpURLConnection con;
6466
String stringBluetoothMAC, stringWifiMac;
6567

@@ -107,15 +109,21 @@ else if (stringBluetoothMAC.contains("020000000000")) {
107109
}
108110
}
109111
}
110-
public SaveList2ExternalTask() { }
112+
boolean bImpinjServer = false;
113+
public SaveList2ExternalTask(boolean bImpinjServer) {
114+
csLibrary4A.appendToLog("bImpinjServer = " + bImpinjServer);
115+
this.bImpinjServer = bImpinjServer;
116+
}
111117

112118
@Override
113119
protected void onPreExecute() {
114-
if (tagsList == null) cancel(true);
115-
116-
if (MainActivity.csLibrary4A.getSavingFormatSetting() == 0) messageStr = createJSON(tagsList, null).toString();
117-
else messageStr = createCSV(tagsList, null);
118-
resultDisplay = save2File(messageStr, true);
120+
if (!bImpinjServer) {
121+
if (tagsList == null) cancel(true);
122+
if (MainActivity.csLibrary4A.getSavingFormatSetting() == 0)
123+
messageStr = createJSON(tagsList, null).toString();
124+
else messageStr = createCSV(tagsList, null);
125+
resultDisplay = save2File(messageStr, true);
126+
}
119127
customPopupWindow = new CustomPopupWindow(mContext);
120128
csLibrary4A.appendToLog("SaveList2ExternalTask: resultDisplay = " + resultDisplay);
121129
if (resultDisplay == null) resultDisplay = "";
@@ -128,18 +136,20 @@ protected void onPreExecute() {
128136
}
129137

130138
protected String doInBackground(Void... params) {
139+
Log.i("Hello", "bImpinjServer: doInBackground starts");
131140
if (MainActivity.csLibrary4A.isBleConnected() == false) {
132141
resultDisplay += "Error in sending data to server as the reader is not connected";
133142
return null;
134-
} else if (MainActivity.csLibrary4A.getSaveCloudEnable() == false) {
143+
} else if (MainActivity.csLibrary4A.getSaveCloudEnable() == false && bImpinjServer == false) {
135144
resultDisplay += "No saving to cloud as it is disabled";
136145
return null;
137146
}
138147
try {
139148
if (true) {
140-
openServer();
141-
write2Server(messageStr);
142-
closeServer();
149+
csLibrary4A.appendToLog("bImpinjServer: doInBackground starts doing");
150+
openServer(bImpinjServer); csLibrary4A.appendToLog("bImpinjServer: doInBackground after openServer");
151+
write2Server(messageStr); csLibrary4A.appendToLog("bImpinjServer: doInBackground after write2Server");
152+
closeServer(); csLibrary4A.appendToLog("bImpinjServer: doInBackground after closeServer");
143153
} else if (true) {
144154
String serverAddress = "192.168.25.119:21";
145155
String addressPort[];
@@ -176,7 +186,11 @@ protected void onProgressUpdate(Void... output) { }
176186
protected void onCancelled() { }
177187
protected void onPostExecute(String output) {
178188
if (savedFile == false) resultDisplay += "\n" + save2File(messageStr, false);
179-
customPopupWindow.popupWindow.dismiss(); customPopupWindow.popupStart(resultDisplay, false);
189+
customPopupWindow.popupWindow.dismiss();
190+
csLibrary4A.appendToLog("bImpinjServer = " + bImpinjServer + ", responseCode = " + responseCode + ", resultDisplay = " + resultDisplay);
191+
if (resultDisplay != null && resultDisplay.length() != 0) {
192+
if (!bImpinjServer || responseCode != 200) customPopupWindow.popupStart(resultDisplay, false);
193+
}
180194
}
181195

182196
public String createStrEpcList() {
@@ -414,12 +428,13 @@ public String save2File(String messageStr, boolean requestPermission) {
414428
return resultDisplay;
415429
}
416430

417-
public void openServer() throws Exception {
431+
public void openServer(boolean bImpinjServer) throws Exception {
418432
if (false) {
419433
url = "https://";
420434
url += "192.168.25.21:";
421435
url += "29090/WebServiceRESTs/1.0/req/";
422436
} else if (false) url = "http://ptsv2.com/t/10i1t-1519143332/post";
437+
else if (bImpinjServer) { } //url = "https://h9tqczg9-7275.asse.devtunnels.ms/api/Auth/login"; //"https://142.251.220.110"; //
423438
else url = csLibrary4A.getServerLocation();
424439

425440
errorDisplay = "Error in SSLContext.getInstance()"; SSLContext sc = SSLContext.getInstance("TLS");
@@ -451,7 +466,7 @@ public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
451466
}
452467
HttpsURLConnection.setFollowRedirects(false);
453468

454-
errorDisplay = "Error in URL()"; URL obj = new URL(url);
469+
errorDisplay = "Error in URL()"; URL obj = new URL(url); MainActivity.csLibrary4A.appendToLog("obj is " + (obj != null ? "valid" : "NULL") + " with url = " + url);
455470
errorDisplay = "Error in openConnection()";
456471
boolean isHttps = false;
457472
if (url.length() >= 6) {
@@ -464,12 +479,23 @@ public boolean verify(String hostname, javax.net.ssl.SSLSession sslSession) {
464479
errorDisplay = "Error in setConnectTimeout()"; con.setConnectTimeout(MainActivity.csLibrary4A.getServerTimeout() * 1000);
465480
errorDisplay = "Error in setRequestMethod()"; con.setRequestMethod("POST");
466481
errorDisplay = "Error in setRequestProperty(User-Agent)"; con.setRequestProperty("User-Agent", "Mozilla/5.0");
467-
errorDisplay = "Error in setRequestProperty(Accept-Languag)"; con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
482+
errorDisplay = "Error in setRequestProperty(text/plain)"; con.setRequestProperty("text/plain", "text/plain");
483+
errorDisplay = "Error in setRequestProperty(Accept-Language)"; con.setRequestProperty("Accept-Language", "en-US,en;q=0.5");
484+
MainActivity.csLibrary4A.appendToLog("authenticate in url position : " + url.indexOf("authenticate"));
485+
if (url.indexOf("authenticate") >= 0) {
486+
String string = strBearer;
487+
MainActivity.csLibrary4A.appendToLog("Authorization value = " + string);
488+
errorDisplay = "Error in setRequestProperty(Authorization)"; con.setRequestProperty("Authorization", string);
489+
}
490+
errorDisplay = "Error in setRequestProperty(Content)"; con.setRequestProperty("Content-Type", "application/json); //; charset=utf8");
468491
errorDisplay = "Error in setDoOutput()"; con.setDoOutput(true);
492+
errorDisplay = "Error in setDoInput()"; con.setDoInput(true);
469493
}
470494
boolean serverWritten = false;
471495
public void write2Server(String messageStr0) {
496+
csLibrary4A.appendToLog("messageStr0 = " + messageStr0);
472497
try {
498+
//InputStream is = con.getInputStream(); DataInputStream ir = new DataInputStream(is);
473499
errorDisplay = "Error in getOutputStream()"; OutputStream os = con.getOutputStream();
474500
errorDisplay = "Error in DataOutputStream()"; DataOutputStream wr = new DataOutputStream(os);
475501

@@ -479,29 +505,32 @@ public void write2Server(String messageStr0) {
479505
errorDisplay = "Error in close(wr)"; wr.close();
480506
errorDisplay = "Error in close(os)"; os.close();
481507
serverWritten = true;
508+
//csLibrary4A.appendToLog("inputStream = " + ir.readUTF());
482509
} catch (Exception ex) {
483510
MainActivity.csLibrary4A.appendToLog("errorDisplay = " + errorDisplay + ", execpetion = " + ex.getMessage());
484511
}
485512
}
513+
public int responseCode; public String response = null;
486514
public void closeServer() throws Exception {
487515
if (serverWritten) {
488516
errorDisplay = "Error in getResponseCode()";
489-
int responseCode = con.getResponseCode();
490-
MainActivity.csLibrary4A.appendToLog("errorDisplay = " + errorDisplay);
517+
responseCode = con.getResponseCode();
518+
//MainActivity.csLibrary4A.appendToLog("errorDisplay = " + errorDisplay);
491519
MainActivity.csLibrary4A.appendToLog("responseCode = " + responseCode);
492520
if (responseCode != 200)
493521
errorDisplay = "Error in response code = " + responseCode;
494522
else {
495523
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
496-
MainActivity.csLibrary4A.appendToLog("errorDisplay = " + errorDisplay);
524+
//MainActivity.csLibrary4A.appendToLog("errorDisplay = " + errorDisplay);
497525
String inputLine;
498-
String response = "";
526+
response = "";
499527
while ((inputLine = in.readLine()) != null) {
500528
response += inputLine;
501529
}
502530
in.close();
503-
MainActivity.csLibrary4A.appendToLog("errorDisplay = " + errorDisplay);
531+
//MainActivity.csLibrary4A.appendToLog("errorDisplay = " + errorDisplay);
504532
resultDisplay += "Success in sending data to server with response = " + response;
533+
MainActivity.csLibrary4A.appendToLog("response = " + response);
505534
errorDisplay = null;
506535
}
507536
}

0 commit comments

Comments
 (0)