capacitor-rfid-plugin-ox 0.3.4 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -75,7 +75,7 @@ public class RFID {
|
|
|
75
75
|
Log.d(TAG, "stop scan");
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
public void startSearch(List<String> searchableTags,
|
|
78
|
+
public void startSearch(List<String> searchableTags, boolean soundOnSearch) {
|
|
79
79
|
scan.startSearch(searchableTags, soundOnSearch);
|
|
80
80
|
Log.d(TAG, "start scan");
|
|
81
81
|
}
|
|
@@ -71,7 +71,7 @@ public class RFIDPlugin extends Plugin {
|
|
|
71
71
|
@PluginMethod
|
|
72
72
|
public void startSearch(PluginCall call) throws JSONException {
|
|
73
73
|
JSArray searchableTags = call.getArray("searchableTags", JSArray.from(new String[] {}));
|
|
74
|
-
|
|
74
|
+
boolean soundOnSearch = call.getBoolean("playSound", false);
|
|
75
75
|
|
|
76
76
|
implementation.startSearch(searchableTags.toList(), soundOnSearch);
|
|
77
77
|
call.resolve();
|
|
@@ -18,7 +18,7 @@ public class Scan extends Fragment {
|
|
|
18
18
|
private final RFID rfid;
|
|
19
19
|
private final RFIDPlugin rfidPlugin;
|
|
20
20
|
|
|
21
|
-
private
|
|
21
|
+
private boolean soundOnSearch = false;
|
|
22
22
|
|
|
23
23
|
public Scan(RFID rfidWrapper, RFIDPlugin rfidPlugin) {
|
|
24
24
|
this.rfid = rfidWrapper;
|
|
@@ -84,7 +84,7 @@ public class Scan extends Fragment {
|
|
|
84
84
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
public void startSearch(List<String> searchableTags,
|
|
87
|
+
public void startSearch(List<String> searchableTags, boolean soundOnSearch) {
|
|
88
88
|
if (rfid.RFID_INIT_STATUS) {
|
|
89
89
|
if (!this.scanning) {
|
|
90
90
|
this.soundOnSearch = soundOnSearch;
|
|
@@ -207,7 +207,7 @@ public class Scan extends Fragment {
|
|
|
207
207
|
|
|
208
208
|
private void notiyDatasSearch(String s2, String TID, final String strRSSI) {
|
|
209
209
|
if (searchableTagsMap.containsKey(s2)) {
|
|
210
|
-
if (this.soundOnSearch && new Date().getTime() - lastBeepTime.getTime() >
|
|
210
|
+
if (this.soundOnSearch && new Date().getTime() - lastBeepTime.getTime() > 40) {
|
|
211
211
|
SoundTool.getInstance(BaseApplication.getContext()).playBeep(2);
|
|
212
212
|
lastBeepTime = new Date();
|
|
213
213
|
}
|