@capacitor-community/bluetooth-le
Advanced tools
Comparing version 2.1.0 to 2.2.0
import type { DisplayStrings } from './config'; | ||
import type { BleDevice, BleService, InitializeOptions, RequestBleDeviceOptions, ScanResult, TimeoutOptions } from './definitions'; | ||
import type { BleDevice, BleService, ConnectionPriority, InitializeOptions, RequestBleDeviceOptions, ScanResult, TimeoutOptions } from './definitions'; | ||
export interface BleClientInterface { | ||
@@ -135,2 +135,15 @@ /** | ||
/** | ||
* Get the MTU of a connected device. Note that the maximum write value length is 3 bytes less than the MTU. | ||
* Not available on **web**. | ||
* @param deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan)) | ||
*/ | ||
getMtu(deviceId: string): Promise<number>; | ||
/** | ||
* Request a connection parameter update. | ||
* Only available on **Android**. https://developer.android.com/reference/android/bluetooth/BluetoothGatt#requestConnectionPriority(int) | ||
* @param deviceId The ID of the device to use (obtained from [requestDevice](#requestDevice) or [requestLEScan](#requestLEScan)) | ||
* @param connectionPriority Request a specific connection priority. See [ConnectionPriority](#connectionpriority) | ||
*/ | ||
requestConnectionPriority(deviceId: string, connectionPriority: ConnectionPriority): Promise<void>; | ||
/** | ||
* Read the RSSI value of a connected device. | ||
@@ -239,2 +252,4 @@ * Not available on **web**. | ||
discoverServices(deviceId: string): Promise<void>; | ||
getMtu(deviceId: string): Promise<number>; | ||
requestConnectionPriority(deviceId: string, connectionPriority: ConnectionPriority): Promise<void>; | ||
readRssi(deviceId: string): Promise<number>; | ||
@@ -241,0 +256,0 @@ read(deviceId: string, service: string, characteristic: string, options?: TimeoutOptions): Promise<DataView>; |
@@ -5,3 +5,3 @@ import { Capacitor } from '@capacitor/core'; | ||
import { getQueue } from './queue'; | ||
import { validateUUID } from './validators'; | ||
import { parseUUID } from './validators'; | ||
class BleClientClass { | ||
@@ -134,2 +134,6 @@ constructor() { | ||
async getConnectedDevices(services) { | ||
if (!Array.isArray(services)) { | ||
throw new Error('services must be an array'); | ||
} | ||
services = services.map(parseUUID); | ||
return this.queue(async () => { | ||
@@ -183,2 +187,14 @@ const result = await BluetoothLe.getConnectedDevices({ services }); | ||
} | ||
async getMtu(deviceId) { | ||
const value = await this.queue(async () => { | ||
const result = await BluetoothLe.getMtu({ deviceId }); | ||
return result.value; | ||
}); | ||
return value; | ||
} | ||
async requestConnectionPriority(deviceId, connectionPriority) { | ||
await this.queue(async () => { | ||
await BluetoothLe.requestConnectionPriority({ deviceId, connectionPriority }); | ||
}); | ||
} | ||
async readRssi(deviceId) { | ||
@@ -192,4 +208,4 @@ const value = await this.queue(async () => { | ||
async read(deviceId, service, characteristic, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
const value = await this.queue(async () => { | ||
@@ -204,4 +220,4 @@ const result = await BluetoothLe.read(Object.assign({ deviceId, | ||
async write(deviceId, service, characteristic, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
return this.queue(async () => { | ||
@@ -222,4 +238,4 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async writeWithoutResponse(deviceId, service, characteristic, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -240,5 +256,5 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async readDescriptor(deviceId, service, characteristic, descriptor, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
descriptor = validateUUID(descriptor); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
descriptor = parseUUID(descriptor); | ||
const value = await this.queue(async () => { | ||
@@ -254,5 +270,5 @@ const result = await BluetoothLe.readDescriptor(Object.assign({ deviceId, | ||
async writeDescriptor(deviceId, service, characteristic, descriptor, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
descriptor = validateUUID(descriptor); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
descriptor = parseUUID(descriptor); | ||
return this.queue(async () => { | ||
@@ -274,4 +290,4 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async startNotifications(deviceId, service, characteristic, callback) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -293,4 +309,4 @@ var _a; | ||
async stopNotifications(deviceId, service, characteristic) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -310,6 +326,6 @@ var _a; | ||
if (options.services) { | ||
options.services = options.services.map(validateUUID); | ||
options.services = options.services.map(parseUUID); | ||
} | ||
if (options.optionalServices) { | ||
options.optionalServices = options.optionalServices.map(validateUUID); | ||
options.optionalServices = options.optionalServices.map(parseUUID); | ||
} | ||
@@ -316,0 +332,0 @@ return options; |
@@ -67,2 +67,22 @@ import type { PluginListenerHandle } from '@capacitor/core'; | ||
} | ||
/** | ||
* Android connection priority used in `requestConnectionPriority` | ||
*/ | ||
export declare enum ConnectionPriority { | ||
/** | ||
* Use the connection parameters recommended by the Bluetooth SIG. This is the default value if no connection parameter update is requested. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_BALANCED | ||
*/ | ||
CONNECTION_PRIORITY_BALANCED = 0, | ||
/** | ||
* 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. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_HIGH | ||
*/ | ||
CONNECTION_PRIORITY_HIGH = 1, | ||
/** | ||
* Request low power, reduced data rate connection parameters. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER | ||
*/ | ||
CONNECTION_PRIORITY_LOW_POWER = 2 | ||
} | ||
export interface BleDevice { | ||
@@ -91,2 +111,5 @@ /** | ||
} | ||
export interface RequestConnectionPriorityOptions extends DeviceIdOptions { | ||
connectionPriority: ConnectionPriority; | ||
} | ||
export interface GetDevicesOptions { | ||
@@ -166,2 +189,5 @@ deviceIds: string[]; | ||
} | ||
export interface GetMtuResult { | ||
value: number; | ||
} | ||
export interface ReadRssiResult { | ||
@@ -257,2 +283,4 @@ value: string; | ||
discoverServices(options: DeviceIdOptions): Promise<void>; | ||
getMtu(options: DeviceIdOptions): Promise<GetMtuResult>; | ||
requestConnectionPriority(options: RequestConnectionPriorityOptions): Promise<void>; | ||
readRssi(options: DeviceIdOptions): Promise<ReadRssiResult>; | ||
@@ -259,0 +287,0 @@ read(options: ReadOptions & TimeoutOptions): Promise<ReadResult>; |
@@ -22,2 +22,23 @@ /** | ||
})(ScanMode || (ScanMode = {})); | ||
/** | ||
* Android connection priority used in `requestConnectionPriority` | ||
*/ | ||
export var ConnectionPriority; | ||
(function (ConnectionPriority) { | ||
/** | ||
* Use the connection parameters recommended by the Bluetooth SIG. This is the default value if no connection parameter update is requested. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_BALANCED | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_BALANCED"] = 0] = "CONNECTION_PRIORITY_BALANCED"; | ||
/** | ||
* 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. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_HIGH | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_HIGH"] = 1] = "CONNECTION_PRIORITY_HIGH"; | ||
/** | ||
* Request low power, reduced data rate connection parameters. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_LOW_POWER"] = 2] = "CONNECTION_PRIORITY_LOW_POWER"; | ||
})(ConnectionPriority || (ConnectionPriority = {})); | ||
//# sourceMappingURL=definitions.js.map |
@@ -1,1 +0,1 @@ | ||
export declare function validateUUID(uuid: any): string; | ||
export declare function parseUUID(uuid: any): string; |
@@ -1,2 +0,2 @@ | ||
export function validateUUID(uuid) { | ||
export function parseUUID(uuid) { | ||
if (typeof uuid !== 'string') { | ||
@@ -3,0 +3,0 @@ throw new Error(`Invalid UUID type ${typeof uuid}. Expected string.`); |
import { WebPlugin } from '@capacitor/core'; | ||
import type { TimeoutOptions, BleDevice, BleServices, BluetoothLePlugin, BooleanResult, DeviceIdOptions, GetConnectedDevicesOptions, GetDevicesOptions, GetDevicesResult, ReadDescriptorOptions, ReadOptions, ReadResult, ReadRssiResult, RequestBleDeviceOptions, WriteOptions, WriteDescriptorOptions } from './definitions'; | ||
import type { TimeoutOptions, BleDevice, BleServices, BluetoothLePlugin, BooleanResult, DeviceIdOptions, GetConnectedDevicesOptions, GetDevicesOptions, GetDevicesResult, ReadDescriptorOptions, ReadOptions, ReadResult, ReadRssiResult, RequestBleDeviceOptions, WriteOptions, WriteDescriptorOptions, GetMtuResult, RequestConnectionPriorityOptions } from './definitions'; | ||
export declare class BluetoothLeWeb extends WebPlugin implements BluetoothLePlugin { | ||
@@ -39,2 +39,4 @@ private deviceMap; | ||
discoverServices(_options: DeviceIdOptions): Promise<void>; | ||
getMtu(_options: DeviceIdOptions): Promise<GetMtuResult>; | ||
requestConnectionPriority(_options: RequestConnectionPriorityOptions): Promise<void>; | ||
readRssi(_options: DeviceIdOptions): Promise<ReadRssiResult>; | ||
@@ -41,0 +43,0 @@ read(options: ReadOptions): Promise<ReadResult>; |
@@ -223,2 +223,8 @@ import { WebPlugin } from '@capacitor/core'; | ||
} | ||
async getMtu(_options) { | ||
throw this.unavailable('getMtu is not available on web.'); | ||
} | ||
async requestConnectionPriority(_options) { | ||
throw this.unavailable('requestConnectionPriority is not available on web.'); | ||
} | ||
async readRssi(_options) { | ||
@@ -225,0 +231,0 @@ throw this.unavailable('readRssi is not available on web.'); |
@@ -33,2 +33,23 @@ 'use strict'; | ||
})(exports.ScanMode || (exports.ScanMode = {})); | ||
/** | ||
* Android connection priority used in `requestConnectionPriority` | ||
*/ | ||
exports.ConnectionPriority = void 0; | ||
(function (ConnectionPriority) { | ||
/** | ||
* Use the connection parameters recommended by the Bluetooth SIG. This is the default value if no connection parameter update is requested. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_BALANCED | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_BALANCED"] = 0] = "CONNECTION_PRIORITY_BALANCED"; | ||
/** | ||
* 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. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_HIGH | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_HIGH"] = 1] = "CONNECTION_PRIORITY_HIGH"; | ||
/** | ||
* Request low power, reduced data rate connection parameters. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_LOW_POWER"] = 2] = "CONNECTION_PRIORITY_LOW_POWER"; | ||
})(exports.ConnectionPriority || (exports.ConnectionPriority = {})); | ||
@@ -121,3 +142,3 @@ /** | ||
function validateUUID(uuid) { | ||
function parseUUID(uuid) { | ||
if (typeof uuid !== 'string') { | ||
@@ -261,2 +282,6 @@ throw new Error(`Invalid UUID type ${typeof uuid}. Expected string.`); | ||
async getConnectedDevices(services) { | ||
if (!Array.isArray(services)) { | ||
throw new Error('services must be an array'); | ||
} | ||
services = services.map(parseUUID); | ||
return this.queue(async () => { | ||
@@ -310,2 +335,14 @@ const result = await BluetoothLe.getConnectedDevices({ services }); | ||
} | ||
async getMtu(deviceId) { | ||
const value = await this.queue(async () => { | ||
const result = await BluetoothLe.getMtu({ deviceId }); | ||
return result.value; | ||
}); | ||
return value; | ||
} | ||
async requestConnectionPriority(deviceId, connectionPriority) { | ||
await this.queue(async () => { | ||
await BluetoothLe.requestConnectionPriority({ deviceId, connectionPriority }); | ||
}); | ||
} | ||
async readRssi(deviceId) { | ||
@@ -319,4 +356,4 @@ const value = await this.queue(async () => { | ||
async read(deviceId, service, characteristic, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
const value = await this.queue(async () => { | ||
@@ -331,4 +368,4 @@ const result = await BluetoothLe.read(Object.assign({ deviceId, | ||
async write(deviceId, service, characteristic, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
return this.queue(async () => { | ||
@@ -349,4 +386,4 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async writeWithoutResponse(deviceId, service, characteristic, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -367,5 +404,5 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async readDescriptor(deviceId, service, characteristic, descriptor, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
descriptor = validateUUID(descriptor); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
descriptor = parseUUID(descriptor); | ||
const value = await this.queue(async () => { | ||
@@ -381,5 +418,5 @@ const result = await BluetoothLe.readDescriptor(Object.assign({ deviceId, | ||
async writeDescriptor(deviceId, service, characteristic, descriptor, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
descriptor = validateUUID(descriptor); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
descriptor = parseUUID(descriptor); | ||
return this.queue(async () => { | ||
@@ -401,4 +438,4 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async startNotifications(deviceId, service, characteristic, callback) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -420,4 +457,4 @@ var _a; | ||
async stopNotifications(deviceId, service, characteristic) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -437,6 +474,6 @@ var _a; | ||
if (options.services) { | ||
options.services = options.services.map(validateUUID); | ||
options.services = options.services.map(parseUUID); | ||
} | ||
if (options.optionalServices) { | ||
options.optionalServices = options.optionalServices.map(validateUUID); | ||
options.optionalServices = options.optionalServices.map(parseUUID); | ||
} | ||
@@ -696,2 +733,8 @@ return options; | ||
} | ||
async getMtu(_options) { | ||
throw this.unavailable('getMtu is not available on web.'); | ||
} | ||
async requestConnectionPriority(_options) { | ||
throw this.unavailable('requestConnectionPriority is not available on web.'); | ||
} | ||
async readRssi(_options) { | ||
@@ -698,0 +741,0 @@ throw this.unavailable('readRssi is not available on web.'); |
@@ -29,2 +29,23 @@ var capacitorCommunityBluetoothLe = (function (exports, core, throat) { | ||
})(exports.ScanMode || (exports.ScanMode = {})); | ||
/** | ||
* Android connection priority used in `requestConnectionPriority` | ||
*/ | ||
exports.ConnectionPriority = void 0; | ||
(function (ConnectionPriority) { | ||
/** | ||
* Use the connection parameters recommended by the Bluetooth SIG. This is the default value if no connection parameter update is requested. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_BALANCED | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_BALANCED"] = 0] = "CONNECTION_PRIORITY_BALANCED"; | ||
/** | ||
* 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. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_HIGH | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_HIGH"] = 1] = "CONNECTION_PRIORITY_HIGH"; | ||
/** | ||
* Request low power, reduced data rate connection parameters. | ||
* https://developer.android.com/reference/android/bluetooth/BluetoothGatt#CONNECTION_PRIORITY_LOW_POWER | ||
*/ | ||
ConnectionPriority[ConnectionPriority["CONNECTION_PRIORITY_LOW_POWER"] = 2] = "CONNECTION_PRIORITY_LOW_POWER"; | ||
})(exports.ConnectionPriority || (exports.ConnectionPriority = {})); | ||
@@ -117,3 +138,3 @@ /** | ||
function validateUUID(uuid) { | ||
function parseUUID(uuid) { | ||
if (typeof uuid !== 'string') { | ||
@@ -257,2 +278,6 @@ throw new Error(`Invalid UUID type ${typeof uuid}. Expected string.`); | ||
async getConnectedDevices(services) { | ||
if (!Array.isArray(services)) { | ||
throw new Error('services must be an array'); | ||
} | ||
services = services.map(parseUUID); | ||
return this.queue(async () => { | ||
@@ -306,2 +331,14 @@ const result = await BluetoothLe.getConnectedDevices({ services }); | ||
} | ||
async getMtu(deviceId) { | ||
const value = await this.queue(async () => { | ||
const result = await BluetoothLe.getMtu({ deviceId }); | ||
return result.value; | ||
}); | ||
return value; | ||
} | ||
async requestConnectionPriority(deviceId, connectionPriority) { | ||
await this.queue(async () => { | ||
await BluetoothLe.requestConnectionPriority({ deviceId, connectionPriority }); | ||
}); | ||
} | ||
async readRssi(deviceId) { | ||
@@ -315,4 +352,4 @@ const value = await this.queue(async () => { | ||
async read(deviceId, service, characteristic, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
const value = await this.queue(async () => { | ||
@@ -327,4 +364,4 @@ const result = await BluetoothLe.read(Object.assign({ deviceId, | ||
async write(deviceId, service, characteristic, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
return this.queue(async () => { | ||
@@ -345,4 +382,4 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async writeWithoutResponse(deviceId, service, characteristic, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -363,5 +400,5 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async readDescriptor(deviceId, service, characteristic, descriptor, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
descriptor = validateUUID(descriptor); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
descriptor = parseUUID(descriptor); | ||
const value = await this.queue(async () => { | ||
@@ -377,5 +414,5 @@ const result = await BluetoothLe.readDescriptor(Object.assign({ deviceId, | ||
async writeDescriptor(deviceId, service, characteristic, descriptor, value, options) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
descriptor = validateUUID(descriptor); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
descriptor = parseUUID(descriptor); | ||
return this.queue(async () => { | ||
@@ -397,4 +434,4 @@ if (!(value === null || value === void 0 ? void 0 : value.buffer)) { | ||
async startNotifications(deviceId, service, characteristic, callback) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -416,4 +453,4 @@ var _a; | ||
async stopNotifications(deviceId, service, characteristic) { | ||
service = validateUUID(service); | ||
characteristic = validateUUID(characteristic); | ||
service = parseUUID(service); | ||
characteristic = parseUUID(characteristic); | ||
await this.queue(async () => { | ||
@@ -433,6 +470,6 @@ var _a; | ||
if (options.services) { | ||
options.services = options.services.map(validateUUID); | ||
options.services = options.services.map(parseUUID); | ||
} | ||
if (options.optionalServices) { | ||
options.optionalServices = options.optionalServices.map(validateUUID); | ||
options.optionalServices = options.optionalServices.map(parseUUID); | ||
} | ||
@@ -692,2 +729,8 @@ return options; | ||
} | ||
async getMtu(_options) { | ||
throw this.unavailable('getMtu is not available on web.'); | ||
} | ||
async requestConnectionPriority(_options) { | ||
throw this.unavailable('requestConnectionPriority is not available on web.'); | ||
} | ||
async readRssi(_options) { | ||
@@ -694,0 +737,0 @@ throw this.unavailable('readRssi is not available on web.'); |
{ | ||
"name": "@capacitor-community/bluetooth-le", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Capacitor plugin for Bluetooth Low Energy ", | ||
@@ -11,3 +11,3 @@ "main": "dist/plugin.cjs.js", | ||
"verify": "npm run verify:ios && npm run verify:android && npm run verify:web", | ||
"verify:ios": "cd ios && pod install && xcodebuild clean build test -workspace Plugin.xcworkspace -scheme Plugin -destination \"platform=iOS Simulator,name=iPhone 12\" && cd ..", | ||
"verify:ios": "set -o pipefail && cd ios && pod install && xcodebuild clean build test -workspace Plugin.xcworkspace -scheme Plugin -destination \"platform=iOS Simulator,name=iPhone 12\" | xcpretty && cd ..", | ||
"verify:android": "cd android && ./gradlew clean build test && cd ..", | ||
@@ -38,3 +38,3 @@ "verify:web": "npm run test:coverage && npm run build", | ||
"@types/web-bluetooth": "^0.0.16", | ||
"throat": "^6.0.1" | ||
"throat": "^6.0.2" | ||
}, | ||
@@ -41,0 +41,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
613754
5174
1074
Updatedthroat@^6.0.2