@capgo/capacitor-bluetooth-low-energy 1.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.
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Utility class for BLE operations.
3
+ *
4
+ * @since 1.0.0
5
+ */
6
+ export class BluetoothLowEnergyUtils {
7
+ /**
8
+ * Convert a byte array to a hex string.
9
+ *
10
+ * @param bytes - The byte array to convert
11
+ * @returns The hex string
12
+ * @since 1.0.0
13
+ * @example
14
+ * ```typescript
15
+ * const hex = BluetoothLowEnergyUtils.convertBytesToHex([0x48, 0x65, 0x6c, 0x6c, 0x6f]);
16
+ * console.log(hex); // "48656c6c6f"
17
+ * ```
18
+ */
19
+ static convertBytesToHex(bytes) {
20
+ return bytes.map((b) => b.toString(16).padStart(2, '0')).join('');
21
+ }
22
+ /**
23
+ * Convert a hex string to a byte array.
24
+ *
25
+ * @param hex - The hex string to convert
26
+ * @returns The byte array
27
+ * @since 1.0.0
28
+ * @example
29
+ * ```typescript
30
+ * const bytes = BluetoothLowEnergyUtils.convertHexToBytes("48656c6c6f");
31
+ * console.log(bytes); // [72, 101, 108, 108, 111]
32
+ * ```
33
+ */
34
+ static convertHexToBytes(hex) {
35
+ const bytes = [];
36
+ for (let i = 0; i < hex.length; i += 2) {
37
+ bytes.push(parseInt(hex.substr(i, 2), 16));
38
+ }
39
+ return bytes;
40
+ }
41
+ /**
42
+ * Convert a string to a byte array (UTF-8).
43
+ *
44
+ * @param str - The string to convert
45
+ * @returns The byte array
46
+ * @since 1.0.0
47
+ * @example
48
+ * ```typescript
49
+ * const bytes = BluetoothLowEnergyUtils.convertStringToBytes("Hello");
50
+ * console.log(bytes); // [72, 101, 108, 108, 111]
51
+ * ```
52
+ */
53
+ static convertStringToBytes(str) {
54
+ return Array.from(new TextEncoder().encode(str));
55
+ }
56
+ /**
57
+ * Convert a byte array to a string (UTF-8).
58
+ *
59
+ * @param bytes - The byte array to convert
60
+ * @returns The string
61
+ * @since 1.0.0
62
+ * @example
63
+ * ```typescript
64
+ * const str = BluetoothLowEnergyUtils.convertBytesToString([72, 101, 108, 108, 111]);
65
+ * console.log(str); // "Hello"
66
+ * ```
67
+ */
68
+ static convertBytesToString(bytes) {
69
+ return new TextDecoder().decode(new Uint8Array(bytes));
70
+ }
71
+ }
72
+ //# sourceMappingURL=definitions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"definitions.js","sourceRoot":"","sources":["../../src/definitions.ts"],"names":[],"mappings":"AAk4CA;;;;GAIG;AACH,MAAM,OAAO,uBAAuB;IAClC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,iBAAiB,CAAC,KAAe;QACtC,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAW;QAClC,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,oBAAoB,CAAC,GAAW;QACrC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IACnD,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,oBAAoB,CAAC,KAAe;QACzC,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -0,0 +1,4 @@
1
+ import type { BluetoothLowEnergyPlugin } from './definitions';
2
+ declare const BluetoothLowEnergy: BluetoothLowEnergyPlugin;
3
+ export * from './definitions';
4
+ export { BluetoothLowEnergy };
@@ -0,0 +1,7 @@
1
+ import { registerPlugin } from '@capacitor/core';
2
+ const BluetoothLowEnergy = registerPlugin('BluetoothLowEnergy', {
3
+ web: () => import('./web').then((m) => new m.BluetoothLowEnergyWeb()),
4
+ });
5
+ export * from './definitions';
6
+ export { BluetoothLowEnergy };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,MAAM,kBAAkB,GAAG,cAAc,CAA2B,oBAAoB,EAAE;IACxF,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;CACtE,CAAC,CAAC;AAEH,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,112 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ import type { BluetoothLowEnergyPlugin, InitializeOptions, IsAvailableResult, IsEnabledResult, IsLocationEnabledResult, PermissionStatus, StartScanOptions, ConnectOptions, DisconnectOptions, CreateBondOptions, IsBondedOptions, IsBondedResult, DiscoverServicesOptions, GetServicesOptions, GetServicesResult, GetConnectedDevicesResult, ReadCharacteristicOptions, ReadCharacteristicResult, WriteCharacteristicOptions, StartCharacteristicNotificationsOptions, StopCharacteristicNotificationsOptions, ReadDescriptorOptions, ReadDescriptorResult, WriteDescriptorOptions, ReadRssiOptions, ReadRssiResult, RequestMtuOptions, RequestMtuResult, RequestConnectionPriorityOptions, StartAdvertisingOptions, StartForegroundServiceOptions, GetPluginVersionResult } from './definitions';
3
+ interface BluetoothDevice {
4
+ id: string;
5
+ name?: string;
6
+ gatt?: BluetoothRemoteGATTServer;
7
+ }
8
+ interface BluetoothRemoteGATTServer {
9
+ connected: boolean;
10
+ connect(): Promise<BluetoothRemoteGATTServer>;
11
+ disconnect(): void;
12
+ getPrimaryServices(): Promise<BluetoothRemoteGATTService[]>;
13
+ getPrimaryService(service: string): Promise<BluetoothRemoteGATTService>;
14
+ }
15
+ interface BluetoothRemoteGATTService {
16
+ uuid: string;
17
+ getCharacteristics(): Promise<BluetoothRemoteGATTCharacteristic[]>;
18
+ getCharacteristic(characteristic: string): Promise<BluetoothRemoteGATTCharacteristic>;
19
+ }
20
+ interface BluetoothRemoteGATTCharacteristic {
21
+ uuid: string;
22
+ properties: {
23
+ broadcast: boolean;
24
+ read: boolean;
25
+ writeWithoutResponse: boolean;
26
+ write: boolean;
27
+ notify: boolean;
28
+ indicate: boolean;
29
+ authenticatedSignedWrites: boolean;
30
+ reliableWrite?: boolean;
31
+ writableAuxiliaries?: boolean;
32
+ };
33
+ value?: DataView;
34
+ getDescriptors(): Promise<BluetoothRemoteGATTDescriptor[]>;
35
+ readValue(): Promise<DataView>;
36
+ writeValue(value: BufferSource): Promise<void>;
37
+ writeValueWithResponse(value: BufferSource): Promise<void>;
38
+ writeValueWithoutResponse(value: BufferSource): Promise<void>;
39
+ startNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
40
+ stopNotifications(): Promise<BluetoothRemoteGATTCharacteristic>;
41
+ addEventListener(type: string, listener: (event: Event & {
42
+ target: BluetoothRemoteGATTCharacteristic;
43
+ }) => void): void;
44
+ removeEventListener(type: string, listener: (event: Event & {
45
+ target: BluetoothRemoteGATTCharacteristic;
46
+ }) => void): void;
47
+ }
48
+ interface BluetoothRemoteGATTDescriptor {
49
+ uuid: string;
50
+ value?: DataView;
51
+ readValue(): Promise<DataView>;
52
+ writeValue(value: BufferSource): Promise<void>;
53
+ }
54
+ interface Bluetooth {
55
+ getAvailability(): Promise<boolean>;
56
+ requestDevice(options: RequestDeviceOptions): Promise<BluetoothDevice>;
57
+ getDevices?(): Promise<BluetoothDevice[]>;
58
+ addEventListener(type: string, listener: (event: Event) => void): void;
59
+ removeEventListener(type: string, listener: (event: Event) => void): void;
60
+ }
61
+ interface RequestDeviceOptions {
62
+ filters?: {
63
+ services?: string[];
64
+ name?: string;
65
+ namePrefix?: string;
66
+ }[];
67
+ optionalServices?: string[];
68
+ acceptAllDevices?: boolean;
69
+ }
70
+ declare global {
71
+ interface Navigator {
72
+ bluetooth?: Bluetooth;
73
+ }
74
+ }
75
+ export declare class BluetoothLowEnergyWeb extends WebPlugin implements BluetoothLowEnergyPlugin {
76
+ private devices;
77
+ private services;
78
+ private characteristicListeners;
79
+ initialize(_options?: InitializeOptions): Promise<void>;
80
+ isAvailable(): Promise<IsAvailableResult>;
81
+ isEnabled(): Promise<IsEnabledResult>;
82
+ isLocationEnabled(): Promise<IsLocationEnabledResult>;
83
+ openAppSettings(): Promise<void>;
84
+ openBluetoothSettings(): Promise<void>;
85
+ openLocationSettings(): Promise<void>;
86
+ checkPermissions(): Promise<PermissionStatus>;
87
+ requestPermissions(): Promise<PermissionStatus>;
88
+ startScan(options?: StartScanOptions): Promise<void>;
89
+ stopScan(): Promise<void>;
90
+ connect(options: ConnectOptions): Promise<void>;
91
+ disconnect(options: DisconnectOptions): Promise<void>;
92
+ createBond(_options: CreateBondOptions): Promise<void>;
93
+ isBonded(_options: IsBondedOptions): Promise<IsBondedResult>;
94
+ discoverServices(options: DiscoverServicesOptions): Promise<void>;
95
+ getServices(options: GetServicesOptions): Promise<GetServicesResult>;
96
+ getConnectedDevices(): Promise<GetConnectedDevicesResult>;
97
+ readCharacteristic(options: ReadCharacteristicOptions): Promise<ReadCharacteristicResult>;
98
+ writeCharacteristic(options: WriteCharacteristicOptions): Promise<void>;
99
+ startCharacteristicNotifications(options: StartCharacteristicNotificationsOptions): Promise<void>;
100
+ stopCharacteristicNotifications(options: StopCharacteristicNotificationsOptions): Promise<void>;
101
+ readDescriptor(options: ReadDescriptorOptions): Promise<ReadDescriptorResult>;
102
+ writeDescriptor(options: WriteDescriptorOptions): Promise<void>;
103
+ readRssi(_options: ReadRssiOptions): Promise<ReadRssiResult>;
104
+ requestMtu(_options: RequestMtuOptions): Promise<RequestMtuResult>;
105
+ requestConnectionPriority(_options: RequestConnectionPriorityOptions): Promise<void>;
106
+ startAdvertising(_options: StartAdvertisingOptions): Promise<void>;
107
+ stopAdvertising(): Promise<void>;
108
+ startForegroundService(_options: StartForegroundServiceOptions): Promise<void>;
109
+ stopForegroundService(): Promise<void>;
110
+ getPluginVersion(): Promise<GetPluginVersionResult>;
111
+ }
112
+ export {};
@@ -0,0 +1,319 @@
1
+ import { WebPlugin } from '@capacitor/core';
2
+ export class BluetoothLowEnergyWeb extends WebPlugin {
3
+ constructor() {
4
+ super(...arguments);
5
+ this.devices = new Map();
6
+ this.services = new Map();
7
+ this.characteristicListeners = new Map();
8
+ }
9
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
10
+ async initialize(_options) {
11
+ if (!navigator.bluetooth) {
12
+ throw new Error('Web Bluetooth API is not available');
13
+ }
14
+ }
15
+ async isAvailable() {
16
+ if (!navigator.bluetooth) {
17
+ return { available: false };
18
+ }
19
+ try {
20
+ const available = await navigator.bluetooth.getAvailability();
21
+ return { available };
22
+ }
23
+ catch (_a) {
24
+ return { available: false };
25
+ }
26
+ }
27
+ async isEnabled() {
28
+ const { available } = await this.isAvailable();
29
+ return { enabled: available };
30
+ }
31
+ async isLocationEnabled() {
32
+ // Location is not relevant for Web Bluetooth
33
+ return { enabled: true };
34
+ }
35
+ async openAppSettings() {
36
+ throw new Error('openAppSettings is not supported on web');
37
+ }
38
+ async openBluetoothSettings() {
39
+ throw new Error('openBluetoothSettings is not supported on web');
40
+ }
41
+ async openLocationSettings() {
42
+ throw new Error('openLocationSettings is not supported on web');
43
+ }
44
+ async checkPermissions() {
45
+ // Web Bluetooth handles permissions through requestDevice
46
+ return {
47
+ bluetooth: 'prompt',
48
+ location: 'granted',
49
+ };
50
+ }
51
+ async requestPermissions() {
52
+ // Web Bluetooth handles permissions through requestDevice
53
+ return {
54
+ bluetooth: 'granted',
55
+ location: 'granted',
56
+ };
57
+ }
58
+ async startScan(options) {
59
+ var _a;
60
+ if (!navigator.bluetooth) {
61
+ throw new Error('Web Bluetooth API is not available');
62
+ }
63
+ const requestOptions = {};
64
+ if ((options === null || options === void 0 ? void 0 : options.services) && options.services.length > 0) {
65
+ requestOptions.filters = [{ services: options.services }];
66
+ }
67
+ else {
68
+ requestOptions.acceptAllDevices = true;
69
+ }
70
+ if (options === null || options === void 0 ? void 0 : options.services) {
71
+ requestOptions.optionalServices = options.services;
72
+ }
73
+ try {
74
+ const device = await navigator.bluetooth.requestDevice(requestOptions);
75
+ const bleDevice = {
76
+ deviceId: device.id,
77
+ name: (_a = device.name) !== null && _a !== void 0 ? _a : null,
78
+ };
79
+ this.devices.set(device.id, device);
80
+ this.notifyListeners('deviceScanned', { device: bleDevice });
81
+ }
82
+ catch (error) {
83
+ if (error instanceof Error && error.name === 'NotFoundError') {
84
+ // User cancelled the device picker
85
+ return;
86
+ }
87
+ throw error;
88
+ }
89
+ }
90
+ async stopScan() {
91
+ // Web Bluetooth doesn't have a continuous scan - it uses a picker
92
+ // Nothing to do here
93
+ }
94
+ async connect(options) {
95
+ const device = this.devices.get(options.deviceId);
96
+ if (!device) {
97
+ throw new Error(`Device ${options.deviceId} not found`);
98
+ }
99
+ if (!device.gatt) {
100
+ throw new Error(`Device ${options.deviceId} does not support GATT`);
101
+ }
102
+ await device.gatt.connect();
103
+ this.notifyListeners('deviceConnected', { deviceId: options.deviceId });
104
+ }
105
+ async disconnect(options) {
106
+ var _a;
107
+ const device = this.devices.get(options.deviceId);
108
+ if (!device) {
109
+ throw new Error(`Device ${options.deviceId} not found`);
110
+ }
111
+ if ((_a = device.gatt) === null || _a === void 0 ? void 0 : _a.connected) {
112
+ device.gatt.disconnect();
113
+ }
114
+ this.notifyListeners('deviceDisconnected', { deviceId: options.deviceId });
115
+ }
116
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
117
+ async createBond(_options) {
118
+ throw new Error('createBond is not supported on web');
119
+ }
120
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
121
+ async isBonded(_options) {
122
+ throw new Error('isBonded is not supported on web');
123
+ }
124
+ async discoverServices(options) {
125
+ var _a;
126
+ const device = this.devices.get(options.deviceId);
127
+ if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
128
+ throw new Error(`Device ${options.deviceId} is not connected`);
129
+ }
130
+ const gattServices = await device.gatt.getPrimaryServices();
131
+ const services = [];
132
+ for (const gattService of gattServices) {
133
+ const characteristics = await gattService.getCharacteristics();
134
+ const bleCharacteristics = await Promise.all(characteristics.map(async (char) => {
135
+ const descriptors = await char.getDescriptors();
136
+ return {
137
+ uuid: char.uuid,
138
+ properties: {
139
+ broadcast: char.properties.broadcast,
140
+ read: char.properties.read,
141
+ writeWithoutResponse: char.properties.writeWithoutResponse,
142
+ write: char.properties.write,
143
+ notify: char.properties.notify,
144
+ indicate: char.properties.indicate,
145
+ authenticatedSignedWrites: char.properties.authenticatedSignedWrites,
146
+ extendedProperties: false,
147
+ },
148
+ descriptors: descriptors.map((desc) => ({ uuid: desc.uuid })),
149
+ };
150
+ }));
151
+ services.push({
152
+ uuid: gattService.uuid,
153
+ characteristics: bleCharacteristics,
154
+ });
155
+ }
156
+ this.services.set(options.deviceId, services);
157
+ }
158
+ async getServices(options) {
159
+ const services = this.services.get(options.deviceId);
160
+ if (!services) {
161
+ return { services: [] };
162
+ }
163
+ return { services };
164
+ }
165
+ async getConnectedDevices() {
166
+ var _a, _b;
167
+ const devices = [];
168
+ for (const [deviceId, device] of this.devices) {
169
+ if ((_a = device.gatt) === null || _a === void 0 ? void 0 : _a.connected) {
170
+ devices.push({
171
+ deviceId,
172
+ name: (_b = device.name) !== null && _b !== void 0 ? _b : null,
173
+ });
174
+ }
175
+ }
176
+ return { devices };
177
+ }
178
+ async readCharacteristic(options) {
179
+ var _a;
180
+ const device = this.devices.get(options.deviceId);
181
+ if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
182
+ throw new Error(`Device ${options.deviceId} is not connected`);
183
+ }
184
+ const service = await device.gatt.getPrimaryService(options.service);
185
+ const characteristic = await service.getCharacteristic(options.characteristic);
186
+ const dataView = await characteristic.readValue();
187
+ const value = [];
188
+ for (let i = 0; i < dataView.byteLength; i++) {
189
+ value.push(dataView.getUint8(i));
190
+ }
191
+ return { value };
192
+ }
193
+ async writeCharacteristic(options) {
194
+ var _a;
195
+ const device = this.devices.get(options.deviceId);
196
+ if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
197
+ throw new Error(`Device ${options.deviceId} is not connected`);
198
+ }
199
+ const service = await device.gatt.getPrimaryService(options.service);
200
+ const characteristic = await service.getCharacteristic(options.characteristic);
201
+ const data = new Uint8Array(options.value);
202
+ if (options.type === 'withoutResponse') {
203
+ await characteristic.writeValueWithoutResponse(data);
204
+ }
205
+ else {
206
+ await characteristic.writeValueWithResponse(data);
207
+ }
208
+ }
209
+ async startCharacteristicNotifications(options) {
210
+ var _a;
211
+ const device = this.devices.get(options.deviceId);
212
+ if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
213
+ throw new Error(`Device ${options.deviceId} is not connected`);
214
+ }
215
+ const service = await device.gatt.getPrimaryService(options.service);
216
+ const characteristic = await service.getCharacteristic(options.characteristic);
217
+ const key = `${options.deviceId}-${options.service}-${options.characteristic}`;
218
+ const listener = (event) => {
219
+ const dataView = event.target.value;
220
+ if (!dataView)
221
+ return;
222
+ const value = [];
223
+ for (let i = 0; i < dataView.byteLength; i++) {
224
+ value.push(dataView.getUint8(i));
225
+ }
226
+ this.notifyListeners('characteristicChanged', {
227
+ deviceId: options.deviceId,
228
+ service: options.service,
229
+ characteristic: options.characteristic,
230
+ value,
231
+ });
232
+ };
233
+ characteristic.addEventListener('characteristicvaluechanged', listener);
234
+ this.characteristicListeners.set(key, listener);
235
+ await characteristic.startNotifications();
236
+ }
237
+ async stopCharacteristicNotifications(options) {
238
+ var _a;
239
+ const device = this.devices.get(options.deviceId);
240
+ if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
241
+ throw new Error(`Device ${options.deviceId} is not connected`);
242
+ }
243
+ const service = await device.gatt.getPrimaryService(options.service);
244
+ const characteristic = await service.getCharacteristic(options.characteristic);
245
+ const key = `${options.deviceId}-${options.service}-${options.characteristic}`;
246
+ const listener = this.characteristicListeners.get(key);
247
+ if (listener) {
248
+ characteristic.removeEventListener('characteristicvaluechanged', listener);
249
+ this.characteristicListeners.delete(key);
250
+ }
251
+ await characteristic.stopNotifications();
252
+ }
253
+ async readDescriptor(options) {
254
+ var _a;
255
+ const device = this.devices.get(options.deviceId);
256
+ if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
257
+ throw new Error(`Device ${options.deviceId} is not connected`);
258
+ }
259
+ const service = await device.gatt.getPrimaryService(options.service);
260
+ const characteristic = await service.getCharacteristic(options.characteristic);
261
+ const descriptors = await characteristic.getDescriptors();
262
+ const descriptor = descriptors.find((d) => d.uuid === options.descriptor);
263
+ if (!descriptor) {
264
+ throw new Error(`Descriptor ${options.descriptor} not found`);
265
+ }
266
+ const dataView = await descriptor.readValue();
267
+ const value = [];
268
+ for (let i = 0; i < dataView.byteLength; i++) {
269
+ value.push(dataView.getUint8(i));
270
+ }
271
+ return { value };
272
+ }
273
+ async writeDescriptor(options) {
274
+ var _a;
275
+ const device = this.devices.get(options.deviceId);
276
+ if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
277
+ throw new Error(`Device ${options.deviceId} is not connected`);
278
+ }
279
+ const service = await device.gatt.getPrimaryService(options.service);
280
+ const characteristic = await service.getCharacteristic(options.characteristic);
281
+ const descriptors = await characteristic.getDescriptors();
282
+ const descriptor = descriptors.find((d) => d.uuid === options.descriptor);
283
+ if (!descriptor) {
284
+ throw new Error(`Descriptor ${options.descriptor} not found`);
285
+ }
286
+ const data = new Uint8Array(options.value);
287
+ await descriptor.writeValue(data);
288
+ }
289
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
290
+ async readRssi(_options) {
291
+ throw new Error('readRssi is not supported on web');
292
+ }
293
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
294
+ async requestMtu(_options) {
295
+ throw new Error('requestMtu is not supported on web');
296
+ }
297
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
298
+ async requestConnectionPriority(_options) {
299
+ throw new Error('requestConnectionPriority is not supported on web');
300
+ }
301
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
302
+ async startAdvertising(_options) {
303
+ throw new Error('startAdvertising is not supported on web');
304
+ }
305
+ async stopAdvertising() {
306
+ throw new Error('stopAdvertising is not supported on web');
307
+ }
308
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
309
+ async startForegroundService(_options) {
310
+ throw new Error('startForegroundService is not supported on web');
311
+ }
312
+ async stopForegroundService() {
313
+ throw new Error('stopForegroundService is not supported on web');
314
+ }
315
+ async getPluginVersion() {
316
+ return { version: 'web' };
317
+ }
318
+ }
319
+ //# sourceMappingURL=web.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAqH5C,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAApD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