capacitor-rfid-plugin-ox 0.3.4 → 0.4.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 +35 -0
- package/android/src/main/java/uz/ox/plugins/rfid/RFID.java +1 -1
- package/android/src/main/java/uz/ox/plugins/rfid/RFIDPlugin.java +1 -1
- package/android/src/main/java/uz/ox/plugins/rfid/Scan.java +3 -3
- package/dist/docs.json +51 -1
- package/dist/esm/definitions.d.ts +26 -0
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +8 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.d.ts +19 -23
- package/dist/esm/web.js +43 -31
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +51 -31
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +51 -31
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,6 +13,7 @@ npx cap sync
|
|
|
13
13
|
|
|
14
14
|
<docgen-index>
|
|
15
15
|
|
|
16
|
+
* [`getCapabilities()`](#getcapabilities)
|
|
16
17
|
* [`isConnected()`](#isconnected)
|
|
17
18
|
* [`startScan()`](#startscan)
|
|
18
19
|
* [`stopScan()`](#stopscan)
|
|
@@ -30,12 +31,29 @@ npx cap sync
|
|
|
30
31
|
* [`writeEpcString(...)`](#writeepcstring)
|
|
31
32
|
* [`startSearch(...)`](#startsearch)
|
|
32
33
|
* [`stopSearch()`](#stopsearch)
|
|
34
|
+
* [Interfaces](#interfaces)
|
|
33
35
|
|
|
34
36
|
</docgen-index>
|
|
35
37
|
|
|
36
38
|
<docgen-api>
|
|
37
39
|
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
38
40
|
|
|
41
|
+
### getCapabilities()
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
getCapabilities() => Promise<ReaderCapabilities>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Capabilities of the connected Reader.
|
|
48
|
+
|
|
49
|
+
Implementations that predate this method reject. That is a signal, not a
|
|
50
|
+
failure: the caller treats a rejection as a handheld Mobile Reader.
|
|
51
|
+
|
|
52
|
+
**Returns:** <code>Promise<<a href="#readercapabilities">ReaderCapabilities</a>></code>
|
|
53
|
+
|
|
54
|
+
--------------------
|
|
55
|
+
|
|
56
|
+
|
|
39
57
|
### isConnected()
|
|
40
58
|
|
|
41
59
|
```typescript
|
|
@@ -236,4 +254,21 @@ stopSearch() => Promise<void>
|
|
|
236
254
|
|
|
237
255
|
--------------------
|
|
238
256
|
|
|
257
|
+
|
|
258
|
+
### Interfaces
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
#### ReaderCapabilities
|
|
262
|
+
|
|
263
|
+
What the connected Reader can do. Mode gating comes from here, not from the
|
|
264
|
+
reader type — a desktop reader that can write must not be gated like one
|
|
265
|
+
that cannot.
|
|
266
|
+
|
|
267
|
+
| Prop | Type | Description |
|
|
268
|
+
| ---------------- | ----------------------------------------------------------- | --------------------------------------------------------------------- |
|
|
269
|
+
| **`canWrite`** | <code>boolean</code> | Reader can write an EPC to a tag (Generate & Set mode depends on it). |
|
|
270
|
+
| **`hasRssi`** | <code>boolean</code> | Reader reports RSSI (Find mode depends on it). |
|
|
271
|
+
| **`isHandheld`** | <code>boolean</code> | Reader is a handheld terminal rather than a desk device. |
|
|
272
|
+
| **`power`** | <code>{ min: number; max: number; default: number; }</code> | Output power range in dBm. The power slider renders this range. |
|
|
273
|
+
|
|
239
274
|
</docgen-api>
|
|
@@ -75,7 +75,7 @@ public class RFID {
|
|
|
75
75
|
Log.d(TAG, "stop scan");
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
public void startSearch(List<String> searchableTags,
|
|
78
|
+
public void startSearch(List<String> searchableTags, boolean soundOnSearch) {
|
|
79
79
|
scan.startSearch(searchableTags, soundOnSearch);
|
|
80
80
|
Log.d(TAG, "start scan");
|
|
81
81
|
}
|
|
@@ -71,7 +71,7 @@ public class RFIDPlugin extends Plugin {
|
|
|
71
71
|
@PluginMethod
|
|
72
72
|
public void startSearch(PluginCall call) throws JSONException {
|
|
73
73
|
JSArray searchableTags = call.getArray("searchableTags", JSArray.from(new String[] {}));
|
|
74
|
-
|
|
74
|
+
boolean soundOnSearch = call.getBoolean("playSound", false);
|
|
75
75
|
|
|
76
76
|
implementation.startSearch(searchableTags.toList(), soundOnSearch);
|
|
77
77
|
call.resolve();
|
|
@@ -18,7 +18,7 @@ public class Scan extends Fragment {
|
|
|
18
18
|
private final RFID rfid;
|
|
19
19
|
private final RFIDPlugin rfidPlugin;
|
|
20
20
|
|
|
21
|
-
private
|
|
21
|
+
private boolean soundOnSearch = false;
|
|
22
22
|
|
|
23
23
|
public Scan(RFID rfidWrapper, RFIDPlugin rfidPlugin) {
|
|
24
24
|
this.rfid = rfidWrapper;
|
|
@@ -84,7 +84,7 @@ public class Scan extends Fragment {
|
|
|
84
84
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
public void startSearch(List<String> searchableTags,
|
|
87
|
+
public void startSearch(List<String> searchableTags, boolean soundOnSearch) {
|
|
88
88
|
if (rfid.RFID_INIT_STATUS) {
|
|
89
89
|
if (!this.scanning) {
|
|
90
90
|
this.soundOnSearch = soundOnSearch;
|
|
@@ -207,7 +207,7 @@ public class Scan extends Fragment {
|
|
|
207
207
|
|
|
208
208
|
private void notiyDatasSearch(String s2, String TID, final String strRSSI) {
|
|
209
209
|
if (searchableTagsMap.containsKey(s2)) {
|
|
210
|
-
if (this.soundOnSearch && new Date().getTime() - lastBeepTime.getTime() >
|
|
210
|
+
if (this.soundOnSearch && new Date().getTime() - lastBeepTime.getTime() > 40) {
|
|
211
211
|
SoundTool.getInstance(BaseApplication.getContext()).playBeep(2);
|
|
212
212
|
lastBeepTime = new Date();
|
|
213
213
|
}
|
package/dist/docs.json
CHANGED
|
@@ -5,6 +5,18 @@
|
|
|
5
5
|
"docs": "",
|
|
6
6
|
"tags": [],
|
|
7
7
|
"methods": [
|
|
8
|
+
{
|
|
9
|
+
"name": "getCapabilities",
|
|
10
|
+
"signature": "() => Promise<ReaderCapabilities>",
|
|
11
|
+
"parameters": [],
|
|
12
|
+
"returns": "Promise<ReaderCapabilities>",
|
|
13
|
+
"tags": [],
|
|
14
|
+
"docs": "Capabilities of the connected Reader.\n\nImplementations that predate this method reject. That is a signal, not a\nfailure: the caller treats a rejection as a handheld Mobile Reader.",
|
|
15
|
+
"complexTypes": [
|
|
16
|
+
"ReaderCapabilities"
|
|
17
|
+
],
|
|
18
|
+
"slug": "getcapabilities"
|
|
19
|
+
},
|
|
8
20
|
{
|
|
9
21
|
"name": "isConnected",
|
|
10
22
|
"signature": "() => Promise<{ connected: boolean; }>",
|
|
@@ -214,7 +226,45 @@
|
|
|
214
226
|
],
|
|
215
227
|
"properties": []
|
|
216
228
|
},
|
|
217
|
-
"interfaces": [
|
|
229
|
+
"interfaces": [
|
|
230
|
+
{
|
|
231
|
+
"name": "ReaderCapabilities",
|
|
232
|
+
"slug": "readercapabilities",
|
|
233
|
+
"docs": "What the connected Reader can do. Mode gating comes from here, not from the\nreader type — a desktop reader that can write must not be gated like one\nthat cannot.",
|
|
234
|
+
"tags": [],
|
|
235
|
+
"methods": [],
|
|
236
|
+
"properties": [
|
|
237
|
+
{
|
|
238
|
+
"name": "canWrite",
|
|
239
|
+
"tags": [],
|
|
240
|
+
"docs": "Reader can write an EPC to a tag (Generate & Set mode depends on it).",
|
|
241
|
+
"complexTypes": [],
|
|
242
|
+
"type": "boolean"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"name": "hasRssi",
|
|
246
|
+
"tags": [],
|
|
247
|
+
"docs": "Reader reports RSSI (Find mode depends on it).",
|
|
248
|
+
"complexTypes": [],
|
|
249
|
+
"type": "boolean"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"name": "isHandheld",
|
|
253
|
+
"tags": [],
|
|
254
|
+
"docs": "Reader is a handheld terminal rather than a desk device.",
|
|
255
|
+
"complexTypes": [],
|
|
256
|
+
"type": "boolean"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
"name": "power",
|
|
260
|
+
"tags": [],
|
|
261
|
+
"docs": "Output power range in dBm. The power slider renders this range.",
|
|
262
|
+
"complexTypes": [],
|
|
263
|
+
"type": "{ min: number; max: number; default: number; }"
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
],
|
|
218
268
|
"enums": [],
|
|
219
269
|
"typeAliases": [],
|
|
220
270
|
"pluginConfigs": []
|
|
@@ -1,5 +1,31 @@
|
|
|
1
1
|
import type { Plugin } from '@capacitor/core';
|
|
2
|
+
/**
|
|
3
|
+
* What the connected Reader can do. Mode gating comes from here, not from the
|
|
4
|
+
* reader type — a desktop reader that can write must not be gated like one
|
|
5
|
+
* that cannot.
|
|
6
|
+
*/
|
|
7
|
+
export interface ReaderCapabilities {
|
|
8
|
+
/** Reader can write an EPC to a tag (Generate & Set mode depends on it). */
|
|
9
|
+
canWrite: boolean;
|
|
10
|
+
/** Reader reports RSSI (Find mode depends on it). */
|
|
11
|
+
hasRssi: boolean;
|
|
12
|
+
/** Reader is a handheld terminal rather than a desk device. */
|
|
13
|
+
isHandheld: boolean;
|
|
14
|
+
/** Output power range in dBm. The power slider renders this range. */
|
|
15
|
+
power: {
|
|
16
|
+
min: number;
|
|
17
|
+
max: number;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
2
21
|
export interface RFIDPlugin extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* Capabilities of the connected Reader.
|
|
24
|
+
*
|
|
25
|
+
* Implementations that predate this method reject. That is a signal, not a
|
|
26
|
+
* failure: the caller treats a rejection as a handheld Mobile Reader.
|
|
27
|
+
*/
|
|
28
|
+
getCapabilities(): Promise<ReaderCapabilities>;
|
|
3
29
|
isConnected(): Promise<{
|
|
4
30
|
connected: boolean;
|
|
5
31
|
}>;
|
|
@@ -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(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: {\n epc: string;\n password?: string;\n }): Promise<{ value: number }>;\n writeEpcString(options: {\n epc: string;\n password?: string;\n }): Promise<{ value: number }>;\n\n startSearch(options: { searchableTags: string[], playSound: boolean }): Promise<void>;\n stopSearch(): Promise<void>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"","sourcesContent":["import type { Plugin } from '@capacitor/core';\n\n/**\n * What the connected Reader can do. Mode gating comes from here, not from the\n * reader type — a desktop reader that can write must not be gated like one\n * that cannot.\n */\nexport interface ReaderCapabilities {\n /** Reader can write an EPC to a tag (Generate & Set mode depends on it). */\n canWrite: boolean;\n /** Reader reports RSSI (Find mode depends on it). */\n hasRssi: boolean;\n /** Reader is a handheld terminal rather than a desk device. */\n isHandheld: boolean;\n /** Output power range in dBm. The power slider renders this range. */\n power: {\n min: number;\n max: number;\n default: number;\n };\n}\n\nexport interface RFIDPlugin extends Plugin {\n /**\n * Capabilities of the connected Reader.\n *\n * Implementations that predate this method reject. That is a signal, not a\n * failure: the caller treats a rejection as a handheld Mobile Reader.\n */\n getCapabilities(): Promise<ReaderCapabilities>;\n\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(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: {\n epc: string;\n password?: string;\n }): Promise<{ value: number }>;\n writeEpcString(options: {\n epc: string;\n password?: string;\n }): Promise<{ value: number }>;\n\n startSearch(options: { searchableTags: string[], playSound: boolean }): Promise<void>;\n stopSearch(): Promise<void>;\n}\n"]}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { registerPlugin } from '@capacitor/core';
|
|
2
2
|
const RFID = registerPlugin('RFID', {
|
|
3
3
|
web: () => import('./web').then(m => new m.RFIDWeb()),
|
|
4
|
+
electron: () => {
|
|
5
|
+
var _a, _b;
|
|
6
|
+
const plugin = (_b = (_a = window.CapacitorCustomPlatform) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.RFID;
|
|
7
|
+
if (!plugin) {
|
|
8
|
+
throw new Error('RFID is not registered in the Electron runtime. Register the driver in electron-plugins.js.');
|
|
9
|
+
}
|
|
10
|
+
return plugin;
|
|
11
|
+
},
|
|
4
12
|
});
|
|
5
13
|
export * from './definitions';
|
|
6
14
|
export { RFID };
|
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;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAQjD,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;IACrD,QAAQ,EAAE,GAAG,EAAE;;QACb,MAAM,MAAM,eAAI,MAAyB,CAAC,uBAAuB,0CAAE,OAAO,0CACtE,IAAI,CAAC;QAET,IAAI,CAAC,MAAM,EAAE;YACX,MAAM,IAAI,KAAK,CACb,6FAA6F,CAC9F,CAAC;SACH;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,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\ntype ElectronWindow = Window & {\n CapacitorCustomPlatform?: { plugins?: { RFID?: RFIDPlugin } };\n};\n\nconst RFID = registerPlugin<RFIDPlugin>('RFID', {\n web: () => import('./web').then(m => new m.RFIDWeb()),\n electron: () => {\n const plugin = (window as ElectronWindow).CapacitorCustomPlatform?.plugins\n ?.RFID;\n\n if (!plugin) {\n throw new Error(\n 'RFID is not registered in the Electron runtime. Register the driver in electron-plugins.js.',\n );\n }\n\n return plugin;\n },\n});\n\nexport * from './definitions';\nexport { RFID };\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { PluginListenerHandle } from '@capacitor/core';
|
|
3
|
+
import type { ReaderCapabilities, RFIDPlugin } from './definitions';
|
|
3
4
|
export declare class RFIDWeb extends WebPlugin implements RFIDPlugin {
|
|
5
|
+
/**
|
|
6
|
+
* The one method the browser can answer truthfully. Everything else rejects:
|
|
7
|
+
* a silent `resolve` makes the UI report a success that never happened.
|
|
8
|
+
*/
|
|
4
9
|
isConnected(): Promise<{
|
|
5
10
|
connected: boolean;
|
|
6
11
|
}>;
|
|
12
|
+
/**
|
|
13
|
+
* Events never fire without a Reader, so registering a listener here would be
|
|
14
|
+
* the same silent lie as a resolving `startScan()`.
|
|
15
|
+
*/
|
|
16
|
+
addListener(): Promise<PluginListenerHandle>;
|
|
17
|
+
getCapabilities(): Promise<ReaderCapabilities>;
|
|
7
18
|
startScan(): Promise<void>;
|
|
8
19
|
stopScan(): Promise<void>;
|
|
9
20
|
clearData(): Promise<void>;
|
|
10
|
-
getScanData(): Promise<
|
|
21
|
+
getScanData(): Promise<any>;
|
|
11
22
|
getOutputPower(): Promise<{
|
|
12
23
|
value: number;
|
|
13
24
|
}>;
|
|
14
|
-
setOutputPower(
|
|
15
|
-
power: number;
|
|
16
|
-
}): Promise<{
|
|
25
|
+
setOutputPower(): Promise<{
|
|
17
26
|
value: number;
|
|
18
27
|
}>;
|
|
19
28
|
getRange(): Promise<{
|
|
20
29
|
value: number;
|
|
21
30
|
}>;
|
|
22
|
-
setRange(
|
|
23
|
-
range: number;
|
|
24
|
-
}): Promise<{
|
|
31
|
+
setRange(): Promise<{
|
|
25
32
|
value: number;
|
|
26
33
|
}>;
|
|
27
34
|
getQueryMode(): Promise<{
|
|
28
35
|
value: 0 | 1 | 2 | 3;
|
|
29
36
|
}>;
|
|
30
|
-
setQueryMode(
|
|
31
|
-
queryMode: 0 | 1 | 2 | 3;
|
|
32
|
-
}): Promise<{
|
|
37
|
+
setQueryMode(): Promise<{
|
|
33
38
|
value: number;
|
|
34
39
|
}>;
|
|
35
40
|
getReaderType(): Promise<{
|
|
@@ -38,21 +43,12 @@ export declare class RFIDWeb extends WebPlugin implements RFIDPlugin {
|
|
|
38
43
|
getFirmwareVersion(): Promise<{
|
|
39
44
|
value: string;
|
|
40
45
|
}>;
|
|
41
|
-
writeEpc(
|
|
42
|
-
epc: string;
|
|
43
|
-
password?: string;
|
|
44
|
-
}): Promise<{
|
|
46
|
+
writeEpc(): Promise<{
|
|
45
47
|
value: number;
|
|
46
48
|
}>;
|
|
47
|
-
writeEpcString(
|
|
48
|
-
epc: string;
|
|
49
|
-
password?: string;
|
|
50
|
-
}): Promise<{
|
|
49
|
+
writeEpcString(): Promise<{
|
|
51
50
|
value: number;
|
|
52
51
|
}>;
|
|
53
|
-
startSearch(
|
|
54
|
-
searchableTags: string[];
|
|
55
|
-
playSound: boolean;
|
|
56
|
-
}): Promise<void>;
|
|
52
|
+
startSearch(): Promise<void>;
|
|
57
53
|
stopSearch(): Promise<void>;
|
|
58
54
|
}
|
package/dist/esm/web.js
CHANGED
|
@@ -1,58 +1,70 @@
|
|
|
1
1
|
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
const NO_READER_ON_WEB = 'No RFID Reader in the browser. Use the desktop app (ox-desktop) or the Android handheld.';
|
|
2
3
|
export class RFIDWeb extends WebPlugin {
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* The one method the browser can answer truthfully. Everything else rejects:
|
|
6
|
+
* a silent `resolve` makes the UI report a success that never happened.
|
|
7
|
+
*/
|
|
8
|
+
async isConnected() {
|
|
9
|
+
return { connected: false };
|
|
5
10
|
}
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Events never fire without a Reader, so registering a listener here would be
|
|
13
|
+
* the same silent lie as a resolving `startScan()`.
|
|
14
|
+
*/
|
|
15
|
+
async addListener() {
|
|
16
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
8
17
|
}
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
async getCapabilities() {
|
|
19
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
11
20
|
}
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
async startScan() {
|
|
22
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
14
23
|
}
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
async stopScan() {
|
|
25
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
26
|
+
}
|
|
27
|
+
async clearData() {
|
|
28
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
29
|
+
}
|
|
30
|
+
async getScanData() {
|
|
31
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
17
32
|
}
|
|
18
33
|
async getOutputPower() {
|
|
19
|
-
|
|
34
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
20
35
|
}
|
|
21
|
-
async setOutputPower(
|
|
22
|
-
|
|
36
|
+
async setOutputPower() {
|
|
37
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
23
38
|
}
|
|
24
39
|
async getRange() {
|
|
25
|
-
|
|
40
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
26
41
|
}
|
|
27
|
-
async setRange(
|
|
28
|
-
|
|
42
|
+
async setRange() {
|
|
43
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
29
44
|
}
|
|
30
45
|
async getQueryMode() {
|
|
31
|
-
|
|
46
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
32
47
|
}
|
|
33
|
-
async setQueryMode(
|
|
34
|
-
|
|
48
|
+
async setQueryMode() {
|
|
49
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
35
50
|
}
|
|
36
51
|
async getReaderType() {
|
|
37
|
-
|
|
52
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
38
53
|
}
|
|
39
54
|
async getFirmwareVersion() {
|
|
40
|
-
|
|
55
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
41
56
|
}
|
|
42
|
-
async writeEpc(
|
|
43
|
-
|
|
44
|
-
return { value: -1 };
|
|
57
|
+
async writeEpc() {
|
|
58
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
45
59
|
}
|
|
46
|
-
async writeEpcString(
|
|
47
|
-
|
|
48
|
-
return { value: -1 };
|
|
60
|
+
async writeEpcString() {
|
|
61
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
49
62
|
}
|
|
50
|
-
async startSearch(
|
|
51
|
-
|
|
52
|
-
return Promise.resolve();
|
|
63
|
+
async startSearch() {
|
|
64
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
53
65
|
}
|
|
54
66
|
async stopSearch() {
|
|
55
|
-
|
|
67
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
56
68
|
}
|
|
57
69
|
}
|
|
58
70
|
//# 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;
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAK5C,MAAM,gBAAgB,GACpB,0FAA0F,CAAC;AAE7F,MAAM,OAAO,OAAQ,SAAQ,SAAS;IACpC;;;OAGG;IACH,KAAK,CAAC,WAAW;QACf,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,SAAS;QACb,MAAM,IAAI,CAA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CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,WAAW;QACf,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,UAAU;QACd,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IAC7C,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport type { PluginListenerHandle } from '@capacitor/core';\n\nimport type { ReaderCapabilities, RFIDPlugin } from './definitions';\n\nconst NO_READER_ON_WEB =\n 'No RFID Reader in the browser. Use the desktop app (ox-desktop) or the Android handheld.';\n\nexport class RFIDWeb extends WebPlugin implements RFIDPlugin {\n /**\n * The one method the browser can answer truthfully. Everything else rejects:\n * a silent `resolve` makes the UI report a success that never happened.\n */\n async isConnected(): Promise<{ connected: boolean }> {\n return { connected: false };\n }\n\n /**\n * Events never fire without a Reader, so registering a listener here would be\n * the same silent lie as a resolving `startScan()`.\n */\n async addListener(): Promise<PluginListenerHandle> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async getCapabilities(): Promise<ReaderCapabilities> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async startScan(): Promise<void> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async stopScan(): Promise<void> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async clearData(): Promise<void> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async getScanData(): Promise<any> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async getOutputPower(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async setOutputPower(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async getRange(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async setRange(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async getQueryMode(): Promise<{ value: 0 | 1 | 2 | 3 }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async setQueryMode(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async getReaderType(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async getFirmwareVersion(): Promise<{ value: string }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async writeEpc(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async writeEpcString(): Promise<{ value: number }> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async startSearch(): Promise<void> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n\n async stopSearch(): Promise<void> {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n}\n"]}
|
package/dist/plugin.cjs.js
CHANGED
|
@@ -6,62 +6,82 @@ var core = require('@capacitor/core');
|
|
|
6
6
|
|
|
7
7
|
const RFID = core.registerPlugin('RFID', {
|
|
8
8
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.RFIDWeb()),
|
|
9
|
+
electron: () => {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const plugin = (_b = (_a = window.CapacitorCustomPlatform) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.RFID;
|
|
12
|
+
if (!plugin) {
|
|
13
|
+
throw new Error('RFID is not registered in the Electron runtime. Register the driver in electron-plugins.js.');
|
|
14
|
+
}
|
|
15
|
+
return plugin;
|
|
16
|
+
},
|
|
9
17
|
});
|
|
10
18
|
|
|
19
|
+
const NO_READER_ON_WEB = 'No RFID Reader in the browser. Use the desktop app (ox-desktop) or the Android handheld.';
|
|
11
20
|
class RFIDWeb extends core.WebPlugin {
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
/**
|
|
22
|
+
* The one method the browser can answer truthfully. Everything else rejects:
|
|
23
|
+
* a silent `resolve` makes the UI report a success that never happened.
|
|
24
|
+
*/
|
|
25
|
+
async isConnected() {
|
|
26
|
+
return { connected: false };
|
|
14
27
|
}
|
|
15
|
-
|
|
16
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Events never fire without a Reader, so registering a listener here would be
|
|
30
|
+
* the same silent lie as a resolving `startScan()`.
|
|
31
|
+
*/
|
|
32
|
+
async addListener() {
|
|
33
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
17
34
|
}
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
async getCapabilities() {
|
|
36
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
20
37
|
}
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
async startScan() {
|
|
39
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
23
40
|
}
|
|
24
|
-
|
|
25
|
-
|
|
41
|
+
async stopScan() {
|
|
42
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
43
|
+
}
|
|
44
|
+
async clearData() {
|
|
45
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
46
|
+
}
|
|
47
|
+
async getScanData() {
|
|
48
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
26
49
|
}
|
|
27
50
|
async getOutputPower() {
|
|
28
|
-
|
|
51
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
29
52
|
}
|
|
30
|
-
async setOutputPower(
|
|
31
|
-
|
|
53
|
+
async setOutputPower() {
|
|
54
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
32
55
|
}
|
|
33
56
|
async getRange() {
|
|
34
|
-
|
|
57
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
35
58
|
}
|
|
36
|
-
async setRange(
|
|
37
|
-
|
|
59
|
+
async setRange() {
|
|
60
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
38
61
|
}
|
|
39
62
|
async getQueryMode() {
|
|
40
|
-
|
|
63
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
41
64
|
}
|
|
42
|
-
async setQueryMode(
|
|
43
|
-
|
|
65
|
+
async setQueryMode() {
|
|
66
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
44
67
|
}
|
|
45
68
|
async getReaderType() {
|
|
46
|
-
|
|
69
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
47
70
|
}
|
|
48
71
|
async getFirmwareVersion() {
|
|
49
|
-
|
|
72
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
50
73
|
}
|
|
51
|
-
async writeEpc(
|
|
52
|
-
|
|
53
|
-
return { value: -1 };
|
|
74
|
+
async writeEpc() {
|
|
75
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
54
76
|
}
|
|
55
|
-
async writeEpcString(
|
|
56
|
-
|
|
57
|
-
return { value: -1 };
|
|
77
|
+
async writeEpcString() {
|
|
78
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
58
79
|
}
|
|
59
|
-
async startSearch(
|
|
60
|
-
|
|
61
|
-
return Promise.resolve();
|
|
80
|
+
async startSearch() {
|
|
81
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
62
82
|
}
|
|
63
83
|
async stopSearch() {
|
|
64
|
-
|
|
84
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
65
85
|
}
|
|
66
86
|
}
|
|
67
87
|
|
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 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
|
|
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 electron: () => {\n var _a, _b;\n const plugin = (_b = (_a = window.CapacitorCustomPlatform) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.RFID;\n if (!plugin) {\n throw new Error('RFID is not registered in the Electron runtime. Register the driver in electron-plugins.js.');\n }\n return plugin;\n },\n});\nexport * from './definitions';\nexport { RFID };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nconst NO_READER_ON_WEB = 'No RFID Reader in the browser. Use the desktop app (ox-desktop) or the Android handheld.';\nexport class RFIDWeb extends WebPlugin {\n /**\n * The one method the browser can answer truthfully. Everything else rejects:\n * a silent `resolve` makes the UI report a success that never happened.\n */\n async isConnected() {\n return { connected: false };\n }\n /**\n * Events never fire without a Reader, so registering a listener here would be\n * the same silent lie as a resolving `startScan()`.\n */\n async addListener() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getCapabilities() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async startScan() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async stopScan() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async clearData() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getScanData() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getOutputPower() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async setOutputPower() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getRange() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async setRange() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getQueryMode() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async setQueryMode() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getReaderType() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getFirmwareVersion() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async writeEpc() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async writeEpcString() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async startSearch() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async stopSearch() {\n throw this.unimplemented(NO_READER_ON_WEB);\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,IAAI,QAAQ,EAAE,MAAM;AACpB,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;AACnB,QAAQ,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,uBAAuB,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;AACjK,QAAQ,IAAI,CAAC,MAAM,EAAE;AACrB,YAAY,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;AAC3H,SAAS;AACT,QAAQ,OAAO,MAAM,CAAC;AACtB,KAAK;AACL,CAAC;;ACVD,MAAM,gBAAgB,GAAG,0FAA0F,CAAC;AAC7G,MAAM,OAAO,SAASC,cAAS,CAAC;AACvC;AACA;AACA;AACA;AACA,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACpC,KAAK;AACL;AACA;AACA;AACA;AACA,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,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I,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,QAAQ,GAAG;AACrB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,cAAc,GAAG;AAC3B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,WAAW,GAAG;AACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACnD,KAAK;AACL,IAAI,MAAM,UAAU,GAAG;AACvB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;AACnD,KAAK;AACL;;;;;;;;;"}
|
package/dist/plugin.js
CHANGED
|
@@ -3,62 +3,82 @@ var capacitorExample = (function (exports, core) {
|
|
|
3
3
|
|
|
4
4
|
const RFID = core.registerPlugin('RFID', {
|
|
5
5
|
web: () => Promise.resolve().then(function () { return web; }).then(m => new m.RFIDWeb()),
|
|
6
|
+
electron: () => {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
const plugin = (_b = (_a = window.CapacitorCustomPlatform) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.RFID;
|
|
9
|
+
if (!plugin) {
|
|
10
|
+
throw new Error('RFID is not registered in the Electron runtime. Register the driver in electron-plugins.js.');
|
|
11
|
+
}
|
|
12
|
+
return plugin;
|
|
13
|
+
},
|
|
6
14
|
});
|
|
7
15
|
|
|
16
|
+
const NO_READER_ON_WEB = 'No RFID Reader in the browser. Use the desktop app (ox-desktop) or the Android handheld.';
|
|
8
17
|
class RFIDWeb extends core.WebPlugin {
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
/**
|
|
19
|
+
* The one method the browser can answer truthfully. Everything else rejects:
|
|
20
|
+
* a silent `resolve` makes the UI report a success that never happened.
|
|
21
|
+
*/
|
|
22
|
+
async isConnected() {
|
|
23
|
+
return { connected: false };
|
|
11
24
|
}
|
|
12
|
-
|
|
13
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Events never fire without a Reader, so registering a listener here would be
|
|
27
|
+
* the same silent lie as a resolving `startScan()`.
|
|
28
|
+
*/
|
|
29
|
+
async addListener() {
|
|
30
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
14
31
|
}
|
|
15
|
-
|
|
16
|
-
|
|
32
|
+
async getCapabilities() {
|
|
33
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
17
34
|
}
|
|
18
|
-
|
|
19
|
-
|
|
35
|
+
async startScan() {
|
|
36
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
20
37
|
}
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
async stopScan() {
|
|
39
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
40
|
+
}
|
|
41
|
+
async clearData() {
|
|
42
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
43
|
+
}
|
|
44
|
+
async getScanData() {
|
|
45
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
23
46
|
}
|
|
24
47
|
async getOutputPower() {
|
|
25
|
-
|
|
48
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
26
49
|
}
|
|
27
|
-
async setOutputPower(
|
|
28
|
-
|
|
50
|
+
async setOutputPower() {
|
|
51
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
29
52
|
}
|
|
30
53
|
async getRange() {
|
|
31
|
-
|
|
54
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
32
55
|
}
|
|
33
|
-
async setRange(
|
|
34
|
-
|
|
56
|
+
async setRange() {
|
|
57
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
35
58
|
}
|
|
36
59
|
async getQueryMode() {
|
|
37
|
-
|
|
60
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
38
61
|
}
|
|
39
|
-
async setQueryMode(
|
|
40
|
-
|
|
62
|
+
async setQueryMode() {
|
|
63
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
41
64
|
}
|
|
42
65
|
async getReaderType() {
|
|
43
|
-
|
|
66
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
44
67
|
}
|
|
45
68
|
async getFirmwareVersion() {
|
|
46
|
-
|
|
69
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
47
70
|
}
|
|
48
|
-
async writeEpc(
|
|
49
|
-
|
|
50
|
-
return { value: -1 };
|
|
71
|
+
async writeEpc() {
|
|
72
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
51
73
|
}
|
|
52
|
-
async writeEpcString(
|
|
53
|
-
|
|
54
|
-
return { value: -1 };
|
|
74
|
+
async writeEpcString() {
|
|
75
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
55
76
|
}
|
|
56
|
-
async startSearch(
|
|
57
|
-
|
|
58
|
-
return Promise.resolve();
|
|
77
|
+
async startSearch() {
|
|
78
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
59
79
|
}
|
|
60
80
|
async stopSearch() {
|
|
61
|
-
|
|
81
|
+
throw this.unimplemented(NO_READER_ON_WEB);
|
|
62
82
|
}
|
|
63
83
|
}
|
|
64
84
|
|
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 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
|
|
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 electron: () => {\n var _a, _b;\n const plugin = (_b = (_a = window.CapacitorCustomPlatform) === null || _a === void 0 ? void 0 : _a.plugins) === null || _b === void 0 ? void 0 : _b.RFID;\n if (!plugin) {\n throw new Error('RFID is not registered in the Electron runtime. Register the driver in electron-plugins.js.');\n }\n return plugin;\n },\n});\nexport * from './definitions';\nexport { RFID };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nconst NO_READER_ON_WEB = 'No RFID Reader in the browser. Use the desktop app (ox-desktop) or the Android handheld.';\nexport class RFIDWeb extends WebPlugin {\n /**\n * The one method the browser can answer truthfully. Everything else rejects:\n * a silent `resolve` makes the UI report a success that never happened.\n */\n async isConnected() {\n return { connected: false };\n }\n /**\n * Events never fire without a Reader, so registering a listener here would be\n * the same silent lie as a resolving `startScan()`.\n */\n async addListener() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getCapabilities() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async startScan() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async stopScan() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async clearData() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getScanData() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getOutputPower() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async setOutputPower() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getRange() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async setRange() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getQueryMode() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async setQueryMode() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getReaderType() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async getFirmwareVersion() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async writeEpc() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async writeEpcString() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async startSearch() {\n throw this.unimplemented(NO_READER_ON_WEB);\n }\n async stopSearch() {\n throw this.unimplemented(NO_READER_ON_WEB);\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,IAAI,QAAQ,EAAE,MAAM;IACpB,QAAQ,IAAI,EAAE,EAAE,EAAE,CAAC;IACnB,QAAQ,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,CAAC,EAAE,GAAG,MAAM,CAAC,uBAAuB,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,MAAM,IAAI,IAAI,EAAE,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;IACjK,QAAQ,IAAI,CAAC,MAAM,EAAE;IACrB,YAAY,MAAM,IAAI,KAAK,CAAC,6FAA6F,CAAC,CAAC;IAC3H,SAAS;IACT,QAAQ,OAAO,MAAM,CAAC;IACtB,KAAK;IACL,CAAC;;ICVD,MAAM,gBAAgB,GAAG,0FAA0F,CAAC;IAC7G,MAAM,OAAO,SAASC,cAAS,CAAC;IACvC;IACA;IACA;IACA;IACA,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;IACpC,KAAK;IACL;IACA;IACA;IACA;IACA,IAAI,MAAM,WAAW,GAAG;IACxB,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACnD,KAAK;IACL,IAAI,MAAM,eAAe,GAAG;IAC5B,QAAQ,MAAM,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACnD,KA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