@iotize/device-com-nfc.cordova 3.8.1 → 3.9.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/LICENSE +30 -30
- package/README.md +673 -673
- package/bundles/iotize-device-com-nfc.cordova.umd.js +1108 -967
- package/bundles/iotize-device-com-nfc.cordova.umd.js.map +1 -1
- package/bundles/iotize-device-com-nfc.cordova.umd.min.js +1 -1
- package/bundles/iotize-device-com-nfc.cordova.umd.min.js.map +1 -1
- package/esm2015/iotize-device-com-nfc.cordova.js +4 -4
- package/esm2015/iotize-device-com-nfc.cordova.ngsummary.json +1 -1
- package/esm2015/public_api.js +1 -1
- package/esm2015/public_api.ngsummary.json +1 -1
- package/esm2015/www/cordova-interface.js +1 -1
- package/esm2015/www/cordova-interface.js.map +1 -1
- package/esm2015/www/errors.js +30 -30
- package/esm2015/www/errors.js.map +1 -1
- package/esm2015/www/index.js +6 -6
- package/esm2015/www/index.js.map +1 -1
- package/esm2015/www/index.metadata.json +1 -1
- package/esm2015/www/index.ngsummary.json +1 -1
- package/esm2015/www/logger.js +2 -2
- package/esm2015/www/logger.js.map +1 -1
- package/esm2015/www/ndef/definitions.js +16 -16
- package/esm2015/www/ndef/definitions.js.map +1 -1
- package/esm2015/www/ndef/parse-ndef-message.js +293 -164
- package/esm2015/www/ndef/parse-ndef-message.js.map +1 -1
- package/esm2015/www/ndef/parse-ndef-message.metadata.json +1 -1
- package/esm2015/www/ndef/parse-ndef-message.ngsummary.json +1 -1
- package/esm2015/www/nfc-com-protocol.js +169 -169
- package/esm2015/www/nfc-com-protocol.js.map +1 -1
- package/esm2015/www/tap-ndef/definitions.js +1 -1
- package/esm2015/www/tap-ndef/definitions.js.map +1 -1
- package/esm2015/www/tap-ndef/index.js +2 -2
- package/esm2015/www/tap-ndef/index.js.map +1 -1
- package/esm2015/www/tap-ndef/parse-ndef-message.js +51 -51
- package/esm2015/www/tap-ndef/parse-ndef-message.js.map +1 -1
- package/esm2015/www/utility.js +10 -10
- package/esm2015/www/utility.js.map +1 -1
- package/esm2015/www/utility.ngsummary.json +1 -1
- package/fesm2015/iotize-device-com-nfc.cordova.js +555 -427
- package/fesm2015/iotize-device-com-nfc.cordova.js.map +1 -1
- package/iotize-device-com-nfc.cordova.d.ts +4 -4
- package/iotize-device-com-nfc.cordova.metadata.json +1 -1
- package/package.json +2 -2
- package/plugin.xml +98 -98
- package/public_api.d.ts +1 -1
- package/src/android/.gradle/4.10.1/fileChanges/last-build.bin +0 -0
- package/src/android/.gradle/4.10.1/fileHashes/fileHashes.bin +0 -0
- package/src/android/.gradle/4.10.1/fileHashes/fileHashes.lock +0 -0
- package/src/android/.gradle/4.10.1/gc.properties +0 -0
- package/src/android/build.gradle +38 -38
- package/src/android/gradle/wrapper/gradle-wrapper.properties +6 -6
- package/src/android/gradlew +172 -172
- package/src/android/gradlew.bat +84 -84
- package/src/android/local.properties +8 -8
- package/src/android/src/com/chariotsolutions/nfc/plugin/JSONBuilder.java +60 -60
- package/src/android/src/com/chariotsolutions/nfc/plugin/NfcPlugin.java +1151 -1151
- package/src/android/src/com/chariotsolutions/nfc/plugin/NfcPluginError.java +15 -15
- package/src/android/src/com/chariotsolutions/nfc/plugin/PluginResponse.java +85 -85
- package/src/android/src/com/chariotsolutions/nfc/plugin/Util.java +140 -140
- package/src/ios/AppDelegate+NFC.swift +51 -51
- package/src/ios/NFCHelpers.swift +144 -144
- package/src/ios/NFCNDEFDelegate.swift +78 -78
- package/src/ios/NFCTagReader.swift +506 -506
- package/www/cordova-interface.d.ts +34 -34
- package/www/errors.d.ts +17 -17
- package/www/index.d.ts +6 -6
- package/www/logger.d.ts +2 -2
- package/www/ndef/definitions.d.ts +15 -15
- package/www/ndef/parse-ndef-message.d.ts +12 -69
- package/www/nfc-com-protocol.d.ts +36 -36
- package/www/phonegap-nfc.js +911 -911
- package/www/tap-ndef/definitions.d.ts +25 -25
- package/www/tap-ndef/index.d.ts +2 -2
- package/www/tap-ndef/parse-ndef-message.d.ts +6 -6
- package/www/utility.d.ts +2 -2
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Partial typings for phonegap nfc cordova interface class
|
|
3
|
-
*/
|
|
4
|
-
export interface CordovaInterface {
|
|
5
|
-
/**
|
|
6
|
-
* Close current nfc tag
|
|
7
|
-
*/
|
|
8
|
-
close(): Promise<void>;
|
|
9
|
-
/**
|
|
10
|
-
* Connect to current Tap nfc tag
|
|
11
|
-
*/
|
|
12
|
-
connect(tech: string, timeout?: number): Promise<void>;
|
|
13
|
-
/**
|
|
14
|
-
* Raw NFC connect
|
|
15
|
-
*/
|
|
16
|
-
connectRaw(tech: string, timeout?: number): Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* Transeive data using Tap NFC communication protocol
|
|
19
|
-
* @param data ArrayBuffer or string of hex data for transcieve
|
|
20
|
-
*/
|
|
21
|
-
transceiveTap(data: ArrayBuffer | string): Promise<string>;
|
|
22
|
-
/**
|
|
23
|
-
* Transeive raw data
|
|
24
|
-
* @param data ArrayBuffer or string of hex data for transcieve
|
|
25
|
-
*/
|
|
26
|
-
transceive(data: ArrayBuffer | string): Promise<string>;
|
|
27
|
-
setTapDeviceDiscoveryEnabled(value: boolean): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Begins a reading session for the given technology.
|
|
30
|
-
* @param tech String representing the technology of the tap to discover.
|
|
31
|
-
*/
|
|
32
|
-
beginSessionFromTech(tech: string, alertMessage?: string): Promise<void>;
|
|
33
|
-
endSession(): Promise<void>;
|
|
34
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Partial typings for phonegap nfc cordova interface class
|
|
3
|
+
*/
|
|
4
|
+
export interface CordovaInterface {
|
|
5
|
+
/**
|
|
6
|
+
* Close current nfc tag
|
|
7
|
+
*/
|
|
8
|
+
close(): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* Connect to current Tap nfc tag
|
|
11
|
+
*/
|
|
12
|
+
connect(tech: string, timeout?: number): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Raw NFC connect
|
|
15
|
+
*/
|
|
16
|
+
connectRaw(tech: string, timeout?: number): Promise<void>;
|
|
17
|
+
/**
|
|
18
|
+
* Transeive data using Tap NFC communication protocol
|
|
19
|
+
* @param data ArrayBuffer or string of hex data for transcieve
|
|
20
|
+
*/
|
|
21
|
+
transceiveTap(data: ArrayBuffer | string): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Transeive raw data
|
|
24
|
+
* @param data ArrayBuffer or string of hex data for transcieve
|
|
25
|
+
*/
|
|
26
|
+
transceive(data: ArrayBuffer | string): Promise<string>;
|
|
27
|
+
setTapDeviceDiscoveryEnabled(value: boolean): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Begins a reading session for the given technology.
|
|
30
|
+
* @param tech String representing the technology of the tap to discover.
|
|
31
|
+
*/
|
|
32
|
+
beginSessionFromTech(tech: string, alertMessage?: string): Promise<void>;
|
|
33
|
+
endSession(): Promise<void>;
|
|
34
|
+
}
|
package/www/errors.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export declare class NfcError extends Error {
|
|
2
|
-
code: NfcError.ErrorCode;
|
|
3
|
-
constructor(code: NfcError.ErrorCode, message: string);
|
|
4
|
-
static tagLostError(): NfcError;
|
|
5
|
-
static notConnectedError(): NfcError;
|
|
6
|
-
static unknownError(errString: string): NfcError;
|
|
7
|
-
static tagConnectionFailed(): void;
|
|
8
|
-
static internalError(message: string): void;
|
|
9
|
-
}
|
|
10
|
-
export declare namespace NfcError {
|
|
11
|
-
enum ErrorCode {
|
|
12
|
-
Unknown = "NfcUnknownError",
|
|
13
|
-
InternalError = "NfcInternalError",
|
|
14
|
-
TagLostError = "NfcTagLostError",
|
|
15
|
-
NotConnectedError = "NfcNotConnectedError"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
export declare class NfcError extends Error {
|
|
2
|
+
code: NfcError.ErrorCode;
|
|
3
|
+
constructor(code: NfcError.ErrorCode, message: string);
|
|
4
|
+
static tagLostError(): NfcError;
|
|
5
|
+
static notConnectedError(): NfcError;
|
|
6
|
+
static unknownError(errString: string): NfcError;
|
|
7
|
+
static tagConnectionFailed(): void;
|
|
8
|
+
static internalError(message: string): void;
|
|
9
|
+
}
|
|
10
|
+
export declare namespace NfcError {
|
|
11
|
+
enum ErrorCode {
|
|
12
|
+
Unknown = "NfcUnknownError",
|
|
13
|
+
InternalError = "NfcInternalError",
|
|
14
|
+
TagLostError = "NfcTagLostError",
|
|
15
|
+
NotConnectedError = "NfcNotConnectedError"
|
|
16
|
+
}
|
|
17
|
+
}
|
package/www/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './cordova-interface';
|
|
2
|
-
export * from './errors';
|
|
3
|
-
export { TNF, WellKnownType } from './ndef/definitions';
|
|
4
|
-
export { parseNdefMessage, parseNdefMessages } from './ndef/parse-ndef-message';
|
|
5
|
-
export * from './nfc-com-protocol';
|
|
6
|
-
export * from './tap-ndef';
|
|
1
|
+
export * from './cordova-interface';
|
|
2
|
+
export * from './errors';
|
|
3
|
+
export { TNF, WellKnownType } from './ndef/definitions';
|
|
4
|
+
export { parseNdefMessage, parseNdefMessages, encodeNDEFMessage, encodeNDEFMessages, NdefParsedRecord } from './ndef/parse-ndef-message';
|
|
5
|
+
export * from './nfc-com-protocol';
|
|
6
|
+
export * from './tap-ndef';
|
package/www/logger.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { createDebugger } from '@iotize/common/debug';
|
|
2
|
-
export declare const debug: createDebugger.Debugger;
|
|
1
|
+
import { createDebugger } from '@iotize/common/debug';
|
|
2
|
+
export declare const debug: createDebugger.Debugger;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export declare enum TNF {
|
|
2
|
-
EMPTY = 0,
|
|
3
|
-
WELL_KNOWN_TYPE = 1,
|
|
4
|
-
MIME_TYPE = 2,
|
|
5
|
-
ABSOLUTE_URI = 3,
|
|
6
|
-
EXTERNAL = 4,
|
|
7
|
-
UNKNOWN = 5,
|
|
8
|
-
UNCHANGED = 6,
|
|
9
|
-
RFU = 7
|
|
10
|
-
}
|
|
11
|
-
export declare const WellKnownType: {
|
|
12
|
-
URI: number[];
|
|
13
|
-
TEXT: number[];
|
|
14
|
-
SMPART_POSTER: number[];
|
|
15
|
-
};
|
|
1
|
+
export declare enum TNF {
|
|
2
|
+
EMPTY = 0,
|
|
3
|
+
WELL_KNOWN_TYPE = 1,
|
|
4
|
+
MIME_TYPE = 2,
|
|
5
|
+
ABSOLUTE_URI = 3,
|
|
6
|
+
EXTERNAL = 4,
|
|
7
|
+
UNKNOWN = 5,
|
|
8
|
+
UNCHANGED = 6,
|
|
9
|
+
RFU = 7
|
|
10
|
+
}
|
|
11
|
+
export declare const WellKnownType: {
|
|
12
|
+
URI: number[];
|
|
13
|
+
TEXT: number[];
|
|
14
|
+
SMPART_POSTER: number[];
|
|
15
|
+
};
|
|
@@ -1,69 +1,12 @@
|
|
|
1
|
-
import { NdefRecord } from '../tap-ndef/definitions';
|
|
2
|
-
export declare
|
|
3
|
-
tnf: string;
|
|
4
|
-
value
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type: number[];
|
|
14
|
-
payload: number[];
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
} | {
|
|
18
|
-
tnf: string;
|
|
19
|
-
value: {
|
|
20
|
-
type: number[];
|
|
21
|
-
payload: number[];
|
|
22
|
-
};
|
|
23
|
-
} | {
|
|
24
|
-
tnf: string;
|
|
25
|
-
value: {
|
|
26
|
-
domain: string;
|
|
27
|
-
value: string;
|
|
28
|
-
};
|
|
29
|
-
} | {
|
|
30
|
-
tnf: number;
|
|
31
|
-
value: {
|
|
32
|
-
type: number[];
|
|
33
|
-
payload: number[];
|
|
34
|
-
};
|
|
35
|
-
})[];
|
|
36
|
-
export declare function parseNdefMessage(message: NdefRecord): {
|
|
37
|
-
tnf: string;
|
|
38
|
-
value: string;
|
|
39
|
-
} | {
|
|
40
|
-
tnf: string;
|
|
41
|
-
value: {
|
|
42
|
-
type: string;
|
|
43
|
-
value: string;
|
|
44
|
-
} | {
|
|
45
|
-
type: string;
|
|
46
|
-
value: {
|
|
47
|
-
type: number[];
|
|
48
|
-
payload: number[];
|
|
49
|
-
};
|
|
50
|
-
};
|
|
51
|
-
} | {
|
|
52
|
-
tnf: string;
|
|
53
|
-
value: {
|
|
54
|
-
type: number[];
|
|
55
|
-
payload: number[];
|
|
56
|
-
};
|
|
57
|
-
} | {
|
|
58
|
-
tnf: string;
|
|
59
|
-
value: {
|
|
60
|
-
domain: string;
|
|
61
|
-
value: string;
|
|
62
|
-
};
|
|
63
|
-
} | {
|
|
64
|
-
tnf: number;
|
|
65
|
-
value: {
|
|
66
|
-
type: number[];
|
|
67
|
-
payload: number[];
|
|
68
|
-
};
|
|
69
|
-
};
|
|
1
|
+
import { NdefRecord } from '../tap-ndef/definitions';
|
|
2
|
+
export declare type NdefParsedRecord = {
|
|
3
|
+
tnf: string | number;
|
|
4
|
+
value?: any;
|
|
5
|
+
payload?: any;
|
|
6
|
+
id: any[];
|
|
7
|
+
type: number[];
|
|
8
|
+
};
|
|
9
|
+
export declare function parseNdefMessages(messages: NdefRecord[] | undefined | null): NdefParsedRecord[];
|
|
10
|
+
export declare function parseNdefMessage(message: NdefRecord): NdefParsedRecord;
|
|
11
|
+
export declare function encodeNDEFMessages(ndefRecords: NdefParsedRecord[]): NdefRecord[];
|
|
12
|
+
export declare function encodeNDEFMessage(ndefRecord: NdefParsedRecord): NdefRecord;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { ComProtocolConnectOptions, ComProtocolDisconnectOptions, ComProtocolOptions, ComProtocolSendOptions } from '@iotize/tap/protocol/api';
|
|
2
|
-
import { QueueComProtocol } from '@iotize/tap/protocol/core';
|
|
3
|
-
import { Observable } from 'rxjs';
|
|
4
|
-
import { NfcError } from './errors';
|
|
5
|
-
export declare class NFCComProtocol extends QueueComProtocol {
|
|
6
|
-
constructor(options?: ComProtocolOptions);
|
|
7
|
-
static iOSProtocol(): NFCComProtocol;
|
|
8
|
-
private _sendQueue;
|
|
9
|
-
/**
|
|
10
|
-
* We force tag connection with nfc as we need to refresh tag
|
|
11
|
-
* @param options
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
connect(options?: ComProtocolConnectOptions): Observable<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Not used as we have rewrote "connect()" function
|
|
17
|
-
* @param options
|
|
18
|
-
* @returns
|
|
19
|
-
*/
|
|
20
|
-
_connect(options?: ComProtocolConnectOptions): Observable<any>;
|
|
21
|
-
_disconnect(options?: ComProtocolDisconnectOptions): Observable<any>;
|
|
22
|
-
/**
|
|
23
|
-
* Not used
|
|
24
|
-
* @param options
|
|
25
|
-
* @returns
|
|
26
|
-
*/
|
|
27
|
-
write(data: Uint8Array): Promise<any>;
|
|
28
|
-
/**
|
|
29
|
-
* Not used
|
|
30
|
-
* @param options
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
read(): Promise<Uint8Array>;
|
|
34
|
-
send(data: Uint8Array, options?: ComProtocolSendOptions): Observable<Uint8Array>;
|
|
35
|
-
_onConnectionLost(error: NfcError): void;
|
|
36
|
-
}
|
|
1
|
+
import { ComProtocolConnectOptions, ComProtocolDisconnectOptions, ComProtocolOptions, ComProtocolSendOptions } from '@iotize/tap/protocol/api';
|
|
2
|
+
import { QueueComProtocol } from '@iotize/tap/protocol/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import { NfcError } from './errors';
|
|
5
|
+
export declare class NFCComProtocol extends QueueComProtocol {
|
|
6
|
+
constructor(options?: ComProtocolOptions);
|
|
7
|
+
static iOSProtocol(): NFCComProtocol;
|
|
8
|
+
private _sendQueue;
|
|
9
|
+
/**
|
|
10
|
+
* We force tag connection with nfc as we need to refresh tag
|
|
11
|
+
* @param options
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
connect(options?: ComProtocolConnectOptions): Observable<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Not used as we have rewrote "connect()" function
|
|
17
|
+
* @param options
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
_connect(options?: ComProtocolConnectOptions): Observable<any>;
|
|
21
|
+
_disconnect(options?: ComProtocolDisconnectOptions): Observable<any>;
|
|
22
|
+
/**
|
|
23
|
+
* Not used
|
|
24
|
+
* @param options
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
write(data: Uint8Array): Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Not used
|
|
30
|
+
* @param options
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
read(): Promise<Uint8Array>;
|
|
34
|
+
send(data: Uint8Array, options?: ComProtocolSendOptions): Observable<Uint8Array>;
|
|
35
|
+
_onConnectionLost(error: NfcError): void;
|
|
36
|
+
}
|