@capacitor-community/bluetooth-le 7.3.0 → 8.0.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/CapacitorCommunityBluetoothLe.podspec +2 -2
- package/Package.swift +28 -0
- package/README.md +2 -1
- package/android/build.gradle +17 -12
- package/dist/esm/bleClient.d.ts +278 -278
- package/dist/esm/bleClient.js +361 -361
- package/dist/esm/bleClient.js.map +1 -1
- package/dist/esm/config.d.ts +53 -53
- package/dist/esm/config.js +2 -2
- package/dist/esm/conversion.d.ts +56 -46
- package/dist/esm/conversion.js +134 -117
- package/dist/esm/conversion.js.map +1 -1
- package/dist/esm/definitions.d.ts +352 -352
- package/dist/esm/definitions.js +42 -42
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +5 -5
- package/dist/esm/plugin.d.ts +2 -2
- package/dist/esm/plugin.js +4 -4
- package/dist/esm/queue.d.ts +3 -3
- package/dist/esm/queue.js +17 -17
- package/dist/esm/queue.js.map +1 -1
- package/dist/esm/timeout.d.ts +1 -1
- package/dist/esm/timeout.js +9 -9
- package/dist/esm/validators.d.ts +1 -1
- package/dist/esm/validators.js +11 -11
- package/dist/esm/validators.js.map +1 -1
- package/dist/esm/web.d.ts +57 -57
- package/dist/esm/web.js +403 -403
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +965 -947
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +965 -947
- package/dist/plugin.js.map +1 -1
- package/ios/{Plugin → Sources/BluetoothLe}/DeviceListView.swift +1 -1
- package/ios/{Plugin → Sources/BluetoothLe}/DeviceManager.swift +1 -0
- package/ios/{Plugin → Sources/BluetoothLe}/Plugin.swift +39 -1
- package/ios/{Plugin → Sources/BluetoothLe}/ThreadSafeDictionary.swift +2 -0
- package/ios/Tests/BluetoothLeTests/ConversionTests.swift +55 -0
- package/ios/Tests/BluetoothLeTests/PluginTests.swift +27 -0
- package/package.json +18 -14
- package/ios/Plugin/Info.plist +0 -24
- package/ios/Plugin/Plugin.h +0 -10
- package/ios/Plugin/Plugin.m +0 -41
- /package/ios/{Plugin → Sources/BluetoothLe}/Conversion.swift +0 -0
- /package/ios/{Plugin → Sources/BluetoothLe}/Device.swift +0 -0
- /package/ios/{Plugin → Sources/BluetoothLe}/Logging.swift +0 -0
package/dist/esm/definitions.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Android scan mode
|
|
3
|
-
*/
|
|
4
|
-
export var ScanMode;
|
|
5
|
-
(function (ScanMode) {
|
|
6
|
-
/**
|
|
7
|
-
* Perform Bluetooth LE scan in low power mode. This mode is enforced if the scanning application is not in foreground.
|
|
8
|
-
* https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_LOW_POWER
|
|
9
|
-
*/
|
|
10
|
-
ScanMode[ScanMode["SCAN_MODE_LOW_POWER"] = 0] = "SCAN_MODE_LOW_POWER";
|
|
11
|
-
/**
|
|
12
|
-
* Perform Bluetooth LE scan in balanced power mode. (default) Scan results are returned at a rate that provides a good trade-off between scan frequency and power consumption.
|
|
13
|
-
* https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_BALANCED
|
|
14
|
-
*/
|
|
15
|
-
ScanMode[ScanMode["SCAN_MODE_BALANCED"] = 1] = "SCAN_MODE_BALANCED";
|
|
16
|
-
/**
|
|
17
|
-
* Scan using highest duty cycle. It's recommended to only use this mode when the application is running in the foreground.
|
|
18
|
-
* https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_LOW_LATENCY
|
|
19
|
-
*/
|
|
20
|
-
ScanMode[ScanMode["SCAN_MODE_LOW_LATENCY"] = 2] = "SCAN_MODE_LOW_LATENCY";
|
|
21
|
-
})(ScanMode || (ScanMode = {}));
|
|
22
|
-
/**
|
|
23
|
-
* Android connection priority used in `requestConnectionPriority`
|
|
24
|
-
*/
|
|
25
|
-
export var ConnectionPriority;
|
|
26
|
-
(function (ConnectionPriority) {
|
|
27
|
-
/**
|
|
28
|
-
* Use the connection parameters recommended by the Bluetooth SIG. This is the default value if no connection parameter update is requested.
|
|
29
|
-
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_BALANCED
|
|
30
|
-
*/
|
|
31
|
-
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_BALANCED"] = 0] = "CONNECTION_PRIORITY_BALANCED";
|
|
32
|
-
/**
|
|
33
|
-
* Request a high priority, low latency connection. An application should only request high priority connection parameters to transfer large amounts of data over LE quickly. Once the transfer is complete, the application should request CONNECTION_PRIORITY_BALANCED connection parameters to reduce energy use.
|
|
34
|
-
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_HIGH
|
|
35
|
-
*/
|
|
36
|
-
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_HIGH"] = 1] = "CONNECTION_PRIORITY_HIGH";
|
|
37
|
-
/**
|
|
38
|
-
* Request low power, reduced data rate connection parameters.
|
|
39
|
-
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER
|
|
40
|
-
*/
|
|
41
|
-
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_LOW_POWER"] = 2] = "CONNECTION_PRIORITY_LOW_POWER";
|
|
42
|
-
})(ConnectionPriority || (ConnectionPriority = {}));
|
|
1
|
+
/**
|
|
2
|
+
* Android scan mode
|
|
3
|
+
*/
|
|
4
|
+
export var ScanMode;
|
|
5
|
+
(function (ScanMode) {
|
|
6
|
+
/**
|
|
7
|
+
* Perform Bluetooth LE scan in low power mode. This mode is enforced if the scanning application is not in foreground.
|
|
8
|
+
* https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_LOW_POWER
|
|
9
|
+
*/
|
|
10
|
+
ScanMode[ScanMode["SCAN_MODE_LOW_POWER"] = 0] = "SCAN_MODE_LOW_POWER";
|
|
11
|
+
/**
|
|
12
|
+
* Perform Bluetooth LE scan in balanced power mode. (default) Scan results are returned at a rate that provides a good trade-off between scan frequency and power consumption.
|
|
13
|
+
* https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_BALANCED
|
|
14
|
+
*/
|
|
15
|
+
ScanMode[ScanMode["SCAN_MODE_BALANCED"] = 1] = "SCAN_MODE_BALANCED";
|
|
16
|
+
/**
|
|
17
|
+
* Scan using highest duty cycle. It's recommended to only use this mode when the application is running in the foreground.
|
|
18
|
+
* https://developer.android.com/reference/android/bluetooth/le/ScanSettings#SCAN_MODE_LOW_LATENCY
|
|
19
|
+
*/
|
|
20
|
+
ScanMode[ScanMode["SCAN_MODE_LOW_LATENCY"] = 2] = "SCAN_MODE_LOW_LATENCY";
|
|
21
|
+
})(ScanMode || (ScanMode = {}));
|
|
22
|
+
/**
|
|
23
|
+
* Android connection priority used in `requestConnectionPriority`
|
|
24
|
+
*/
|
|
25
|
+
export var ConnectionPriority;
|
|
26
|
+
(function (ConnectionPriority) {
|
|
27
|
+
/**
|
|
28
|
+
* Use the connection parameters recommended by the Bluetooth SIG. This is the default value if no connection parameter update is requested.
|
|
29
|
+
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_BALANCED
|
|
30
|
+
*/
|
|
31
|
+
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_BALANCED"] = 0] = "CONNECTION_PRIORITY_BALANCED";
|
|
32
|
+
/**
|
|
33
|
+
* Request a high priority, low latency connection. An application should only request high priority connection parameters to transfer large amounts of data over LE quickly. Once the transfer is complete, the application should request CONNECTION_PRIORITY_BALANCED connection parameters to reduce energy use.
|
|
34
|
+
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_HIGH
|
|
35
|
+
*/
|
|
36
|
+
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_HIGH"] = 1] = "CONNECTION_PRIORITY_HIGH";
|
|
37
|
+
/**
|
|
38
|
+
* Request low power, reduced data rate connection parameters.
|
|
39
|
+
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER
|
|
40
|
+
*/
|
|
41
|
+
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_LOW_POWER"] = 2] = "CONNECTION_PRIORITY_LOW_POWER";
|
|
42
|
+
})(ConnectionPriority || (ConnectionPriority = {}));
|
|
43
43
|
//# sourceMappingURL=definitions.js.map
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './definitions';
|
|
2
|
-
export * from './bleClient';
|
|
3
|
-
export * from './conversion';
|
|
4
|
-
export * from './plugin';
|
|
5
|
-
export * from './config';
|
|
1
|
+
export * from './definitions';
|
|
2
|
+
export * from './bleClient';
|
|
3
|
+
export * from './conversion';
|
|
4
|
+
export * from './plugin';
|
|
5
|
+
export * from './config';
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './definitions';
|
|
2
|
-
export * from './bleClient';
|
|
3
|
-
export * from './conversion';
|
|
4
|
-
export * from './plugin';
|
|
5
|
-
export * from './config';
|
|
1
|
+
export * from './definitions';
|
|
2
|
+
export * from './bleClient';
|
|
3
|
+
export * from './conversion';
|
|
4
|
+
export * from './plugin';
|
|
5
|
+
export * from './config';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BluetoothLePlugin } from './definitions';
|
|
2
|
-
export declare const BluetoothLe: BluetoothLePlugin;
|
|
1
|
+
import type { BluetoothLePlugin } from './definitions';
|
|
2
|
+
export declare const BluetoothLe: BluetoothLePlugin;
|
package/dist/esm/plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { registerPlugin } from '@capacitor/core';
|
|
2
|
-
export const BluetoothLe = registerPlugin('BluetoothLe', {
|
|
3
|
-
web: () => import('./web').then((m) => new m.BluetoothLeWeb()),
|
|
4
|
-
});
|
|
1
|
+
import { registerPlugin } from '@capacitor/core';
|
|
2
|
+
export const BluetoothLe = registerPlugin('BluetoothLe', {
|
|
3
|
+
web: () => import('./web').then((m) => new m.BluetoothLeWeb()),
|
|
4
|
+
});
|
|
5
5
|
//# sourceMappingURL=plugin.js.map
|
package/dist/esm/queue.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
type Queue = <T>(fn: () => Promise<T>) => Promise<T>;
|
|
2
|
-
export declare function getQueue(enabled: boolean): Queue;
|
|
3
|
-
export {};
|
|
1
|
+
type Queue = <T>(fn: () => Promise<T>) => Promise<T>;
|
|
2
|
+
export declare function getQueue(enabled: boolean): Queue;
|
|
3
|
+
export {};
|
package/dist/esm/queue.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
const makeQueue = () => {
|
|
2
|
-
let currentTask = Promise.resolve();
|
|
3
|
-
// create a new promise so that errors can be bubbled
|
|
4
|
-
// up to the caller without being caught by the queue
|
|
5
|
-
return (fn) => new Promise((resolve, reject) => {
|
|
6
|
-
currentTask = currentTask
|
|
7
|
-
.then(() => fn())
|
|
8
|
-
.then(resolve)
|
|
9
|
-
.catch(reject);
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
export function getQueue(enabled) {
|
|
13
|
-
if (enabled) {
|
|
14
|
-
return makeQueue();
|
|
15
|
-
}
|
|
16
|
-
return (fn) => fn();
|
|
17
|
-
}
|
|
1
|
+
const makeQueue = () => {
|
|
2
|
+
let currentTask = Promise.resolve();
|
|
3
|
+
// create a new promise so that errors can be bubbled
|
|
4
|
+
// up to the caller without being caught by the queue
|
|
5
|
+
return (fn) => new Promise((resolve, reject) => {
|
|
6
|
+
currentTask = currentTask
|
|
7
|
+
.then(() => fn())
|
|
8
|
+
.then(resolve)
|
|
9
|
+
.catch(reject);
|
|
10
|
+
});
|
|
11
|
+
};
|
|
12
|
+
export function getQueue(enabled) {
|
|
13
|
+
if (enabled) {
|
|
14
|
+
return makeQueue();
|
|
15
|
+
}
|
|
16
|
+
return (fn) => fn();
|
|
17
|
+
}
|
|
18
18
|
//# sourceMappingURL=queue.js.map
|
package/dist/esm/queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/queue.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,GAAU,EAAE;IAC5B,IAAI,WAAW,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;IACtD,qDAAqD;IACrD,qDAAqD;IACrD,OAAO,CAAC,EAAE,EAAE,EAAE,CACZ,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC9B,WAAW,GAAG,WAAW;aACtB,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;aAChB,IAAI,CAAC,OAAO,CAAC;aACb,KAAK,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,OAAgB;IACvC,IAAI,OAAO,EAAE;
|
|
1
|
+
{"version":3,"file":"queue.js","sourceRoot":"","sources":["../../src/queue.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,GAAU,EAAE;IAC5B,IAAI,WAAW,GAAqB,OAAO,CAAC,OAAO,EAAE,CAAC;IACtD,qDAAqD;IACrD,qDAAqD;IACrD,OAAO,CAAC,EAAE,EAAE,EAAE,CACZ,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC9B,WAAW,GAAG,WAAW;aACtB,IAAI,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;aAChB,IAAI,CAAC,OAAO,CAAC;aACb,KAAK,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,UAAU,QAAQ,CAAC,OAAgB;IACvC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,SAAS,EAAE,CAAC;IACrB,CAAC;IACD,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC;AACtB,CAAC","sourcesContent":["type Queue = <T>(fn: () => Promise<T>) => Promise<T>;\n\nconst makeQueue = (): Queue => {\n let currentTask: Promise<unknown> = Promise.resolve();\n // create a new promise so that errors can be bubbled\n // up to the caller without being caught by the queue\n return (fn) =>\n new Promise((resolve, reject) => {\n currentTask = currentTask\n .then(() => fn())\n .then(resolve)\n .catch(reject);\n });\n};\n\nexport function getQueue(enabled: boolean): Queue {\n if (enabled) {\n return makeQueue();\n }\n return (fn) => fn();\n}\n"]}
|
package/dist/esm/timeout.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function runWithTimeout(promise: Promise<unknown>, time: number, exception: symbol): Promise<unknown>;
|
|
1
|
+
export declare function runWithTimeout(promise: Promise<unknown>, time: number, exception: symbol): Promise<unknown>;
|
package/dist/esm/timeout.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export async function runWithTimeout(promise, time, exception) {
|
|
2
|
-
let timer;
|
|
3
|
-
return Promise.race([
|
|
4
|
-
promise,
|
|
5
|
-
new Promise((_, reject) => {
|
|
6
|
-
timer = setTimeout(() => reject(exception), time);
|
|
7
|
-
}),
|
|
8
|
-
]).finally(() => clearTimeout(timer));
|
|
9
|
-
}
|
|
1
|
+
export async function runWithTimeout(promise, time, exception) {
|
|
2
|
+
let timer;
|
|
3
|
+
return Promise.race([
|
|
4
|
+
promise,
|
|
5
|
+
new Promise((_, reject) => {
|
|
6
|
+
timer = setTimeout(() => reject(exception), time);
|
|
7
|
+
}),
|
|
8
|
+
]).finally(() => clearTimeout(timer));
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=timeout.js.map
|
package/dist/esm/validators.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function parseUUID(uuid: any): string;
|
|
1
|
+
export declare function parseUUID(uuid: any): string;
|
package/dist/esm/validators.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export function parseUUID(uuid) {
|
|
2
|
-
if (typeof uuid !== 'string') {
|
|
3
|
-
throw new Error(`Invalid UUID type ${typeof uuid}. Expected string.`);
|
|
4
|
-
}
|
|
5
|
-
uuid = uuid.toLowerCase();
|
|
6
|
-
const is128BitUuid = uuid.search(/^[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}$/) >= 0;
|
|
7
|
-
if (!is128BitUuid) {
|
|
8
|
-
throw new Error(`Invalid UUID format ${uuid}. Expected 128 bit string (e.g. "0000180d-0000-1000-8000-00805f9b34fb").`);
|
|
9
|
-
}
|
|
10
|
-
return uuid;
|
|
11
|
-
}
|
|
1
|
+
export function parseUUID(uuid) {
|
|
2
|
+
if (typeof uuid !== 'string') {
|
|
3
|
+
throw new Error(`Invalid UUID type ${typeof uuid}. Expected string.`);
|
|
4
|
+
}
|
|
5
|
+
uuid = uuid.toLowerCase();
|
|
6
|
+
const is128BitUuid = uuid.search(/^[0-9a-f]{8}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{4}\b-[0-9a-f]{12}$/) >= 0;
|
|
7
|
+
if (!is128BitUuid) {
|
|
8
|
+
throw new Error(`Invalid UUID format ${uuid}. Expected 128 bit string (e.g. "0000180d-0000-1000-8000-00805f9b34fb").`);
|
|
9
|
+
}
|
|
10
|
+
return uuid;
|
|
11
|
+
}
|
|
12
12
|
//# sourceMappingURL=validators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/validators.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,IAAS;IACjC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/validators.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAC,IAAS;IACjC,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,qBAAqB,OAAO,IAAI,oBAAoB,CAAC,CAAC;IACxE,CAAC;IACD,IAAI,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAC1B,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,wEAAwE,CAAC,IAAI,CAAC,CAAC;IAChH,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CACb,uBAAuB,IAAI,0EAA0E,CACtG,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["export function parseUUID(uuid: any): string {\n if (typeof uuid !== 'string') {\n throw new Error(`Invalid UUID type ${typeof uuid}. Expected string.`);\n }\n uuid = uuid.toLowerCase();\n const is128BitUuid = uuid.search(/^[0-9a-f]{8}\\b-[0-9a-f]{4}\\b-[0-9a-f]{4}\\b-[0-9a-f]{4}\\b-[0-9a-f]{12}$/) >= 0;\n if (!is128BitUuid) {\n throw new Error(\n `Invalid UUID format ${uuid}. Expected 128 bit string (e.g. \"0000180d-0000-1000-8000-00805f9b34fb\").`,\n );\n }\n return uuid;\n}\n"]}
|
package/dist/esm/web.d.ts
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
import { WebPlugin } from '@capacitor/core';
|
|
2
|
-
import type { TimeoutOptions, BleDevice, BleServices, BluetoothLePlugin, BooleanResult, DeviceIdOptions, GetConnectedDevicesOptions, GetDevicesOptions, GetDevicesResult, ReadDescriptorOptions, ReadOptions, ReadResult, ReadRssiResult, RequestBleDeviceOptions, WriteOptions, WriteDescriptorOptions, GetMtuResult, RequestConnectionPriorityOptions } from './definitions';
|
|
3
|
-
export declare class BluetoothLeWeb extends WebPlugin implements BluetoothLePlugin {
|
|
4
|
-
private deviceMap;
|
|
5
|
-
private discoveredDevices;
|
|
6
|
-
private scan;
|
|
7
|
-
private requestBleDeviceOptions;
|
|
8
|
-
private DEFAULT_CONNECTION_TIMEOUT;
|
|
9
|
-
initialize(): Promise<void>;
|
|
10
|
-
isEnabled(): Promise<BooleanResult>;
|
|
11
|
-
requestEnable(): Promise<void>;
|
|
12
|
-
enable(): Promise<void>;
|
|
13
|
-
disable(): Promise<void>;
|
|
14
|
-
startEnabledNotifications(): Promise<void>;
|
|
15
|
-
stopEnabledNotifications(): Promise<void>;
|
|
16
|
-
isLocationEnabled(): Promise<BooleanResult>;
|
|
17
|
-
openLocationSettings(): Promise<void>;
|
|
18
|
-
openBluetoothSettings(): Promise<void>;
|
|
19
|
-
openAppSettings(): Promise<void>;
|
|
20
|
-
setDisplayStrings(): Promise<void>;
|
|
21
|
-
requestDevice(options?: RequestBleDeviceOptions): Promise<BleDevice>;
|
|
22
|
-
requestLEScan(options?: RequestBleDeviceOptions): Promise<void>;
|
|
23
|
-
private onAdvertisementReceivedCallback;
|
|
24
|
-
private onAdvertisementReceived;
|
|
25
|
-
stopLEScan(): Promise<void>;
|
|
26
|
-
getDevices(options: GetDevicesOptions): Promise<GetDevicesResult>;
|
|
27
|
-
getConnectedDevices(_options: GetConnectedDevicesOptions): Promise<GetDevicesResult>;
|
|
28
|
-
getBondedDevices(): Promise<GetDevicesResult>;
|
|
29
|
-
connect(options: DeviceIdOptions & TimeoutOptions): Promise<void>;
|
|
30
|
-
private onDisconnectedCallback;
|
|
31
|
-
private onDisconnected;
|
|
32
|
-
createBond(_options: DeviceIdOptions): Promise<void>;
|
|
33
|
-
isBonded(_options: DeviceIdOptions): Promise<BooleanResult>;
|
|
34
|
-
disconnect(options: DeviceIdOptions): Promise<void>;
|
|
35
|
-
getServices(options: DeviceIdOptions): Promise<BleServices>;
|
|
36
|
-
private getDescriptors;
|
|
37
|
-
private getProperties;
|
|
38
|
-
private getCharacteristic;
|
|
39
|
-
private getDescriptor;
|
|
40
|
-
discoverServices(_options: DeviceIdOptions): Promise<void>;
|
|
41
|
-
getMtu(_options: DeviceIdOptions): Promise<GetMtuResult>;
|
|
42
|
-
requestConnectionPriority(_options: RequestConnectionPriorityOptions): Promise<void>;
|
|
43
|
-
readRssi(_options: DeviceIdOptions): Promise<ReadRssiResult>;
|
|
44
|
-
read(options: ReadOptions): Promise<ReadResult>;
|
|
45
|
-
write(options: WriteOptions): Promise<void>;
|
|
46
|
-
writeWithoutResponse(options: WriteOptions): Promise<void>;
|
|
47
|
-
readDescriptor(options: ReadDescriptorOptions): Promise<ReadResult>;
|
|
48
|
-
writeDescriptor(options: WriteDescriptorOptions): Promise<void>;
|
|
49
|
-
startNotifications(options: ReadOptions): Promise<void>;
|
|
50
|
-
private onCharacteristicValueChangedCallback;
|
|
51
|
-
private onCharacteristicValueChanged;
|
|
52
|
-
stopNotifications(options: ReadOptions): Promise<void>;
|
|
53
|
-
private getFilters;
|
|
54
|
-
private matchesServiceDataFilter;
|
|
55
|
-
private getDeviceFromMap;
|
|
56
|
-
private getBleDevice;
|
|
57
|
-
}
|
|
1
|
+
import { WebPlugin } from '@capacitor/core';
|
|
2
|
+
import type { TimeoutOptions, BleDevice, BleServices, BluetoothLePlugin, BooleanResult, DeviceIdOptions, GetConnectedDevicesOptions, GetDevicesOptions, GetDevicesResult, ReadDescriptorOptions, ReadOptions, ReadResult, ReadRssiResult, RequestBleDeviceOptions, WriteOptions, WriteDescriptorOptions, GetMtuResult, RequestConnectionPriorityOptions } from './definitions';
|
|
3
|
+
export declare class BluetoothLeWeb extends WebPlugin implements BluetoothLePlugin {
|
|
4
|
+
private deviceMap;
|
|
5
|
+
private discoveredDevices;
|
|
6
|
+
private scan;
|
|
7
|
+
private requestBleDeviceOptions;
|
|
8
|
+
private DEFAULT_CONNECTION_TIMEOUT;
|
|
9
|
+
initialize(): Promise<void>;
|
|
10
|
+
isEnabled(): Promise<BooleanResult>;
|
|
11
|
+
requestEnable(): Promise<void>;
|
|
12
|
+
enable(): Promise<void>;
|
|
13
|
+
disable(): Promise<void>;
|
|
14
|
+
startEnabledNotifications(): Promise<void>;
|
|
15
|
+
stopEnabledNotifications(): Promise<void>;
|
|
16
|
+
isLocationEnabled(): Promise<BooleanResult>;
|
|
17
|
+
openLocationSettings(): Promise<void>;
|
|
18
|
+
openBluetoothSettings(): Promise<void>;
|
|
19
|
+
openAppSettings(): Promise<void>;
|
|
20
|
+
setDisplayStrings(): Promise<void>;
|
|
21
|
+
requestDevice(options?: RequestBleDeviceOptions): Promise<BleDevice>;
|
|
22
|
+
requestLEScan(options?: RequestBleDeviceOptions): Promise<void>;
|
|
23
|
+
private onAdvertisementReceivedCallback;
|
|
24
|
+
private onAdvertisementReceived;
|
|
25
|
+
stopLEScan(): Promise<void>;
|
|
26
|
+
getDevices(options: GetDevicesOptions): Promise<GetDevicesResult>;
|
|
27
|
+
getConnectedDevices(_options: GetConnectedDevicesOptions): Promise<GetDevicesResult>;
|
|
28
|
+
getBondedDevices(): Promise<GetDevicesResult>;
|
|
29
|
+
connect(options: DeviceIdOptions & TimeoutOptions): Promise<void>;
|
|
30
|
+
private onDisconnectedCallback;
|
|
31
|
+
private onDisconnected;
|
|
32
|
+
createBond(_options: DeviceIdOptions): Promise<void>;
|
|
33
|
+
isBonded(_options: DeviceIdOptions): Promise<BooleanResult>;
|
|
34
|
+
disconnect(options: DeviceIdOptions): Promise<void>;
|
|
35
|
+
getServices(options: DeviceIdOptions): Promise<BleServices>;
|
|
36
|
+
private getDescriptors;
|
|
37
|
+
private getProperties;
|
|
38
|
+
private getCharacteristic;
|
|
39
|
+
private getDescriptor;
|
|
40
|
+
discoverServices(_options: DeviceIdOptions): Promise<void>;
|
|
41
|
+
getMtu(_options: DeviceIdOptions): Promise<GetMtuResult>;
|
|
42
|
+
requestConnectionPriority(_options: RequestConnectionPriorityOptions): Promise<void>;
|
|
43
|
+
readRssi(_options: DeviceIdOptions): Promise<ReadRssiResult>;
|
|
44
|
+
read(options: ReadOptions): Promise<ReadResult>;
|
|
45
|
+
write(options: WriteOptions): Promise<void>;
|
|
46
|
+
writeWithoutResponse(options: WriteOptions): Promise<void>;
|
|
47
|
+
readDescriptor(options: ReadDescriptorOptions): Promise<ReadResult>;
|
|
48
|
+
writeDescriptor(options: WriteDescriptorOptions): Promise<void>;
|
|
49
|
+
startNotifications(options: ReadOptions): Promise<void>;
|
|
50
|
+
private onCharacteristicValueChangedCallback;
|
|
51
|
+
private onCharacteristicValueChanged;
|
|
52
|
+
stopNotifications(options: ReadOptions): Promise<void>;
|
|
53
|
+
private getFilters;
|
|
54
|
+
private matchesServiceDataFilter;
|
|
55
|
+
private getDeviceFromMap;
|
|
56
|
+
private getBleDevice;
|
|
57
|
+
}
|