capacitor-rfid-plugin-ox 0.0.10 → 0.1.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
@@ -13,36 +13,68 @@ npx cap sync
13
13
 
14
14
  <docgen-index>
15
15
 
16
- * [`inventory()`](#inventory)
17
- * [`echo(...)`](#echo)
16
+ * [`startScan()`](#startscan)
17
+ * [`stopScan()`](#stopscan)
18
+ * [`getScanData()`](#getscandata)
19
+ * [`getOutputPower()`](#getoutputpower)
20
+ * [`setOutputPower(...)`](#setoutputpower)
18
21
 
19
22
  </docgen-index>
20
23
 
21
24
  <docgen-api>
22
25
  <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
23
26
 
24
- ### inventory()
27
+ ### startScan()
25
28
 
26
29
  ```typescript
27
- inventory() => Promise<{ value: string; }>
30
+ startScan() => Promise<void>
28
31
  ```
29
32
 
30
- **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
33
+ --------------------
34
+
35
+
36
+ ### stopScan()
37
+
38
+ ```typescript
39
+ stopScan() => Promise<void>
40
+ ```
41
+
42
+ --------------------
43
+
44
+
45
+ ### getScanData()
46
+
47
+ ```typescript
48
+ getScanData() => Promise<any>
49
+ ```
50
+
51
+ **Returns:** <code>Promise&lt;any&gt;</code>
52
+
53
+ --------------------
54
+
55
+
56
+ ### getOutputPower()
57
+
58
+ ```typescript
59
+ getOutputPower() => Promise<{ value: number; }>
60
+ ```
61
+
62
+ **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
31
63
 
32
64
  --------------------
33
65
 
34
66
 
35
- ### echo(...)
67
+ ### setOutputPower(...)
36
68
 
37
69
  ```typescript
38
- echo(options: { value: string; }) => Promise<{ value: string; }>
70
+ setOutputPower(options: { power: number; }) => Promise<{ value: number; }>
39
71
  ```
40
72
 
41
73
  | Param | Type |
42
74
  | ------------- | ------------------------------- |
43
- | **`options`** | <code>{ value: string; }</code> |
75
+ | **`options`** | <code>{ power: number; }</code> |
44
76
 
45
- **Returns:** <code>Promise&lt;{ value: string; }&gt;</code>
77
+ **Returns:** <code>Promise&lt;{ value: number; }&gt;</code>
46
78
 
47
79
  --------------------
48
80
 
@@ -11,7 +11,7 @@ buildscript {
11
11
  mavenCentral()
12
12
  }
13
13
  dependencies {
14
- classpath 'com.android.tools.build:gradle:8.0.0'
14
+ classpath 'com.android.tools.build:gradle:8.0.2'
15
15
  }
16
16
  }
17
17
 
@@ -51,7 +51,8 @@ repositories {
51
51
  dependencies {
52
52
  implementation fileTree(dir: 'libs', include: ['*.jar'])
53
53
  implementation project(':capacitor-android')
54
- implementation files("libs/USDKLibrary-v2.3.0214.aar")
54
+ implementation files('libs/platform_sdk_v3.1.221124.jar')
55
+ implementation files('libs/USDKLibrary-v2.3.0710.aar')
55
56
  implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
56
57
  testImplementation "junit:junit:$junitVersion"
57
58
  androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
@@ -1,2 +1,22 @@
1
- <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
- </manifest>
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>
@@ -4,14 +4,13 @@ import android.os.Bundle;
4
4
  import android.util.Log;
5
5
 
6
6
  import com.getcapacitor.BridgeActivity;
7
+ import com.ubx.usdk.USDKManager;
8
+ import com.ubx.usdk.rfid.RfidManager;
7
9
 
8
10
  public class MainActivity extends BridgeActivity {
9
-
10
11
  @Override
11
- public void onCreate(Bundle savedInstanceState) {
12
+ protected void onCreate(Bundle savedInstanceState) {
12
13
  registerPlugin(RFIDPlugin.class);
13
- Log.i("usdk1", "main activity onCreate...");
14
14
  super.onCreate(savedInstanceState);
15
15
  }
16
-
17
16
  }
@@ -1,10 +1,95 @@
1
1
  package uz.ox.plugins.rfid;
2
2
 
3
+ import android.os.Handler;
4
+ import android.os.Looper;
3
5
  import android.util.Log;
4
6
 
7
+ import com.getcapacitor.JSObject;
8
+ import com.ubx.usdk.RFIDSDKManager;
9
+ import com.ubx.usdk.rfid.RfidManager;
10
+
11
+ import java.util.ArrayList;
12
+ import java.util.HashMap;
13
+ import java.util.List;
14
+
15
+ import uz.ox.plugins.rfid.pojo.TagScan;
16
+
5
17
  public class RFID {
18
+ public Scan scan;
19
+ public RFID(RFIDPlugin rfidPlugin) {
20
+ this.scan = new Scan(this, rfidPlugin);
21
+ }
22
+
23
+ public static final String TAG = "usdk";
24
+
25
+ public boolean RFID_INIT_STATUS = false;
26
+
27
+ public RfidManager mRfidManager;
28
+ public List<String> mDataParents;
29
+ public List<TagScan> tagScanSpinner;
30
+
31
+ public int readerType = 0;
32
+
33
+ public void init() {
34
+ mDataParents = new ArrayList<>();
35
+ tagScanSpinner = new ArrayList<>();
36
+
37
+ this.initRFID();
38
+ }
39
+
40
+ private void initRFID() {
41
+ // Get the RFID instance in the asynchronous callback
42
+ RFIDSDKManager.getInstance().power(true);
43
+ boolean connect = RFIDSDKManager.getInstance().connect();
44
+
45
+ if (connect) {
46
+ Log.d(TAG, "initRfid() success.");
47
+ RFID_INIT_STATUS = true;
48
+ readerType = RFIDSDKManager.getInstance().getRfidManager().getReaderType();//80为短距,其他为长距
49
+ mRfidManager = RFIDSDKManager.getInstance().getRfidManager();
50
+ Log.d(TAG, "initRfid: GetReaderType() = " +readerType );
51
+ }else {
52
+ Log.d(TAG, "initRfid fail.");
53
+ }
54
+ }
55
+
56
+ public void startScan() {
57
+ scan.startScan();
58
+ Log.d(TAG, "start scan");
59
+ }
60
+
61
+ public void stopScan() {
62
+ mDataParents.clear();
63
+ tagScanSpinner.clear();
64
+
65
+ scan.stopScan();
66
+ Log.d(TAG, "stop scan");
67
+ }
68
+
69
+ static class ScanDataResult {
70
+ HashMap<String, TagScan> scanData;
71
+ int tagReadTotal;
72
+ }
73
+
74
+ public ScanDataResult getScanData() {
75
+ ScanDataResult result = new ScanDataResult();
76
+
77
+ result.scanData = scan.getMapData();
78
+ result.tagReadTotal = scan.getTagReadTotal();
79
+
80
+ return result;
81
+ }
82
+
83
+ public int getOutputPower() {
84
+ return mRfidManager.getOutputPower();
85
+ }
86
+
87
+ public void setOutputPower(byte power) {
88
+ mRfidManager.setOutputPower(power);
89
+ }
90
+
6
91
  public String echo(String value) {
7
- Log.i("Echo", value);
92
+ Log.i(TAG, value);
8
93
  return value;
9
94
  }
10
95
  }
@@ -10,53 +10,66 @@ import com.getcapacitor.annotation.CapacitorPlugin;
10
10
  import com.ubx.usdk.USDKManager;
11
11
  import com.ubx.usdk.rfid.RfidManager;
12
12
 
13
+ import java.util.ArrayList;
14
+ import java.util.HashMap;
15
+ import java.util.List;
16
+
17
+ import uz.ox.plugins.rfid.pojo.TagScan;
18
+
13
19
  @CapacitorPlugin(name = "RFID")
14
20
  public class RFIDPlugin extends Plugin {
15
21
 
16
- private RFID implementation = new RFID();
17
-
18
- public static final String TAG = "usdk";
19
-
20
- public RfidManager mRfidManager;
21
-
22
- private void initRfid() {
23
- // 在异步回调中拿到RFID实例
24
- USDKManager.getInstance().init(BaseApplication.getContext(), new USDKManager.InitListener() {
25
- @Override
26
- public void onStatus(USDKManager.STATUS status) {
27
- if (status == USDKManager.STATUS.SUCCESS) {
28
- Log.d(TAG, "initRfid() success.");
29
- mRfidManager = USDKManager.getInstance().getRfidManager();
30
- } else {
31
- Log.d(TAG, "initRfid fail.");
32
- }
33
- }
34
- });
22
+ public void load() {
23
+ implementation.init();
24
+ }
25
+ public void emitScanEvent(TagScan tagScan) {
26
+ JSObject ret = new JSObject();
27
+ ret.put("epc", tagScan.getEpc());
28
+ ret.put("tid", tagScan.getTid());
29
+ ret.put("rssi", tagScan.getRssi());
30
+ Log.d("new scan data", tagScan.getEpc() + " _ " + tagScan.getRssi());
31
+ notifyListeners("onScanEvent", ret);
35
32
  }
36
33
 
37
- @Override
38
- public void load() {
39
- Log.d("usdk1", "plugin load");
40
- RFIDPlugin RFIDPlugin = this;
41
- getBridge().getActivity().runOnUiThread(new Runnable() {
42
- @Override
43
- public void run() {
44
- // RFIDPlugin.initRfid();
45
- }
46
- });
34
+ private final RFID implementation = new RFID(this);
35
+
36
+ @PluginMethod
37
+ public void startScan(PluginCall call) {
38
+ implementation.startScan();
39
+ call.resolve();
47
40
  }
48
41
 
49
42
  @PluginMethod
50
- public void inventory(PluginCall call) {
51
- Log.d(TAG, String.valueOf(mRfidManager.getRange()));
43
+ public void stopScan(PluginCall call) {
44
+ implementation.stopScan();
45
+ call.resolve();
52
46
  }
53
47
 
54
48
  @PluginMethod
55
- public void echo(PluginCall call) {
56
- String value = call.getString("value");
49
+ public void getScanData(PluginCall call) {
50
+ RFID.ScanDataResult scanData = implementation.getScanData();
51
+
52
+ List<TagScan> readTags = new ArrayList<>(scanData.scanData.values());
57
53
 
58
54
  JSObject ret = new JSObject();
59
- ret.put("value", implementation.echo(value));
55
+ ret.put("totalReadCount", scanData.tagReadTotal);
56
+ ret.put("foundTagsCount", readTags.size());
57
+ ret.put("scanData", readTags);
60
58
  call.resolve(ret);
61
59
  }
60
+
61
+ @PluginMethod
62
+ public void getOutputPower(PluginCall call) {
63
+ JSObject res = new JSObject();
64
+ res.put("value", implementation.getOutputPower());
65
+
66
+ call.resolve(res);
67
+ }
68
+
69
+ @PluginMethod
70
+ public void setOutputPower(PluginCall call) {
71
+ int power = call.getInt("power", 30);
72
+ implementation.setOutputPower((byte) power);
73
+ call.resolve();
74
+ }
62
75
  }
@@ -0,0 +1,145 @@
1
+ package uz.ox.plugins.rfid;
2
+
3
+
4
+ import android.util.Log;
5
+
6
+ import androidx.fragment.app.Fragment;
7
+
8
+ import com.ubx.usdk.rfid.aidl.IRfidCallback;
9
+ import com.ubx.usdk.util.SoundTool;
10
+
11
+ import java.util.Date;
12
+ import java.util.HashMap;
13
+ import java.util.List;
14
+
15
+ import uz.ox.plugins.rfid.pojo.TagScan;
16
+
17
+ public class Scan extends Fragment {
18
+ private final RFID rfid;
19
+ private final RFIDPlugin rfidPlugin;
20
+
21
+ public Scan(RFID rfidWrapper, RFIDPlugin rfidPlugin) {
22
+ this.rfid = rfidWrapper;
23
+ this.rfidPlugin = rfidPlugin;
24
+ }
25
+
26
+ public static final String TAG = "usdk scan";
27
+
28
+ public boolean scanning = false;
29
+
30
+ private ScanCallback callback;
31
+ private List<TagScan> data;
32
+ private HashMap<String, TagScan> mapData = new HashMap<>();
33
+
34
+ private int tagReadTotal = 0;
35
+
36
+ private Date lastBeepTime = new Date();
37
+
38
+ private void inventorySingle() {
39
+ rfid.mRfidManager.inventorySingle();
40
+ }
41
+
42
+ public HashMap<String, TagScan> getMapData() {
43
+ return mapData;
44
+ }
45
+
46
+ public int getTagReadTotal() {
47
+ return tagReadTotal;
48
+ }
49
+
50
+ public void setCallback() {
51
+ if (this.rfid.mRfidManager != null) {
52
+
53
+ if (callback == null) {
54
+ callback = new ScanCallback();
55
+ }
56
+ rfid.mRfidManager.registerCallback(callback);
57
+ }
58
+ }
59
+
60
+ public void startScan() {
61
+ if (rfid.RFID_INIT_STATUS) {
62
+ if (!this.scanning) {
63
+ setCallback();
64
+ setScanStatus(true);
65
+ }
66
+ } else {
67
+ Log.d(TAG, "RFID is not initialized");
68
+ }
69
+
70
+ }
71
+
72
+ public void stopScan() {
73
+ if (rfid.RFID_INIT_STATUS) {
74
+ if (this.scanning) {
75
+ rfid.mRfidManager.unregisterCallback(callback);
76
+ mapData.clear();
77
+ setScanStatus(false);
78
+ }
79
+ } else {
80
+ Log.d(TAG, "RFID is not initialized");
81
+ }
82
+ }
83
+
84
+ public boolean getIsScanning() {
85
+ return this.scanning;
86
+ }
87
+
88
+ public void setIsScanning(boolean isScanning) {
89
+ this.scanning = isScanning;
90
+ }
91
+
92
+ private void setScanStatus(boolean isScan) {
93
+ this.scanning = isScan;
94
+ if (isScan) {
95
+ this.tagReadTotal = 0;
96
+ rfid.mRfidManager.startInventory((byte) 0);
97
+ Log.v(TAG, "--- startInventory() ----");
98
+ } else {
99
+ Log.v(TAG, "--- stopInventory() ----");
100
+ rfid.mRfidManager.stopInventory();
101
+ }
102
+ }
103
+
104
+ class ScanCallback implements IRfidCallback {
105
+ @Override
106
+ public void onInventoryTag(String EPC, final String TID, final String strRSSI) {
107
+ notiyDatas(EPC, TID, strRSSI);
108
+ Log.e(TAG, "onInventoryTag:............... epc: " + EPC + " tid: " + TID + " strRSSI: " + TID);
109
+ }
110
+
111
+ /**
112
+ * 盘存结束回调(Inventory Command Operate End)
113
+ */
114
+ @Override
115
+ public void onInventoryTagEnd() {
116
+ Log.i(TAG,"OendO onInventoryTagEnd()" + scanning);
117
+ Log.d(TAG, "onInventoryTagEnd()");
118
+ }
119
+ }
120
+
121
+ private void notiyDatas(String s2, String TID, final String strRSSI) {
122
+ final String mapContainStrFinal = s2+TID;
123
+ Log.d(TAG, "onInventoryTag: ............... epc: " + s2 + " tid: " + TID + " strRSSI: " + TID);
124
+
125
+ if(new Date().getTime() - lastBeepTime.getTime() > 200) {
126
+ SoundTool.getInstance(BaseApplication.getContext()).playBeep(2);
127
+ lastBeepTime = new Date();
128
+ }
129
+ if (mapData.containsKey(mapContainStrFinal)) {
130
+ TagScan tagScan = mapData.get(mapContainStrFinal);
131
+ tagScan.setCount(mapData.get(mapContainStrFinal).getCount() + 1);
132
+ tagScan.setRssi(strRSSI);
133
+ mapData.put(mapContainStrFinal, tagScan);
134
+ } else {
135
+ rfid.mDataParents.add(s2);
136
+
137
+ TagScan tagScan = new TagScan(s2, TID, strRSSI, 1);
138
+ mapData.put(mapContainStrFinal, tagScan);
139
+ rfid.tagScanSpinner.add(tagScan);
140
+ rfidPlugin.emitScanEvent(tagScan);
141
+ }
142
+
143
+ tagReadTotal += 1;
144
+ }
145
+ }
@@ -0,0 +1,76 @@
1
+ package uz.ox.plugins.rfid.pojo;
2
+
3
+ import java.util.Objects;
4
+
5
+ public class TagScan {
6
+
7
+ private String rssi;
8
+ private String epc;
9
+ private String tid;
10
+ private int count;
11
+
12
+ public TagScan() {
13
+ }
14
+
15
+ public TagScan(String epc, String tid, String rssi, int count) {
16
+ this.rssi = rssi;
17
+ this.epc = epc;
18
+ this.tid = tid;
19
+ this.count = count;
20
+ }
21
+
22
+ public String getRssi() {
23
+ return rssi;
24
+ }
25
+
26
+ public void setRssi(String rssi) {
27
+ this.rssi = rssi;
28
+ }
29
+
30
+ public String getEpc() {
31
+ return epc;
32
+ }
33
+
34
+ public void setEpc(String epc) {
35
+ this.epc = epc;
36
+ }
37
+
38
+ public int getCount() {
39
+ return count;
40
+ }
41
+
42
+ public void setCount(int count) {
43
+ this.count = count;
44
+ }
45
+
46
+ public String getTid() {
47
+ return tid;
48
+ }
49
+
50
+ public void setTid(String tid) {
51
+ this.tid = tid;
52
+ }
53
+
54
+ @Override
55
+ public String toString() {
56
+ return "TagScan{" +
57
+ "rssi='" + rssi + '\'' +
58
+ ", epc='" + epc + '\'' +
59
+ ", tid='" + tid + '\'' +
60
+ ", count=" + count +
61
+ '}';
62
+ }
63
+
64
+ @Override
65
+ public boolean equals(Object o) {
66
+ if (this == o) return true;
67
+ if (o == null || getClass() != o.getClass()) return false;
68
+ TagScan tagScan = (TagScan) o;
69
+ return Objects.equals(epc, tagScan.epc);
70
+ }
71
+
72
+ @Override
73
+ public int hashCode() {
74
+ return Objects.hash(rssi, epc, count);
75
+ }
76
+ }
package/dist/docs.json CHANGED
@@ -6,30 +6,60 @@
6
6
  "tags": [],
7
7
  "methods": [
8
8
  {
9
- "name": "inventory",
10
- "signature": "() => Promise<{ value: string; }>",
9
+ "name": "startScan",
10
+ "signature": "() => Promise<void>",
11
11
  "parameters": [],
12
- "returns": "Promise<{ value: string; }>",
12
+ "returns": "Promise<void>",
13
13
  "tags": [],
14
14
  "docs": "",
15
15
  "complexTypes": [],
16
- "slug": "inventory"
16
+ "slug": "startscan"
17
17
  },
18
18
  {
19
- "name": "echo",
20
- "signature": "(options: { value: string; }) => Promise<{ value: string; }>",
19
+ "name": "stopScan",
20
+ "signature": "() => Promise<void>",
21
+ "parameters": [],
22
+ "returns": "Promise<void>",
23
+ "tags": [],
24
+ "docs": "",
25
+ "complexTypes": [],
26
+ "slug": "stopscan"
27
+ },
28
+ {
29
+ "name": "getScanData",
30
+ "signature": "() => Promise<any>",
31
+ "parameters": [],
32
+ "returns": "Promise<any>",
33
+ "tags": [],
34
+ "docs": "",
35
+ "complexTypes": [],
36
+ "slug": "getscandata"
37
+ },
38
+ {
39
+ "name": "getOutputPower",
40
+ "signature": "() => Promise<{ value: number; }>",
41
+ "parameters": [],
42
+ "returns": "Promise<{ value: number; }>",
43
+ "tags": [],
44
+ "docs": "",
45
+ "complexTypes": [],
46
+ "slug": "getoutputpower"
47
+ },
48
+ {
49
+ "name": "setOutputPower",
50
+ "signature": "(options: { power: number; }) => Promise<{ value: number; }>",
21
51
  "parameters": [
22
52
  {
23
53
  "name": "options",
24
54
  "docs": "",
25
- "type": "{ value: string; }"
55
+ "type": "{ power: number; }"
26
56
  }
27
57
  ],
28
- "returns": "Promise<{ value: string; }>",
58
+ "returns": "Promise<{ value: number; }>",
29
59
  "tags": [],
30
60
  "docs": "",
31
61
  "complexTypes": [],
32
- "slug": "echo"
62
+ "slug": "setoutputpower"
33
63
  }
34
64
  ],
35
65
  "properties": []
@@ -1,10 +1,14 @@
1
- export interface RFIDPlugin {
2
- inventory(): Promise<{
3
- value: string;
1
+ import { Plugin } from '@capacitor/core';
2
+ export interface RFIDPlugin extends Plugin {
3
+ startScan(): Promise<void>;
4
+ stopScan(): Promise<void>;
5
+ getScanData(): Promise<any>;
6
+ getOutputPower(): Promise<{
7
+ value: number;
4
8
  }>;
5
- echo(options: {
6
- value: string;
9
+ setOutputPower(options: {
10
+ power: number;
7
11
  }): Promise<{
8
- value: string;
12
+ value: number;
9
13
  }>;
10
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["export interface RFIDPlugin {\n inventory(): Promise<{ value: string }>;\n echo(options: { value: string }): Promise<{ value: string }>;\n}\n"]}
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import { Plugin } from '@capacitor/core'\n\nexport interface RFIDPlugin extends Plugin {\n startScan(): Promise<void>;\n stopScan(): Promise<void>;\n\n getScanData(): Promise<any>;\n getOutputPower(): Promise<{ value: number }>;\n setOutputPower(options: { power: number }): Promise<{ value: number }>;\n}"]}
package/dist/esm/web.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
2
  import type { RFIDPlugin } from './definitions';
3
3
  export declare class RFIDWeb extends WebPlugin implements RFIDPlugin {
4
- inventory(): Promise<{
5
- value: string;
4
+ startScan(): Promise<void>;
5
+ stopScan(): Promise<void>;
6
+ getScanData(): Promise<void>;
7
+ getOutputPower(): Promise<{
8
+ value: number;
6
9
  }>;
7
- echo(options: {
8
- value: string;
10
+ setOutputPower(options: {
11
+ power: number;
9
12
  }): Promise<{
10
- value: string;
13
+ value: number;
11
14
  }>;
12
15
  }
package/dist/esm/web.js CHANGED
@@ -1,12 +1,19 @@
1
1
  import { WebPlugin } from '@capacitor/core';
2
2
  export class RFIDWeb extends WebPlugin {
3
- async inventory() {
4
- console.log('inventory');
5
- return { value: 'salom' };
3
+ startScan() {
4
+ return Promise.resolve();
6
5
  }
7
- async echo(options) {
8
- console.log('ECHO', options);
9
- return options;
6
+ stopScan() {
7
+ return Promise.resolve();
8
+ }
9
+ getScanData() {
10
+ return Promise.resolve();
11
+ }
12
+ async getOutputPower() {
13
+ return { value: 0 };
14
+ }
15
+ async setOutputPower(options) {
16
+ return { value: options.power };
10
17
  }
11
18
  }
12
19
  //# 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,KAAK,CAAC,SAAS;QACb,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QACzB,OAAO,EAAC,KAAK,EAAE,OAAO,EAAC,CAAC;IAC1B,CAAC;IACD,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 { RFIDPlugin } from './definitions';\n\nexport class RFIDWeb extends WebPlugin implements RFIDPlugin {\n async inventory(): Promise<{ value: string }> {\n console.log('inventory');\n return {value: 'salom'};\n }\n async echo(options: { value: string }): Promise<{ value: string }> {\n console.log('ECHO', options);\n return options;\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,OAAQ,SAAQ,SAAS;IACpC,SAAS;QACP,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,QAAQ;QACN,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;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type { RFIDPlugin } from './definitions';\n\nexport class RFIDWeb extends WebPlugin implements RFIDPlugin {\n startScan(): Promise<void> {\n return Promise.resolve();\n }\n\n stopScan(): 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"]}
@@ -9,13 +9,20 @@ const RFID = core.registerPlugin('RFID', {
9
9
  });
10
10
 
11
11
  class RFIDWeb extends core.WebPlugin {
12
- async inventory() {
13
- console.log('inventory');
14
- return { value: 'salom' };
12
+ startScan() {
13
+ return Promise.resolve();
15
14
  }
16
- async echo(options) {
17
- console.log('ECHO', options);
18
- return options;
15
+ stopScan() {
16
+ return Promise.resolve();
17
+ }
18
+ getScanData() {
19
+ return Promise.resolve();
20
+ }
21
+ async getOutputPower() {
22
+ return { value: 0 };
23
+ }
24
+ async setOutputPower(options) {
25
+ return { value: options.power };
19
26
  }
20
27
  }
21
28
 
@@ -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 async inventory() {\n console.log('inventory');\n return { value: 'salom' };\n }\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,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,MAAM,SAAS,GAAG;AACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;AACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAClC,KAAK;AACL,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;;;;;;;;;"}
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 startScan() {\n return Promise.resolve();\n }\n stopScan() {\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}\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,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,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;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -6,13 +6,20 @@ var capacitorRFID = (function (exports, core) {
6
6
  });
7
7
 
8
8
  class RFIDWeb extends core.WebPlugin {
9
- async inventory() {
10
- console.log('inventory');
11
- return { value: 'salom' };
9
+ startScan() {
10
+ return Promise.resolve();
12
11
  }
13
- async echo(options) {
14
- console.log('ECHO', options);
15
- return options;
12
+ stopScan() {
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 };
16
23
  }
17
24
  }
18
25
 
@@ -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 async inventory() {\n console.log('inventory');\n return { value: 'salom' };\n }\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,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,MAAM,SAAS,GAAG;IACtB,QAAQ,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IACjC,QAAQ,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IAClC,KAAK;IACL,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
+ {"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 startScan() {\n return Promise.resolve();\n }\n stopScan() {\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}\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,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,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;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "capacitor-rfid-plugin-ox",
3
- "version": "0.0.10",
3
+ "version": "0.1.0",
4
4
  "description": "rfid reader (not ready to use)",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",