capacitor-rfid-plugin-ox 0.2.1 → 0.3.0
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.
- package/README.md +5 -185
- package/android/build.gradle +4 -4
- package/android/src/main/AndroidManifest.xml +2 -22
- package/android/src/main/java/uz/ox/plugins/rfid/Example.java +11 -0
- package/android/src/main/java/uz/ox/plugins/rfid/ExamplePlugin.java +22 -0
- package/android/src/main/java/uz/ox/plugins/rfid/RFID.java +13 -0
- package/android/src/main/java/uz/ox/plugins/rfid/RFIDPlugin.java +25 -0
- package/android/src/main/java/uz/ox/plugins/rfid/Scan.java +78 -9
- package/dist/docs.json +6 -170
- package/dist/esm/definitions.d.ts +3 -51
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.d.ts +3 -3
- package/dist/esm/index.js +3 -3
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +4 -48
- package/dist/esm/web.js +4 -47
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +8 -51
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +9 -52
- package/dist/plugin.js.map +1 -1
- package/ios/Plugin/{RFID.swift → Example.swift} +1 -1
- package/ios/Plugin/{RFIDPlugin.m → ExamplePlugin.m} +1 -1
- package/ios/Plugin/{RFIDPlugin.swift → ExamplePlugin.swift} +3 -3
- package/package.json +12 -13
- package/android/libs/USDKLibrary-v2.3.0710.aar +0 -0
- package/android/libs/platform_sdk_v3.1.221124.jar +0 -0
- /package/ios/Plugin/{RFIDPlugin.h → ExamplePlugin.h} +0 -0
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# capacitor-rfid-plugin-ox
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[demo app](https://github.com/Akramjon2658/rfid-demo-reader-writer-urovo_dt50)
|
|
3
|
+
rfid read-write
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
@@ -15,203 +13,25 @@ npx cap sync
|
|
|
15
13
|
|
|
16
14
|
<docgen-index>
|
|
17
15
|
|
|
18
|
-
* [`
|
|
19
|
-
* [`startScan()`](#startscan)
|
|
20
|
-
* [`stopScan()`](#stopscan)
|
|
21
|
-
* [`clearData()`](#cleardata)
|
|
22
|
-
* [`getScanData()`](#getscandata)
|
|
23
|
-
* [`getOutputPower()`](#getoutputpower)
|
|
24
|
-
* [`setOutputPower(...)`](#setoutputpower)
|
|
25
|
-
* [`getRange()`](#getrange)
|
|
26
|
-
* [`setRange(...)`](#setrange)
|
|
27
|
-
* [`getQueryMode()`](#getquerymode)
|
|
28
|
-
* [`setQueryMode(...)`](#setquerymode)
|
|
29
|
-
* [`getReaderType()`](#getreadertype)
|
|
30
|
-
* [`getFirmwareVersion()`](#getfirmwareversion)
|
|
31
|
-
* [`writeEpc(...)`](#writeepc)
|
|
32
|
-
* [`writeEpcString(...)`](#writeepcstring)
|
|
16
|
+
* [`echo(...)`](#echo)
|
|
33
17
|
|
|
34
18
|
</docgen-index>
|
|
35
19
|
|
|
36
20
|
<docgen-api>
|
|
37
21
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
38
22
|
|
|
39
|
-
###
|
|
40
|
-
|
|
41
|
-
```typescript
|
|
42
|
-
isConnected() => Promise<{ connected: boolean; }>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
**Returns:** <code>Promise<{ connected: boolean; }></code>
|
|
46
|
-
|
|
47
|
-
--------------------
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
### startScan()
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
startScan() => Promise<void>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
--------------------
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
### stopScan()
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
stopScan() => Promise<void>
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
--------------------
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
### clearData()
|
|
69
|
-
|
|
70
|
-
```typescript
|
|
71
|
-
clearData() => Promise<void>
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
--------------------
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### getScanData()
|
|
78
|
-
|
|
79
|
-
```typescript
|
|
80
|
-
getScanData() => Promise<any>
|
|
81
|
-
```
|
|
82
|
-
|
|
83
|
-
**Returns:** <code>Promise<any></code>
|
|
84
|
-
|
|
85
|
-
--------------------
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
### getOutputPower()
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
getOutputPower() => Promise<{ value: number; }>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
95
|
-
|
|
96
|
-
--------------------
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
### setOutputPower(...)
|
|
100
|
-
|
|
101
|
-
```typescript
|
|
102
|
-
setOutputPower(options: { power: number; }) => Promise<{ value: number; }>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
| Param | Type |
|
|
106
|
-
| ------------- | ------------------------------- |
|
|
107
|
-
| **`options`** | <code>{ power: number; }</code> |
|
|
108
|
-
|
|
109
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
110
|
-
|
|
111
|
-
--------------------
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
### getRange()
|
|
115
|
-
|
|
116
|
-
```typescript
|
|
117
|
-
getRange() => Promise<{ value: number; }>
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
121
|
-
|
|
122
|
-
--------------------
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
### setRange(...)
|
|
23
|
+
### echo(...)
|
|
126
24
|
|
|
127
25
|
```typescript
|
|
128
|
-
|
|
26
|
+
echo(options: { value: string; }) => Promise<{ value: string; }>
|
|
129
27
|
```
|
|
130
28
|
|
|
131
29
|
| Param | Type |
|
|
132
30
|
| ------------- | ------------------------------- |
|
|
133
|
-
| **`options`** | <code>{
|
|
134
|
-
|
|
135
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
136
|
-
|
|
137
|
-
--------------------
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
### getQueryMode()
|
|
141
|
-
|
|
142
|
-
```typescript
|
|
143
|
-
getQueryMode() => Promise<{ value: 0 | 1 | 2 | 3; }>
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**Returns:** <code>Promise<{ value: 0 | 1 | 2 | 3; }></code>
|
|
147
|
-
|
|
148
|
-
--------------------
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### setQueryMode(...)
|
|
152
|
-
|
|
153
|
-
```typescript
|
|
154
|
-
setQueryMode(options: { queryMode: 0 | 1 | 2 | 3; }) => Promise<{ value: number; }>
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
| Param | Type |
|
|
158
|
-
| ------------- | --------------------------------------------- |
|
|
159
|
-
| **`options`** | <code>{ queryMode: 0 \| 1 \| 2 \| 3; }</code> |
|
|
160
|
-
|
|
161
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
162
|
-
|
|
163
|
-
--------------------
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
### getReaderType()
|
|
167
|
-
|
|
168
|
-
```typescript
|
|
169
|
-
getReaderType() => Promise<{ value: number; }>
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
173
|
-
|
|
174
|
-
--------------------
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
### getFirmwareVersion()
|
|
178
|
-
|
|
179
|
-
```typescript
|
|
180
|
-
getFirmwareVersion() => Promise<{ value: string; }>
|
|
181
|
-
```
|
|
31
|
+
| **`options`** | <code>{ value: string; }</code> |
|
|
182
32
|
|
|
183
33
|
**Returns:** <code>Promise<{ value: string; }></code>
|
|
184
34
|
|
|
185
35
|
--------------------
|
|
186
36
|
|
|
187
|
-
|
|
188
|
-
### writeEpc(...)
|
|
189
|
-
|
|
190
|
-
```typescript
|
|
191
|
-
writeEpc(options: { epc: string; password?: string; }) => Promise<{ value: number; }>
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
| Param | Type |
|
|
195
|
-
| ------------- | ------------------------------------------------ |
|
|
196
|
-
| **`options`** | <code>{ epc: string; password?: string; }</code> |
|
|
197
|
-
|
|
198
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
199
|
-
|
|
200
|
-
--------------------
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
### writeEpcString(...)
|
|
204
|
-
|
|
205
|
-
```typescript
|
|
206
|
-
writeEpcString(options: { epc: string; password?: string; }) => Promise<{ value: number; }>
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
| Param | Type |
|
|
210
|
-
| ------------- | ------------------------------------------------ |
|
|
211
|
-
| **`options`** | <code>{ epc: string; password?: string; }</code> |
|
|
212
|
-
|
|
213
|
-
**Returns:** <code>Promise<{ value: number; }></code>
|
|
214
|
-
|
|
215
|
-
--------------------
|
|
216
|
-
|
|
217
37
|
</docgen-api>
|
package/android/build.gradle
CHANGED
|
@@ -11,7 +11,7 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.2.1'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
@@ -19,10 +19,10 @@ apply plugin: 'com.android.library'
|
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
21
|
namespace "uz.ox.plugins.rfid"
|
|
22
|
-
|
|
22
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
|
|
23
23
|
defaultConfig {
|
|
24
24
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
|
|
26
26
|
versionCode 1
|
|
27
27
|
versionName "1.0"
|
|
28
28
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -52,7 +52,7 @@ dependencies {
|
|
|
52
52
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
53
53
|
implementation project(':capacitor-android')
|
|
54
54
|
implementation files('libs/platform_sdk_v3.1.221124.jar')
|
|
55
|
-
implementation
|
|
55
|
+
implementation project(':rfid-urovo-usdk')
|
|
56
56
|
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
57
57
|
testImplementation "junit:junit:$junitVersion"
|
|
58
58
|
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
@@ -1,22 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
-
<!--<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>-->
|
|
5
|
-
<application
|
|
6
|
-
android:name="uz.ox.plugins.rfid.BaseApplication"
|
|
7
|
-
android:allowBackup="true"
|
|
8
|
-
android:label="@string/app_name"
|
|
9
|
-
>
|
|
10
|
-
<activity
|
|
11
|
-
android:name="uz.ox.plugins.rfid.MainActivity"
|
|
12
|
-
android:exported="true">
|
|
13
|
-
<intent-filter>
|
|
14
|
-
<action android:name="android.intent.action.MAIN" />
|
|
15
|
-
|
|
16
|
-
<category android:name="android.intent.category.LAUNCHER" />
|
|
17
|
-
</intent-filter>
|
|
18
|
-
</activity>
|
|
19
|
-
|
|
20
|
-
</application>
|
|
21
|
-
|
|
22
|
-
</manifest>
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
</manifest>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
package uz.ox.plugins.rfid;
|
|
2
|
+
|
|
3
|
+
import com.getcapacitor.JSObject;
|
|
4
|
+
import com.getcapacitor.Plugin;
|
|
5
|
+
import com.getcapacitor.PluginCall;
|
|
6
|
+
import com.getcapacitor.PluginMethod;
|
|
7
|
+
import com.getcapacitor.annotation.CapacitorPlugin;
|
|
8
|
+
|
|
9
|
+
@CapacitorPlugin(name = "Example")
|
|
10
|
+
public class ExamplePlugin extends Plugin {
|
|
11
|
+
|
|
12
|
+
private Example implementation = new Example();
|
|
13
|
+
|
|
14
|
+
@PluginMethod
|
|
15
|
+
public void echo(PluginCall call) {
|
|
16
|
+
String value = call.getString("value");
|
|
17
|
+
|
|
18
|
+
JSObject ret = new JSObject();
|
|
19
|
+
ret.put("value", implementation.echo(value));
|
|
20
|
+
call.resolve(ret);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -75,6 +75,19 @@ public class RFID {
|
|
|
75
75
|
Log.d(TAG, "stop scan");
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
public void startSearch(List<String> searchableTags) {
|
|
79
|
+
scan.startSearch(searchableTags);
|
|
80
|
+
Log.d(TAG, "start scan");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public void stopSearch() {
|
|
84
|
+
mDataParents.clear();
|
|
85
|
+
tagScanSpinner.clear();
|
|
86
|
+
|
|
87
|
+
scan.stopSearch();
|
|
88
|
+
Log.d(TAG, "stop scan");
|
|
89
|
+
}
|
|
90
|
+
|
|
78
91
|
public void clearData() {
|
|
79
92
|
mDataParents.clear();
|
|
80
93
|
tagScanSpinner.clear();
|
|
@@ -11,6 +11,8 @@ import com.getcapacitor.annotation.CapacitorPlugin;
|
|
|
11
11
|
import com.ubx.usdk.USDKManager;
|
|
12
12
|
import com.ubx.usdk.rfid.RfidManager;
|
|
13
13
|
|
|
14
|
+
import org.json.JSONException;
|
|
15
|
+
|
|
14
16
|
import java.lang.reflect.Array;
|
|
15
17
|
import java.util.ArrayList;
|
|
16
18
|
import java.util.HashMap;
|
|
@@ -33,6 +35,15 @@ public class RFIDPlugin extends Plugin {
|
|
|
33
35
|
notifyListeners("onScanEvent", ret);
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
public void emitSearchEvent(TagScan tagScan) {
|
|
39
|
+
JSObject ret = new JSObject();
|
|
40
|
+
ret.put("epc", tagScan.getEpc());
|
|
41
|
+
ret.put("tid", tagScan.getTid());
|
|
42
|
+
ret.put("rssi", tagScan.getRssi());
|
|
43
|
+
Log.d("new scan data", tagScan.getEpc() + " _ " + tagScan.getRssi());
|
|
44
|
+
notifyListeners("onSearchEvent", ret);
|
|
45
|
+
}
|
|
46
|
+
|
|
36
47
|
private final RFID implementation = new RFID(this);
|
|
37
48
|
|
|
38
49
|
@PluginMethod
|
|
@@ -57,6 +68,20 @@ public class RFIDPlugin extends Plugin {
|
|
|
57
68
|
call.resolve();
|
|
58
69
|
}
|
|
59
70
|
|
|
71
|
+
@PluginMethod
|
|
72
|
+
public void startSearch(PluginCall call) throws JSONException {
|
|
73
|
+
JSArray searchableTags = call.getArray("searchableTags", JSArray.from(new String[] {}));
|
|
74
|
+
|
|
75
|
+
implementation.startSearch(searchableTags.toList());
|
|
76
|
+
call.resolve();
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@PluginMethod
|
|
80
|
+
public void stopSearch(PluginCall call) {
|
|
81
|
+
implementation.stopSearch();
|
|
82
|
+
call.resolve();
|
|
83
|
+
}
|
|
84
|
+
|
|
60
85
|
@PluginMethod
|
|
61
86
|
public void clearData(PluginCall call) {
|
|
62
87
|
implementation.clearData();
|
|
@@ -28,6 +28,9 @@ public class Scan extends Fragment {
|
|
|
28
28
|
public boolean scanning = false;
|
|
29
29
|
|
|
30
30
|
private ScanCallback callback;
|
|
31
|
+
private SearchCallback searchCallback;
|
|
32
|
+
private HashMap<String, Integer> searchableTagsMap;
|
|
33
|
+
|
|
31
34
|
private List<TagScan> data;
|
|
32
35
|
private HashMap<String, TagScan> mapData = new HashMap<>();
|
|
33
36
|
|
|
@@ -47,7 +50,7 @@ public class Scan extends Fragment {
|
|
|
47
50
|
return tagReadTotal;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
public void
|
|
53
|
+
public void setScanCallback() {
|
|
51
54
|
if (this.rfid.mRfidManager != null) {
|
|
52
55
|
|
|
53
56
|
if (callback == null) {
|
|
@@ -57,10 +60,36 @@ public class Scan extends Fragment {
|
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
62
|
|
|
63
|
+
public void setSearchCallback() {
|
|
64
|
+
if (this.rfid.mRfidManager != null) {
|
|
65
|
+
|
|
66
|
+
if (searchCallback == null) {
|
|
67
|
+
searchCallback = new SearchCallback();
|
|
68
|
+
}
|
|
69
|
+
rfid.mRfidManager.registerCallback(searchCallback);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
60
73
|
public void startScan() {
|
|
61
74
|
if (rfid.RFID_INIT_STATUS) {
|
|
62
75
|
if (!this.scanning) {
|
|
63
|
-
|
|
76
|
+
setScanCallback();
|
|
77
|
+
setScanStatus(true);
|
|
78
|
+
}
|
|
79
|
+
} else {
|
|
80
|
+
Log.d(TAG, "RFID is not initialized");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
public void startSearch(List<String> searchableTags) {
|
|
86
|
+
if (rfid.RFID_INIT_STATUS) {
|
|
87
|
+
if (!this.scanning) {
|
|
88
|
+
setSearchCallback();
|
|
89
|
+
searchableTagsMap = new HashMap<>();
|
|
90
|
+
for (String tag : searchableTags) {
|
|
91
|
+
searchableTagsMap.put(tag, 1);
|
|
92
|
+
}
|
|
64
93
|
setScanStatus(true);
|
|
65
94
|
}
|
|
66
95
|
} else {
|
|
@@ -81,6 +110,19 @@ public class Scan extends Fragment {
|
|
|
81
110
|
}
|
|
82
111
|
}
|
|
83
112
|
|
|
113
|
+
public void stopSearch() {
|
|
114
|
+
if (rfid.RFID_INIT_STATUS) {
|
|
115
|
+
if (this.scanning) {
|
|
116
|
+
rfid.mRfidManager.unregisterCallback(searchCallback);
|
|
117
|
+
mapData.clear();
|
|
118
|
+
searchableTagsMap.clear();
|
|
119
|
+
setScanStatus(false);
|
|
120
|
+
}
|
|
121
|
+
} else {
|
|
122
|
+
Log.d(TAG, "RFID is not initialized");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
84
126
|
public void clearData() {
|
|
85
127
|
mapData.clear();
|
|
86
128
|
}
|
|
@@ -108,8 +150,7 @@ public class Scan extends Fragment {
|
|
|
108
150
|
class ScanCallback implements IRfidCallback {
|
|
109
151
|
@Override
|
|
110
152
|
public void onInventoryTag(String EPC, final String TID, final String strRSSI) {
|
|
111
|
-
|
|
112
|
-
Log.e(TAG, "onInventoryTag:............... epc: " + EPC + " tid: " + TID + " strRSSI: " + TID);
|
|
153
|
+
notiyDatasScan(EPC, TID, strRSSI);
|
|
113
154
|
}
|
|
114
155
|
|
|
115
156
|
/**
|
|
@@ -117,16 +158,30 @@ public class Scan extends Fragment {
|
|
|
117
158
|
*/
|
|
118
159
|
@Override
|
|
119
160
|
public void onInventoryTagEnd() {
|
|
120
|
-
Log.i(TAG,"OendO onInventoryTagEnd()" + scanning);
|
|
161
|
+
Log.i(TAG, "OendO onInventoryTagEnd()" + scanning);
|
|
121
162
|
Log.d(TAG, "onInventoryTagEnd()");
|
|
122
163
|
}
|
|
123
164
|
}
|
|
124
165
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
166
|
+
class SearchCallback implements IRfidCallback {
|
|
167
|
+
@Override
|
|
168
|
+
public void onInventoryTag(String EPC, final String TID, final String strRSSI) {
|
|
169
|
+
notiyDatasSearch(EPC, TID, strRSSI);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* 盘存结束回调(Inventory Command Operate End)
|
|
174
|
+
*/
|
|
175
|
+
@Override
|
|
176
|
+
public void onInventoryTagEnd() {
|
|
177
|
+
Log.i(TAG, "OendO onInventoryTagEnd()" + scanning);
|
|
178
|
+
Log.d(TAG, "onInventoryTagEnd()");
|
|
179
|
+
}
|
|
180
|
+
}
|
|
128
181
|
|
|
129
|
-
|
|
182
|
+
private void notiyDatasScan(String s2, String TID, final String strRSSI) {
|
|
183
|
+
final String mapContainStrFinal = s2 + TID;
|
|
184
|
+
if (new Date().getTime() - lastBeepTime.getTime() > 200) {
|
|
130
185
|
SoundTool.getInstance(BaseApplication.getContext()).playBeep(2);
|
|
131
186
|
lastBeepTime = new Date();
|
|
132
187
|
}
|
|
@@ -146,4 +201,18 @@ public class Scan extends Fragment {
|
|
|
146
201
|
|
|
147
202
|
tagReadTotal += 1;
|
|
148
203
|
}
|
|
204
|
+
|
|
205
|
+
private void notiyDatasSearch(String s2, String TID, final String strRSSI) {
|
|
206
|
+
Log.d(TAG, "onInventoryTag: ............... epc: " + s2 + " tid: " + TID + " strRSSI: " + TID);
|
|
207
|
+
|
|
208
|
+
if (searchableTagsMap.containsKey(s2)) {
|
|
209
|
+
if (new Date().getTime() - lastBeepTime.getTime() > 100) {
|
|
210
|
+
SoundTool.getInstance(BaseApplication.getContext()).playBeep(2);
|
|
211
|
+
lastBeepTime = new Date();
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
TagScan tagScan = new TagScan(s2, TID, strRSSI, 1);
|
|
215
|
+
rfidPlugin.emitSearchEvent(tagScan);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
149
218
|
}
|
package/dist/docs.json
CHANGED
|
@@ -1,189 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"api": {
|
|
3
|
-
"name": "
|
|
4
|
-
"slug": "
|
|
3
|
+
"name": "ExamplePlugin",
|
|
4
|
+
"slug": "exampleplugin",
|
|
5
5
|
"docs": "",
|
|
6
6
|
"tags": [],
|
|
7
7
|
"methods": [
|
|
8
8
|
{
|
|
9
|
-
"name": "
|
|
10
|
-
"signature": "() => Promise<{
|
|
11
|
-
"parameters": [],
|
|
12
|
-
"returns": "Promise<{ connected: boolean; }>",
|
|
13
|
-
"tags": [],
|
|
14
|
-
"docs": "",
|
|
15
|
-
"complexTypes": [],
|
|
16
|
-
"slug": "isconnected"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "startScan",
|
|
20
|
-
"signature": "() => Promise<void>",
|
|
21
|
-
"parameters": [],
|
|
22
|
-
"returns": "Promise<void>",
|
|
23
|
-
"tags": [],
|
|
24
|
-
"docs": "",
|
|
25
|
-
"complexTypes": [],
|
|
26
|
-
"slug": "startscan"
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"name": "stopScan",
|
|
30
|
-
"signature": "() => Promise<void>",
|
|
31
|
-
"parameters": [],
|
|
32
|
-
"returns": "Promise<void>",
|
|
33
|
-
"tags": [],
|
|
34
|
-
"docs": "",
|
|
35
|
-
"complexTypes": [],
|
|
36
|
-
"slug": "stopscan"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"name": "clearData",
|
|
40
|
-
"signature": "() => Promise<void>",
|
|
41
|
-
"parameters": [],
|
|
42
|
-
"returns": "Promise<void>",
|
|
43
|
-
"tags": [],
|
|
44
|
-
"docs": "",
|
|
45
|
-
"complexTypes": [],
|
|
46
|
-
"slug": "cleardata"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"name": "getScanData",
|
|
50
|
-
"signature": "() => Promise<any>",
|
|
51
|
-
"parameters": [],
|
|
52
|
-
"returns": "Promise<any>",
|
|
53
|
-
"tags": [],
|
|
54
|
-
"docs": "",
|
|
55
|
-
"complexTypes": [],
|
|
56
|
-
"slug": "getscandata"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"name": "getOutputPower",
|
|
60
|
-
"signature": "() => Promise<{ value: number; }>",
|
|
61
|
-
"parameters": [],
|
|
62
|
-
"returns": "Promise<{ value: number; }>",
|
|
63
|
-
"tags": [],
|
|
64
|
-
"docs": "",
|
|
65
|
-
"complexTypes": [],
|
|
66
|
-
"slug": "getoutputpower"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"name": "setOutputPower",
|
|
70
|
-
"signature": "(options: { power: number; }) => Promise<{ value: number; }>",
|
|
71
|
-
"parameters": [
|
|
72
|
-
{
|
|
73
|
-
"name": "options",
|
|
74
|
-
"docs": "",
|
|
75
|
-
"type": "{ power: number; }"
|
|
76
|
-
}
|
|
77
|
-
],
|
|
78
|
-
"returns": "Promise<{ value: number; }>",
|
|
79
|
-
"tags": [],
|
|
80
|
-
"docs": "",
|
|
81
|
-
"complexTypes": [],
|
|
82
|
-
"slug": "setoutputpower"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
"name": "getRange",
|
|
86
|
-
"signature": "() => Promise<{ value: number; }>",
|
|
87
|
-
"parameters": [],
|
|
88
|
-
"returns": "Promise<{ value: number; }>",
|
|
89
|
-
"tags": [],
|
|
90
|
-
"docs": "",
|
|
91
|
-
"complexTypes": [],
|
|
92
|
-
"slug": "getrange"
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"name": "setRange",
|
|
96
|
-
"signature": "(options: { range: number; }) => Promise<{ value: number; }>",
|
|
97
|
-
"parameters": [
|
|
98
|
-
{
|
|
99
|
-
"name": "options",
|
|
100
|
-
"docs": "",
|
|
101
|
-
"type": "{ range: number; }"
|
|
102
|
-
}
|
|
103
|
-
],
|
|
104
|
-
"returns": "Promise<{ value: number; }>",
|
|
105
|
-
"tags": [],
|
|
106
|
-
"docs": "",
|
|
107
|
-
"complexTypes": [],
|
|
108
|
-
"slug": "setrange"
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
"name": "getQueryMode",
|
|
112
|
-
"signature": "() => Promise<{ value: 0 | 1 | 2 | 3; }>",
|
|
113
|
-
"parameters": [],
|
|
114
|
-
"returns": "Promise<{ value: 0 | 1 | 2 | 3; }>",
|
|
115
|
-
"tags": [],
|
|
116
|
-
"docs": "",
|
|
117
|
-
"complexTypes": [],
|
|
118
|
-
"slug": "getquerymode"
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
"name": "setQueryMode",
|
|
122
|
-
"signature": "(options: { queryMode: 0 | 1 | 2 | 3; }) => Promise<{ value: number; }>",
|
|
9
|
+
"name": "echo",
|
|
10
|
+
"signature": "(options: { value: string; }) => Promise<{ value: string; }>",
|
|
123
11
|
"parameters": [
|
|
124
12
|
{
|
|
125
13
|
"name": "options",
|
|
126
14
|
"docs": "",
|
|
127
|
-
"type": "{
|
|
15
|
+
"type": "{ value: string; }"
|
|
128
16
|
}
|
|
129
17
|
],
|
|
130
|
-
"returns": "Promise<{ value: number; }>",
|
|
131
|
-
"tags": [],
|
|
132
|
-
"docs": "",
|
|
133
|
-
"complexTypes": [],
|
|
134
|
-
"slug": "setquerymode"
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
"name": "getReaderType",
|
|
138
|
-
"signature": "() => Promise<{ value: number; }>",
|
|
139
|
-
"parameters": [],
|
|
140
|
-
"returns": "Promise<{ value: number; }>",
|
|
141
|
-
"tags": [],
|
|
142
|
-
"docs": "",
|
|
143
|
-
"complexTypes": [],
|
|
144
|
-
"slug": "getreadertype"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
"name": "getFirmwareVersion",
|
|
148
|
-
"signature": "() => Promise<{ value: string; }>",
|
|
149
|
-
"parameters": [],
|
|
150
18
|
"returns": "Promise<{ value: string; }>",
|
|
151
19
|
"tags": [],
|
|
152
20
|
"docs": "",
|
|
153
21
|
"complexTypes": [],
|
|
154
|
-
"slug": "
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
"name": "writeEpc",
|
|
158
|
-
"signature": "(options: { epc: string; password?: string; }) => Promise<{ value: number; }>",
|
|
159
|
-
"parameters": [
|
|
160
|
-
{
|
|
161
|
-
"name": "options",
|
|
162
|
-
"docs": "",
|
|
163
|
-
"type": "{ epc: string; password?: string | undefined; }"
|
|
164
|
-
}
|
|
165
|
-
],
|
|
166
|
-
"returns": "Promise<{ value: number; }>",
|
|
167
|
-
"tags": [],
|
|
168
|
-
"docs": "",
|
|
169
|
-
"complexTypes": [],
|
|
170
|
-
"slug": "writeepc"
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
"name": "writeEpcString",
|
|
174
|
-
"signature": "(options: { epc: string; password?: string; }) => Promise<{ value: number; }>",
|
|
175
|
-
"parameters": [
|
|
176
|
-
{
|
|
177
|
-
"name": "options",
|
|
178
|
-
"docs": "",
|
|
179
|
-
"type": "{ epc: string; password?: string | undefined; }"
|
|
180
|
-
}
|
|
181
|
-
],
|
|
182
|
-
"returns": "Promise<{ value: number; }>",
|
|
183
|
-
"tags": [],
|
|
184
|
-
"docs": "",
|
|
185
|
-
"complexTypes": [],
|
|
186
|
-
"slug": "writeepcstring"
|
|
22
|
+
"slug": "echo"
|
|
187
23
|
}
|
|
188
24
|
],
|
|
189
25
|
"properties": []
|
|
@@ -1,55 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
isConnected(): Promise<{
|
|
4
|
-
connected: boolean;
|
|
5
|
-
}>;
|
|
6
|
-
startScan(): Promise<void>;
|
|
7
|
-
stopScan(): Promise<void>;
|
|
8
|
-
clearData(): Promise<void>;
|
|
9
|
-
getScanData(): Promise<any>;
|
|
10
|
-
getOutputPower(): Promise<{
|
|
11
|
-
value: number;
|
|
12
|
-
}>;
|
|
13
|
-
setOutputPower(options: {
|
|
14
|
-
power: number;
|
|
15
|
-
}): Promise<{
|
|
16
|
-
value: number;
|
|
17
|
-
}>;
|
|
18
|
-
getRange(): Promise<{
|
|
19
|
-
value: number;
|
|
20
|
-
}>;
|
|
21
|
-
setRange(options: {
|
|
22
|
-
range: number;
|
|
23
|
-
}): Promise<{
|
|
24
|
-
value: number;
|
|
25
|
-
}>;
|
|
26
|
-
getQueryMode(): Promise<{
|
|
27
|
-
value: 0 | 1 | 2 | 3;
|
|
28
|
-
}>;
|
|
29
|
-
setQueryMode(options: {
|
|
30
|
-
queryMode: 0 | // epc
|
|
31
|
-
1 | // epc+tid
|
|
32
|
-
2 | // epc+user
|
|
33
|
-
3;
|
|
34
|
-
}): Promise<{
|
|
35
|
-
value: number;
|
|
36
|
-
}>;
|
|
37
|
-
getReaderType(): Promise<{
|
|
38
|
-
value: number;
|
|
39
|
-
}>;
|
|
40
|
-
getFirmwareVersion(): Promise<{
|
|
1
|
+
export interface ExamplePlugin {
|
|
2
|
+
echo(options: {
|
|
41
3
|
value: string;
|
|
42
|
-
}>;
|
|
43
|
-
writeEpc(options: {
|
|
44
|
-
epc: string;
|
|
45
|
-
password?: string;
|
|
46
4
|
}): Promise<{
|
|
47
|
-
value:
|
|
48
|
-
}>;
|
|
49
|
-
writeEpcString(options: {
|
|
50
|
-
epc: string;
|
|
51
|
-
password?: string;
|
|
52
|
-
}): Promise<{
|
|
53
|
-
value: number;
|
|
5
|
+
value: string;
|
|
54
6
|
}>;
|
|
55
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface ExamplePlugin {\n echo(options: { value: string }): Promise<{ value: string }>;\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
1
|
+
import type { ExamplePlugin } from './definitions';
|
|
2
|
+
declare const Example: ExamplePlugin;
|
|
3
3
|
export * from './definitions';
|
|
4
|
-
export {
|
|
4
|
+
export { Example };
|
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
|
-
const
|
|
3
|
-
web: () => import('./web').then(m => new m.
|
|
2
|
+
const Example = registerPlugin('Example', {
|
|
3
|
+
web: () => import('./web').then(m => new m.ExampleWeb()),
|
|
4
4
|
});
|
|
5
5
|
export * from './definitions';
|
|
6
|
-
export {
|
|
6
|
+
export { Example };
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,OAAO,GAAG,cAAc,CAAgB,SAAS,EAAE;IACvD,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;CACzD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,OAAO,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { ExamplePlugin } from './definitions';\n\nconst Example = registerPlugin<ExamplePlugin>('Example', {\n web: () => import('./web').then(m => new m.ExampleWeb()),\n});\n\nexport * from './definitions';\nexport { Example };\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,53 +1,9 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
4
|
-
|
|
5
|
-
connected: boolean;
|
|
6
|
-
}>;
|
|
7
|
-
startScan(): Promise<void>;
|
|
8
|
-
stopScan(): Promise<void>;
|
|
9
|
-
clearData(): Promise<void>;
|
|
10
|
-
getScanData(): Promise<void>;
|
|
11
|
-
getOutputPower(): Promise<{
|
|
12
|
-
value: number;
|
|
13
|
-
}>;
|
|
14
|
-
setOutputPower(options: {
|
|
15
|
-
power: number;
|
|
16
|
-
}): Promise<{
|
|
17
|
-
value: number;
|
|
18
|
-
}>;
|
|
19
|
-
getRange(): Promise<{
|
|
20
|
-
value: number;
|
|
21
|
-
}>;
|
|
22
|
-
setRange(options: {
|
|
23
|
-
range: number;
|
|
24
|
-
}): Promise<{
|
|
25
|
-
value: number;
|
|
26
|
-
}>;
|
|
27
|
-
getQueryMode(): Promise<{
|
|
28
|
-
value: 0 | 1 | 2 | 3;
|
|
29
|
-
}>;
|
|
30
|
-
setQueryMode(options: {
|
|
31
|
-
queryMode: 0 | 1 | 2 | 3;
|
|
32
|
-
}): Promise<{
|
|
33
|
-
value: number;
|
|
34
|
-
}>;
|
|
35
|
-
getReaderType(): Promise<{
|
|
36
|
-
value: number;
|
|
37
|
-
}>;
|
|
38
|
-
getFirmwareVersion(): Promise<{
|
|
2
|
+
import type { ExamplePlugin } from './definitions';
|
|
3
|
+
export declare class ExampleWeb extends WebPlugin implements ExamplePlugin {
|
|
4
|
+
echo(options: {
|
|
39
5
|
value: string;
|
|
40
|
-
}>;
|
|
41
|
-
writeEpc(options: {
|
|
42
|
-
epc: string;
|
|
43
|
-
password?: string;
|
|
44
6
|
}): Promise<{
|
|
45
|
-
value:
|
|
46
|
-
}>;
|
|
47
|
-
writeEpcString(options: {
|
|
48
|
-
epc: string;
|
|
49
|
-
password?: string;
|
|
50
|
-
}): Promise<{
|
|
51
|
-
value: number;
|
|
7
|
+
value: string;
|
|
52
8
|
}>;
|
|
53
9
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -1,51 +1,8 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
export class
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
startScan() {
|
|
7
|
-
return Promise.resolve();
|
|
8
|
-
}
|
|
9
|
-
stopScan() {
|
|
10
|
-
return Promise.resolve();
|
|
11
|
-
}
|
|
12
|
-
clearData() {
|
|
13
|
-
return Promise.resolve();
|
|
14
|
-
}
|
|
15
|
-
getScanData() {
|
|
16
|
-
return Promise.resolve();
|
|
17
|
-
}
|
|
18
|
-
async getOutputPower() {
|
|
19
|
-
return { value: 0 };
|
|
20
|
-
}
|
|
21
|
-
async setOutputPower(options) {
|
|
22
|
-
return { value: options.power };
|
|
23
|
-
}
|
|
24
|
-
async getRange() {
|
|
25
|
-
return { value: 0 };
|
|
26
|
-
}
|
|
27
|
-
async setRange(options) {
|
|
28
|
-
return { value: options.range };
|
|
29
|
-
}
|
|
30
|
-
async getQueryMode() {
|
|
31
|
-
return { value: 0 };
|
|
32
|
-
}
|
|
33
|
-
async setQueryMode(options) {
|
|
34
|
-
return { value: options.queryMode };
|
|
35
|
-
}
|
|
36
|
-
async getReaderType() {
|
|
37
|
-
return { value: 0 };
|
|
38
|
-
}
|
|
39
|
-
async getFirmwareVersion() {
|
|
40
|
-
return { value: 'not implemented' };
|
|
41
|
-
}
|
|
42
|
-
async writeEpc(options) {
|
|
43
|
-
console.log(options.epc);
|
|
44
|
-
return { value: -1 };
|
|
45
|
-
}
|
|
46
|
-
async writeEpcString(options) {
|
|
47
|
-
console.log(options.epc);
|
|
48
|
-
return { value: -1 };
|
|
2
|
+
export class ExampleWeb extends WebPlugin {
|
|
3
|
+
async echo(options) {
|
|
4
|
+
console.log('ECHO', options);
|
|
5
|
+
return options;
|
|
49
6
|
}
|
|
50
7
|
}
|
|
51
8
|
//# sourceMappingURL=web.js.map
|
package/dist/esm/web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,MAAM,OAAO,UAAW,SAAQ,SAAS;IACvC,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { ExamplePlugin } from './definitions';\n\nexport class ExampleWeb extends WebPlugin implements ExamplePlugin {\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -4,64 +4,21 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var core = require('@capacitor/core');
|
|
6
6
|
|
|
7
|
-
const
|
|
8
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.
|
|
7
|
+
const Example = core.registerPlugin('Example', {
|
|
8
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ExampleWeb()),
|
|
9
9
|
});
|
|
10
10
|
|
|
11
|
-
class
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
startScan() {
|
|
16
|
-
return Promise.resolve();
|
|
17
|
-
}
|
|
18
|
-
stopScan() {
|
|
19
|
-
return Promise.resolve();
|
|
20
|
-
}
|
|
21
|
-
clearData() {
|
|
22
|
-
return Promise.resolve();
|
|
23
|
-
}
|
|
24
|
-
getScanData() {
|
|
25
|
-
return Promise.resolve();
|
|
26
|
-
}
|
|
27
|
-
async getOutputPower() {
|
|
28
|
-
return { value: 0 };
|
|
29
|
-
}
|
|
30
|
-
async setOutputPower(options) {
|
|
31
|
-
return { value: options.power };
|
|
32
|
-
}
|
|
33
|
-
async getRange() {
|
|
34
|
-
return { value: 0 };
|
|
35
|
-
}
|
|
36
|
-
async setRange(options) {
|
|
37
|
-
return { value: options.range };
|
|
38
|
-
}
|
|
39
|
-
async getQueryMode() {
|
|
40
|
-
return { value: 0 };
|
|
41
|
-
}
|
|
42
|
-
async setQueryMode(options) {
|
|
43
|
-
return { value: options.queryMode };
|
|
44
|
-
}
|
|
45
|
-
async getReaderType() {
|
|
46
|
-
return { value: 0 };
|
|
47
|
-
}
|
|
48
|
-
async getFirmwareVersion() {
|
|
49
|
-
return { value: 'not implemented' };
|
|
50
|
-
}
|
|
51
|
-
async writeEpc(options) {
|
|
52
|
-
console.log(options.epc);
|
|
53
|
-
return { value: -1 };
|
|
54
|
-
}
|
|
55
|
-
async writeEpcString(options) {
|
|
56
|
-
console.log(options.epc);
|
|
57
|
-
return { value: -1 };
|
|
11
|
+
class ExampleWeb extends core.WebPlugin {
|
|
12
|
+
async echo(options) {
|
|
13
|
+
console.log('ECHO', options);
|
|
14
|
+
return options;
|
|
58
15
|
}
|
|
59
16
|
}
|
|
60
17
|
|
|
61
18
|
var web = /*#__PURE__*/Object.freeze({
|
|
62
19
|
__proto__: null,
|
|
63
|
-
|
|
20
|
+
ExampleWeb: ExampleWeb
|
|
64
21
|
});
|
|
65
22
|
|
|
66
|
-
exports.
|
|
23
|
+
exports.Example = Example;
|
|
67
24
|
//# sourceMappingURL=plugin.cjs.js.map
|
package/dist/plugin.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Example = registerPlugin('Example', {\n web: () => import('./web').then(m => new m.ExampleWeb()),\n});\nexport * from './definitions';\nexport { Example };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ExampleWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;AAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;AAC5D,CAAC;;ACFM,MAAM,UAAU,SAASC,cAAS,CAAC;AAC1C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,66 +1,23 @@
|
|
|
1
|
-
var
|
|
1
|
+
var capacitorExample = (function (exports, core) {
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
const
|
|
5
|
-
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.
|
|
4
|
+
const Example = core.registerPlugin('Example', {
|
|
5
|
+
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.ExampleWeb()),
|
|
6
6
|
});
|
|
7
7
|
|
|
8
|
-
class
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
startScan() {
|
|
13
|
-
return Promise.resolve();
|
|
14
|
-
}
|
|
15
|
-
stopScan() {
|
|
16
|
-
return Promise.resolve();
|
|
17
|
-
}
|
|
18
|
-
clearData() {
|
|
19
|
-
return Promise.resolve();
|
|
20
|
-
}
|
|
21
|
-
getScanData() {
|
|
22
|
-
return Promise.resolve();
|
|
23
|
-
}
|
|
24
|
-
async getOutputPower() {
|
|
25
|
-
return { value: 0 };
|
|
26
|
-
}
|
|
27
|
-
async setOutputPower(options) {
|
|
28
|
-
return { value: options.power };
|
|
29
|
-
}
|
|
30
|
-
async getRange() {
|
|
31
|
-
return { value: 0 };
|
|
32
|
-
}
|
|
33
|
-
async setRange(options) {
|
|
34
|
-
return { value: options.range };
|
|
35
|
-
}
|
|
36
|
-
async getQueryMode() {
|
|
37
|
-
return { value: 0 };
|
|
38
|
-
}
|
|
39
|
-
async setQueryMode(options) {
|
|
40
|
-
return { value: options.queryMode };
|
|
41
|
-
}
|
|
42
|
-
async getReaderType() {
|
|
43
|
-
return { value: 0 };
|
|
44
|
-
}
|
|
45
|
-
async getFirmwareVersion() {
|
|
46
|
-
return { value: 'not implemented' };
|
|
47
|
-
}
|
|
48
|
-
async writeEpc(options) {
|
|
49
|
-
console.log(options.epc);
|
|
50
|
-
return { value: -1 };
|
|
51
|
-
}
|
|
52
|
-
async writeEpcString(options) {
|
|
53
|
-
console.log(options.epc);
|
|
54
|
-
return { value: -1 };
|
|
8
|
+
class ExampleWeb extends core.WebPlugin {
|
|
9
|
+
async echo(options) {
|
|
10
|
+
console.log('ECHO', options);
|
|
11
|
+
return options;
|
|
55
12
|
}
|
|
56
13
|
}
|
|
57
14
|
|
|
58
15
|
var web = /*#__PURE__*/Object.freeze({
|
|
59
16
|
__proto__: null,
|
|
60
|
-
|
|
17
|
+
ExampleWeb: ExampleWeb
|
|
61
18
|
});
|
|
62
19
|
|
|
63
|
-
exports.
|
|
20
|
+
exports.Example = Example;
|
|
64
21
|
|
|
65
22
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
66
23
|
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst
|
|
1
|
+
{"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst Example = registerPlugin('Example', {\n web: () => import('./web').then(m => new m.ExampleWeb()),\n});\nexport * from './definitions';\nexport { Example };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class ExampleWeb extends WebPlugin {\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,OAAO,GAAGA,mBAAc,CAAC,SAAS,EAAE;IAC1C,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;IAC5D,CAAC;;ICFM,MAAM,UAAU,SAASC,cAAS,CAAC;IAC1C,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,9 +5,9 @@ import Capacitor
|
|
|
5
5
|
* Please read the Capacitor iOS Plugin Development Guide
|
|
6
6
|
* here: https://capacitorjs.com/docs/plugins/ios
|
|
7
7
|
*/
|
|
8
|
-
@objc(
|
|
9
|
-
public class
|
|
10
|
-
private let implementation =
|
|
8
|
+
@objc(ExamplePlugin)
|
|
9
|
+
public class ExamplePlugin: CAPPlugin {
|
|
10
|
+
private let implementation = Example()
|
|
11
11
|
|
|
12
12
|
@objc func echo(_ call: CAPPluginCall) {
|
|
13
13
|
let value = call.getString("value") ?? ""
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-rfid-plugin-ox",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "rfid
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "rfid read-write",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/esm/index.d.ts",
|
|
@@ -9,19 +9,18 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"android/src/main/",
|
|
11
11
|
"android/build.gradle",
|
|
12
|
-
"android/libs",
|
|
13
12
|
"dist/",
|
|
14
13
|
"ios/Plugin/",
|
|
15
14
|
"CapacitorRfidPluginOx.podspec"
|
|
16
15
|
],
|
|
17
16
|
"author": "ox-system",
|
|
18
|
-
"license": "
|
|
17
|
+
"license": "Apache-2.0",
|
|
19
18
|
"repository": {
|
|
20
19
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/Akramjon2658/capacitor-rfid-plugin-ox.git
|
|
20
|
+
"url": "git+https://github.com/Akramjon2658/capacitor-rfid-plugin-ox.git"
|
|
22
21
|
},
|
|
23
22
|
"bugs": {
|
|
24
|
-
"url": "https://github.com/Akramjon2658/capacitor-rfid-plugin-ox
|
|
23
|
+
"url": "https://github.com/Akramjon2658/capacitor-rfid-plugin-ox/issues"
|
|
25
24
|
},
|
|
26
25
|
"keywords": [
|
|
27
26
|
"capacitor",
|
|
@@ -31,24 +30,24 @@
|
|
|
31
30
|
"scripts": {
|
|
32
31
|
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web",
|
|
33
32
|
"verify:ios": "cd ios && pod install && xcodebuild -workspace Plugin.xcworkspace -scheme Plugin -destination generic/platform=iOS && cd ..",
|
|
34
|
-
"verify:android": "cd android && ./gradlew clean build test && cd ..
|
|
33
|
+
"verify:android": "cd android && ./gradlew clean build test && cd ..",
|
|
35
34
|
"verify:web": "npm run build",
|
|
36
35
|
"lint": "npm run eslint && npm run prettier -- --check && npm run swiftlint -- lint",
|
|
37
36
|
"fmt": "npm run eslint -- --fix && npm run prettier -- --write && npm run swiftlint -- --fix --format",
|
|
38
37
|
"eslint": "eslint . --ext ts",
|
|
39
38
|
"prettier": "prettier \"**/*.{css,html,ts,js,java}\"",
|
|
40
39
|
"swiftlint": "node-swiftlint",
|
|
41
|
-
"docgen": "docgen --api
|
|
40
|
+
"docgen": "docgen --api ExamplePlugin --output-readme README.md --output-json dist/docs.json",
|
|
42
41
|
"build": "npm run clean && npm run docgen && tsc && rollup -c rollup.config.js",
|
|
43
42
|
"clean": "rimraf ./dist",
|
|
44
43
|
"watch": "tsc --watch",
|
|
45
44
|
"prepublishOnly": "npm run build"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@capacitor/android": "^
|
|
49
|
-
"@capacitor/core": "^
|
|
50
|
-
"@capacitor/docgen": "^0.
|
|
51
|
-
"@capacitor/ios": "^
|
|
47
|
+
"@capacitor/android": "^6.0.0",
|
|
48
|
+
"@capacitor/core": "^6.0.0",
|
|
49
|
+
"@capacitor/docgen": "^0.2.2",
|
|
50
|
+
"@capacitor/ios": "^6.0.0",
|
|
52
51
|
"@ionic/eslint-config": "^0.3.0",
|
|
53
52
|
"@ionic/prettier-config": "^1.0.1",
|
|
54
53
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
"typescript": "~4.1.5"
|
|
62
61
|
},
|
|
63
62
|
"peerDependencies": {
|
|
64
|
-
"@capacitor/core": "^
|
|
63
|
+
"@capacitor/core": "^6.0.0"
|
|
65
64
|
},
|
|
66
65
|
"prettier": "@ionic/prettier-config",
|
|
67
66
|
"swiftlint": "@ionic/swiftlint-config",
|
|
Binary file
|
|
Binary file
|
|
File without changes
|