capacitor-rfid-plugin-ox 0.2.0 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # capacitor-rfid-plugin-ox
2
2
 
3
- rfid reader for UROVO DT50
3
+ rfid read-write
4
4
 
5
5
  ## Install
6
6
 
@@ -13,203 +13,25 @@ npx cap sync
13
13
 
14
14
  <docgen-index>
15
15
 
16
- * [`isConnected()`](#isconnected)
17
- * [`startScan()`](#startscan)
18
- * [`stopScan()`](#stopscan)
19
- * [`clearData()`](#cleardata)
20
- * [`getScanData()`](#getscandata)
21
- * [`getOutputPower()`](#getoutputpower)
22
- * [`setOutputPower(...)`](#setoutputpower)
23
- * [`getRange()`](#getrange)
24
- * [`setRange(...)`](#setrange)
25
- * [`getQueryMode()`](#getquerymode)
26
- * [`setQueryMode(...)`](#setquerymode)
27
- * [`getReaderType()`](#getreadertype)
28
- * [`getFirmwareVersion()`](#getfirmwareversion)
29
- * [`writeEpc(...)`](#writeepc)
30
- * [`writeEpcString(...)`](#writeepcstring)
16
+ * [`echo(...)`](#echo)
31
17
 
32
18
  </docgen-index>
33
19
 
34
20
  <docgen-api>
35
21
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
36
22
 
37
- ### isConnected()
23
+ ### echo(...)
38
24
 
39
25
  ```typescript
40
- isConnected() => Promise<{ connected: boolean; }>
41
- ```
42
-
43
- **Returns:** <code>Promise&lt;{ connected: boolean; }&gt;</code>
44
-
45
- --------------------
46
-
47
-
48
- ### startScan()
49
-
50
- ```typescript
51
- startScan() => Promise<void>
52
- ```
53
-
54
- --------------------
55
-
56
-
57
- ### stopScan()
58
-
59
- ```typescript
60
- stopScan() => Promise<void>
61
- ```
62
-
63
- --------------------
64
-
65
-
66
- ### clearData()
67
-
68
- ```typescript
69
- clearData() => Promise<void>
70
- ```
71
-
72
- --------------------
73
-
74
-
75
- ### getScanData()
76
-
77
- ```typescript
78
- getScanData() => Promise<any>
79
- ```
80
-
81
- **Returns:** <code>Promise&lt;any&gt;</code>
82
-
83
- --------------------
84
-
85
-
86
- ### getOutputPower()
87
-
88
- ```typescript
89
- getOutputPower() => Promise<{ value: number; }>
90
- ```
91
-
92
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
93
-
94
- --------------------
95
-
96
-
97
- ### setOutputPower(...)
98
-
99
- ```typescript
100
- setOutputPower(options: { power: number; }) => Promise<{ value: number; }>
26
+ echo(options: { value: string; }) => Promise<{ value: string; }>
101
27
  ```
102
28
 
103
29
  | Param | Type |
104
30
  | ------------- | ------------------------------- |
105
- | **`options`** | <code>{ power: number; }</code> |
106
-
107
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
108
-
109
- --------------------
110
-
111
-
112
- ### getRange()
113
-
114
- ```typescript
115
- getRange() => Promise<{ value: number; }>
116
- ```
117
-
118
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
119
-
120
- --------------------
121
-
122
-
123
- ### setRange(...)
124
-
125
- ```typescript
126
- setRange(options: { range: number; }) => Promise<{ value: number; }>
127
- ```
128
-
129
- | Param | Type |
130
- | ------------- | ------------------------------- |
131
- | **`options`** | <code>{ range: number; }</code> |
132
-
133
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
134
-
135
- --------------------
136
-
137
-
138
- ### getQueryMode()
139
-
140
- ```typescript
141
- getQueryMode() => Promise<{ value: 0 | 1 | 2 | 3; }>
142
- ```
143
-
144
- **Returns:** <code>Promise&lt;{ value: 0 | 1 | 2 | 3; }&gt;</code>
145
-
146
- --------------------
147
-
148
-
149
- ### setQueryMode(...)
150
-
151
- ```typescript
152
- setQueryMode(options: { queryMode: 0 | 1 | 2 | 3; }) => Promise<{ value: number; }>
153
- ```
154
-
155
- | Param | Type |
156
- | ------------- | --------------------------------------------- |
157
- | **`options`** | <code>{ queryMode: 0 \| 1 \| 2 \| 3; }</code> |
158
-
159
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
160
-
161
- --------------------
162
-
163
-
164
- ### getReaderType()
165
-
166
- ```typescript
167
- getReaderType() => Promise<{ value: number; }>
168
- ```
169
-
170
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
171
-
172
- --------------------
173
-
174
-
175
- ### getFirmwareVersion()
176
-
177
- ```typescript
178
- getFirmwareVersion() => Promise<{ value: string; }>
179
- ```
31
+ | **`options`** | <code>{ value: string; }</code> |
180
32
 
181
33
  **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
182
34
 
183
35
  --------------------
184
36
 
185
-
186
- ### writeEpc(...)
187
-
188
- ```typescript
189
- writeEpc(options: { epc: string; password?: string; }) => Promise<{ value: number; }>
190
- ```
191
-
192
- | Param | Type |
193
- | ------------- | ------------------------------------------------ |
194
- | **`options`** | <code>{ epc: string; password?: string; }</code> |
195
-
196
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
197
-
198
- --------------------
199
-
200
-
201
- ### writeEpcString(...)
202
-
203
- ```typescript
204
- writeEpcString(options: { epc: string; password?: string; }) => Promise<{ value: number; }>
205
- ```
206
-
207
- | Param | Type |
208
- | ------------- | ------------------------------------------------ |
209
- | **`options`** | <code>{ epc: string; password?: string; }</code> |
210
-
211
- **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
212
-
213
- --------------------
214
-
215
37
  </docgen-api>
@@ -11,7 +11,7 @@ buildscript {
11
11
  mavenCentral()
12
12
  }
13
13
  dependencies {
14
- classpath 'com.android.tools.build:gradle:8.0.2'
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
- compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
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 : 33
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 files('libs/USDKLibrary-v2.3.0710.aar')
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
- <?xml version="1.0" encoding="utf-8"?>
2
- <manifest xmlns:android="http://schemas.android.com/apk/res/android"
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,11 @@
1
+ package uz.ox.plugins.rfid;
2
+
3
+ import android.util.Log;
4
+
5
+ public class Example {
6
+
7
+ public String echo(String value) {
8
+ Log.i("Echo", value);
9
+ return value;
10
+ }
11
+ }
@@ -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 setCallback() {
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
- setCallback();
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
- notiyDatas(EPC, TID, strRSSI);
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
- private void notiyDatas(String s2, String TID, final String strRSSI) {
126
- final String mapContainStrFinal = s2+TID;
127
- Log.d(TAG, "onInventoryTag: ............... epc: " + s2 + " tid: " + TID + " strRSSI: " + TID);
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
- if(new Date().getTime() - lastBeepTime.getTime() > 200) {
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": "RFIDPlugin",
4
- "slug": "rfidplugin",
3
+ "name": "ExamplePlugin",
4
+ "slug": "exampleplugin",
5
5
  "docs": "",
6
6
  "tags": [],
7
7
  "methods": [
8
8
  {
9
- "name": "isConnected",
10
- "signature": "() => Promise<{ connected: boolean; }>",
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": "{ queryMode: 0 | 1 | 2 | 3; }"
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": "getfirmwareversion"
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
- import type { Plugin } from '@capacitor/core';
2
- export interface RFIDPlugin extends Plugin {
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: number;
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":["import type { Plugin } from '@capacitor/core'\n\nexport interface RFIDPlugin extends Plugin {\n isConnected(): Promise<{ connected: boolean }>;\n\n startScan(): Promise<void>;\n stopScan(): Promise<void>;\n clearData(): Promise<void>;\n\n getScanData(): Promise<any>;\n getOutputPower(): Promise<{ value: number }>;\n setOutputPower(options: { power: number }): Promise<{ value: number }>;\n\n getRange(): Promise<{ value: number }>;\n setRange(options: { range: number }): Promise<{ value: number }>;\n\n getQueryMode(): Promise<{ value: 0 | 1 | 2 | 3 }>;\n setQueryMode(\n options: {\n queryMode:\n 0 | // epc\n 1 | // epc+tid\n 2 | // epc+user\n 3 // fasttid\n }): Promise<{ value: number }>;\n\n getReaderType(): Promise<{ value: number }>; // 80 - short, others - long distance mode\n getFirmwareVersion(): Promise<{ value: string }>;\n\n writeEpc(options: {epc: string, password?: string }): Promise<{ value: number }>;\n writeEpcString(options: {epc: string, password?: string }): Promise<{ value: number }>;\n}"]}
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"]}
@@ -1,4 +1,4 @@
1
- import type { RFIDPlugin } from './definitions';
2
- declare const RFID: RFIDPlugin;
1
+ import type { ExamplePlugin } from './definitions';
2
+ declare const Example: ExamplePlugin;
3
3
  export * from './definitions';
4
- export { RFID };
4
+ export { Example };
package/dist/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { registerPlugin } from '@capacitor/core';
2
- const RFID = registerPlugin('RFID', {
3
- web: () => import('./web').then(m => new m.RFIDWeb()),
2
+ const Example = registerPlugin('Example', {
3
+ web: () => import('./web').then(m => new m.ExampleWeb()),
4
4
  });
5
5
  export * from './definitions';
6
- export { RFID };
6
+ export { Example };
7
7
  //# sourceMappingURL=index.js.map
@@ -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,IAAI,GAAG,cAAc,CAAa,MAAM,EAAE;IAC9C,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;CACtD,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { registerPlugin } from '@capacitor/core';\n\nimport type { RFIDPlugin } from './definitions';\n\nconst RFID = registerPlugin<RFIDPlugin>('RFID', {\n web: () => import('./web').then(m => new m.RFIDWeb()),\n});\n\nexport * from './definitions';\nexport { RFID };\n"]}
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 { RFIDPlugin } from './definitions';
3
- export declare class RFIDWeb extends WebPlugin implements RFIDPlugin {
4
- isConnected(): Promise<{
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: number;
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 RFIDWeb extends WebPlugin {
3
- isConnected() {
4
- return Promise.resolve({ connected: false });
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
@@ -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,OAAQ,SAAQ,SAAS;IACpC,WAAW;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC/C,CAAC;IAED,SAAS;QACP,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,QAAQ;QACN,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,SAAS;QACP,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,WAAW;QACT,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK,CAAC,cAAc;QAClB,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAA0B;QAC7C,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAA0B;QACvC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC;IAGD,KAAK,CAAC,YAAY;QAChB,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,OAAqC;QACtD,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACtB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,OAA2C;QACxD,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAExB,OAAO,EAAE,KAAK,EAAE,CAAE,CAAC,EAAE,CAAA;IACvB,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAA2C;QAC9D,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QAExB,OAAO,EAAE,KAAK,EAAE,CAAE,CAAC,EAAE,CAAA;IACvB,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { RFIDPlugin } from './definitions';\n\nexport class RFIDWeb extends WebPlugin implements RFIDPlugin {\n isConnected(): Promise<{ connected: boolean }> {\n return Promise.resolve({ connected: false });\n }\n\n startScan(): Promise<void> {\n return Promise.resolve();\n }\n\n stopScan(): Promise<void> {\n return Promise.resolve();\n }\n\n clearData(): Promise<void> {\n return Promise.resolve();\n }\n\n getScanData(): Promise<void> {\n return Promise.resolve();\n }\n\n async getOutputPower(): Promise<{ value: number }> {\n return { value: 0 };\n }\n\n async setOutputPower(options: { power: number }): Promise<{ value: number }> {\n return { value: options.power };\n }\n\n async getRange(): Promise<{ value: number }> {\n return { value: 0 };\n }\n\n async setRange(options: { range: number }): Promise<{ value: number }> {\n return { value: options.range };\n }\n\n\n async getQueryMode(): Promise<{ value: 0 | 1 | 2 | 3 }> {\n return { value: 0 };\n }\n\n async setQueryMode(options: { queryMode: 0 | 1 | 2 | 3 }): Promise<{ value: number }> {\n return { value: options.queryMode };\n }\n\n async getReaderType(): Promise<{ value: number }> {\n return { value: 0 };\n }\n\n async getFirmwareVersion(): Promise<{ value: string }> {\n return { value: 'not implemented' };\n }\n\n async writeEpc(options: { epc: string, password?: string }): Promise<{ value: number }> {\n console.log(options.epc)\n\n return { value: - 1 }\n }\n\n async writeEpcString(options: { epc: string, password?: string }): Promise<{ value: number }> {\n console.log(options.epc)\n\n return { value: - 1 }\n }\n}\n"]}
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"]}
@@ -4,64 +4,21 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var core = require('@capacitor/core');
6
6
 
7
- const RFID = core.registerPlugin('RFID', {
8
- web: () => Promise.resolve().then(function () { return web; }).then(m => new m.RFIDWeb()),
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 RFIDWeb extends core.WebPlugin {
12
- isConnected() {
13
- return Promise.resolve({ connected: false });
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
- RFIDWeb: RFIDWeb
20
+ ExampleWeb: ExampleWeb
64
21
  });
65
22
 
66
- exports.RFID = RFID;
23
+ exports.Example = Example;
67
24
  //# sourceMappingURL=plugin.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst RFID = registerPlugin('RFID', {\n web: () => import('./web').then(m => new m.RFIDWeb()),\n});\nexport * from './definitions';\nexport { RFID };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class RFIDWeb extends WebPlugin {\n isConnected() {\n return Promise.resolve({ connected: false });\n }\n startScan() {\n return Promise.resolve();\n }\n stopScan() {\n return Promise.resolve();\n }\n clearData() {\n return Promise.resolve();\n }\n getScanData() {\n return Promise.resolve();\n }\n async getOutputPower() {\n return { value: 0 };\n }\n async setOutputPower(options) {\n return { value: options.power };\n }\n async getRange() {\n return { value: 0 };\n }\n async setRange(options) {\n return { value: options.range };\n }\n async getQueryMode() {\n return { value: 0 };\n }\n async setQueryMode(options) {\n return { value: options.queryMode };\n }\n async getReaderType() {\n return { value: 0 };\n }\n async getFirmwareVersion() {\n return { value: 'not implemented' };\n }\n async writeEpc(options) {\n console.log(options.epc);\n return { value: -1 };\n }\n async writeEpcString(options) {\n console.log(options.epc);\n return { value: -1 };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;AACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;AACzD,CAAC;;ACFM,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC,IAAI,WAAW,GAAG;AAClB,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;AACrD,KAAK;AACL,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL,IAAI,QAAQ,GAAG;AACf,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL,IAAI,SAAS,GAAG;AAChB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL,IAAI,WAAW,GAAG;AAClB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,KAAK;AACL,IAAI,MAAM,cAAc,GAAG;AAC3B,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;AAClC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;AACxC,KAAK;AACL,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;AACxC,KAAK;AACL,IAAI,MAAM,YAAY,GAAG;AACzB,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;AAChC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;AAC5C,KAAK;AACL,IAAI,MAAM,aAAa,GAAG;AAC1B,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;AAC5B,KAAK;AACL,IAAI,MAAM,kBAAkB,GAAG;AAC/B,QAAQ,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;AAC5C,KAAK;AACL,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;AAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;AAC7B,KAAK;AACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;AAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;AAC7B,KAAK;AACL;;;;;;;;;"}
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 capacitorRFID = (function (exports, core) {
1
+ var capacitorExample = (function (exports, core) {
2
2
  'use strict';
3
3
 
4
- const RFID = core.registerPlugin('RFID', {
5
- web: () => Promise.resolve().then(function () { return web; }).then(m => new m.RFIDWeb()),
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 RFIDWeb extends core.WebPlugin {
9
- isConnected() {
10
- return Promise.resolve({ connected: false });
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
- RFIDWeb: RFIDWeb
17
+ ExampleWeb: ExampleWeb
61
18
  });
62
19
 
63
- exports.RFID = RFID;
20
+ exports.Example = Example;
64
21
 
65
22
  Object.defineProperty(exports, '__esModule', { value: true });
66
23
 
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from '@capacitor/core';\nconst RFID = registerPlugin('RFID', {\n web: () => import('./web').then(m => new m.RFIDWeb()),\n});\nexport * from './definitions';\nexport { RFID };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class RFIDWeb extends WebPlugin {\n isConnected() {\n return Promise.resolve({ connected: false });\n }\n startScan() {\n return Promise.resolve();\n }\n stopScan() {\n return Promise.resolve();\n }\n clearData() {\n return Promise.resolve();\n }\n getScanData() {\n return Promise.resolve();\n }\n async getOutputPower() {\n return { value: 0 };\n }\n async setOutputPower(options) {\n return { value: options.power };\n }\n async getRange() {\n return { value: 0 };\n }\n async setRange(options) {\n return { value: options.range };\n }\n async getQueryMode() {\n return { value: 0 };\n }\n async setQueryMode(options) {\n return { value: options.queryMode };\n }\n async getReaderType() {\n return { value: 0 };\n }\n async getFirmwareVersion() {\n return { value: 'not implemented' };\n }\n async writeEpc(options) {\n console.log(options.epc);\n return { value: -1 };\n }\n async writeEpcString(options) {\n console.log(options.epc);\n return { value: -1 };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,IAAI,GAAGA,mBAAc,CAAC,MAAM,EAAE;IACpC,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;IACzD,CAAC;;ICFM,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC,IAAI,WAAW,GAAG;IAClB,QAAQ,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IACrD,KAAK;IACL,IAAI,SAAS,GAAG;IAChB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL,IAAI,QAAQ,GAAG;IACf,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL,IAAI,SAAS,GAAG;IAChB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL,IAAI,WAAW,GAAG;IAClB,QAAQ,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IACjC,KAAK;IACL,IAAI,MAAM,cAAc,GAAG;IAC3B,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;IAClC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;IACxC,KAAK;IACL,IAAI,MAAM,QAAQ,GAAG;IACrB,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;IACxC,KAAK;IACL,IAAI,MAAM,YAAY,GAAG;IACzB,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,YAAY,CAAC,OAAO,EAAE;IAChC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC;IAC5C,KAAK;IACL,IAAI,MAAM,aAAa,GAAG;IAC1B,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAC5B,KAAK;IACL,IAAI,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC5C,KAAK;IACL,IAAI,MAAM,QAAQ,CAAC,OAAO,EAAE;IAC5B,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7B,KAAK;IACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC;IAC7B,KAAK;IACL;;;;;;;;;;;;;;;;;"}
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;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import Foundation
2
2
 
3
- @objc public class RFID: NSObject {
3
+ @objc public class Example: NSObject {
4
4
  @objc public func echo(_ value: String) -> String {
5
5
  print(value)
6
6
  return value
@@ -3,6 +3,6 @@
3
3
 
4
4
  // Define the plugin using the CAP_PLUGIN Macro, and
5
5
  // each method the plugin supports using the CAP_PLUGIN_METHOD macro.
6
- CAP_PLUGIN(RFIDPlugin, "RFID",
6
+ CAP_PLUGIN(ExamplePlugin, "Example",
7
7
  CAP_PLUGIN_METHOD(echo, CAPPluginReturnPromise);
8
8
  )
@@ -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(RFIDPlugin)
9
- public class RFIDPlugin: CAPPlugin {
10
- private let implementation = RFID()
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.2.0",
4
- "description": "rfid reader (not ready to use)",
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": "MIT",
17
+ "license": "Apache-2.0",
19
18
  "repository": {
20
19
  "type": "git",
21
- "url": "git+https://github.com/Akramjon2658/capacitor-rfid-plugin-ox.git.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.git/issues"
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 .. -Xlint:unchecked",
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 RFIDPlugin --output-readme README.md --output-json dist/docs.json",
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": "^5.0.0",
49
- "@capacitor/core": "^5.0.0",
50
- "@capacitor/docgen": "^0.0.18",
51
- "@capacitor/ios": "^5.0.0",
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": "^5.0.0"
63
+ "@capacitor/core": "^6.0.0"
65
64
  },
66
65
  "prettier": "@ionic/prettier-config",
67
66
  "swiftlint": "@ionic/swiftlint-config",
File without changes