@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.
- package/CapgoCapacitorBluetoothLowEnergy.podspec +17 -0
- package/LICENSE +373 -0
- package/Package.swift +28 -0
- package/README.md +1154 -0
- package/android/build.gradle +59 -0
- package/android/src/main/AndroidManifest.xml +18 -0
- package/android/src/main/java/ee/forgr/plugin/bluetooth_low_energy/BluetoothLowEnergyPlugin.java +1149 -0
- package/dist/docs.json +2856 -0
- package/dist/esm/definitions.d.ts +1333 -0
- package/dist/esm/definitions.js +72 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web.d.ts +112 -0
- package/dist/esm/web.js +319 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +406 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +409 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/BluetoothLowEnergyPlugin/BluetoothLowEnergy.swift +623 -0
- package/ios/Sources/BluetoothLowEnergyPlugin/BluetoothLowEnergyPlugin.swift +448 -0
- package/ios/Tests/BluetoothLowEnergyPluginTests/BluetoothLowEnergyTests.swift +11 -0
- package/package.json +87 -0
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var core = require('@capacitor/core');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Utility class for BLE operations.
|
|
7
|
+
*
|
|
8
|
+
* @since 1.0.0
|
|
9
|
+
*/
|
|
10
|
+
class BluetoothLowEnergyUtils {
|
|
11
|
+
/**
|
|
12
|
+
* Convert a byte array to a hex string.
|
|
13
|
+
*
|
|
14
|
+
* @param bytes - The byte array to convert
|
|
15
|
+
* @returns The hex string
|
|
16
|
+
* @since 1.0.0
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const hex = BluetoothLowEnergyUtils.convertBytesToHex([0x48, 0x65, 0x6c, 0x6c, 0x6f]);
|
|
20
|
+
* console.log(hex); // "48656c6c6f"
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
static convertBytesToHex(bytes) {
|
|
24
|
+
return bytes.map((b) => b.toString(16).padStart(2, '0')).join('');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Convert a hex string to a byte array.
|
|
28
|
+
*
|
|
29
|
+
* @param hex - The hex string to convert
|
|
30
|
+
* @returns The byte array
|
|
31
|
+
* @since 1.0.0
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const bytes = BluetoothLowEnergyUtils.convertHexToBytes("48656c6c6f");
|
|
35
|
+
* console.log(bytes); // [72, 101, 108, 108, 111]
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
static convertHexToBytes(hex) {
|
|
39
|
+
const bytes = [];
|
|
40
|
+
for (let i = 0; i < hex.length; i += 2) {
|
|
41
|
+
bytes.push(parseInt(hex.substr(i, 2), 16));
|
|
42
|
+
}
|
|
43
|
+
return bytes;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Convert a string to a byte array (UTF-8).
|
|
47
|
+
*
|
|
48
|
+
* @param str - The string to convert
|
|
49
|
+
* @returns The byte array
|
|
50
|
+
* @since 1.0.0
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const bytes = BluetoothLowEnergyUtils.convertStringToBytes("Hello");
|
|
54
|
+
* console.log(bytes); // [72, 101, 108, 108, 111]
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
static convertStringToBytes(str) {
|
|
58
|
+
return Array.from(new TextEncoder().encode(str));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Convert a byte array to a string (UTF-8).
|
|
62
|
+
*
|
|
63
|
+
* @param bytes - The byte array to convert
|
|
64
|
+
* @returns The string
|
|
65
|
+
* @since 1.0.0
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* const str = BluetoothLowEnergyUtils.convertBytesToString([72, 101, 108, 108, 111]);
|
|
69
|
+
* console.log(str); // "Hello"
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
static convertBytesToString(bytes) {
|
|
73
|
+
return new TextDecoder().decode(new Uint8Array(bytes));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const BluetoothLowEnergy = core.registerPlugin('BluetoothLowEnergy', {
|
|
78
|
+
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.BluetoothLowEnergyWeb()),
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
class BluetoothLowEnergyWeb extends core.WebPlugin {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
this.devices = new Map();
|
|
85
|
+
this.services = new Map();
|
|
86
|
+
this.characteristicListeners = new Map();
|
|
87
|
+
}
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
89
|
+
async initialize(_options) {
|
|
90
|
+
if (!navigator.bluetooth) {
|
|
91
|
+
throw new Error('Web Bluetooth API is not available');
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async isAvailable() {
|
|
95
|
+
if (!navigator.bluetooth) {
|
|
96
|
+
return { available: false };
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
const available = await navigator.bluetooth.getAvailability();
|
|
100
|
+
return { available };
|
|
101
|
+
}
|
|
102
|
+
catch (_a) {
|
|
103
|
+
return { available: false };
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async isEnabled() {
|
|
107
|
+
const { available } = await this.isAvailable();
|
|
108
|
+
return { enabled: available };
|
|
109
|
+
}
|
|
110
|
+
async isLocationEnabled() {
|
|
111
|
+
// Location is not relevant for Web Bluetooth
|
|
112
|
+
return { enabled: true };
|
|
113
|
+
}
|
|
114
|
+
async openAppSettings() {
|
|
115
|
+
throw new Error('openAppSettings is not supported on web');
|
|
116
|
+
}
|
|
117
|
+
async openBluetoothSettings() {
|
|
118
|
+
throw new Error('openBluetoothSettings is not supported on web');
|
|
119
|
+
}
|
|
120
|
+
async openLocationSettings() {
|
|
121
|
+
throw new Error('openLocationSettings is not supported on web');
|
|
122
|
+
}
|
|
123
|
+
async checkPermissions() {
|
|
124
|
+
// Web Bluetooth handles permissions through requestDevice
|
|
125
|
+
return {
|
|
126
|
+
bluetooth: 'prompt',
|
|
127
|
+
location: 'granted',
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
async requestPermissions() {
|
|
131
|
+
// Web Bluetooth handles permissions through requestDevice
|
|
132
|
+
return {
|
|
133
|
+
bluetooth: 'granted',
|
|
134
|
+
location: 'granted',
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async startScan(options) {
|
|
138
|
+
var _a;
|
|
139
|
+
if (!navigator.bluetooth) {
|
|
140
|
+
throw new Error('Web Bluetooth API is not available');
|
|
141
|
+
}
|
|
142
|
+
const requestOptions = {};
|
|
143
|
+
if ((options === null || options === void 0 ? void 0 : options.services) && options.services.length > 0) {
|
|
144
|
+
requestOptions.filters = [{ services: options.services }];
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
requestOptions.acceptAllDevices = true;
|
|
148
|
+
}
|
|
149
|
+
if (options === null || options === void 0 ? void 0 : options.services) {
|
|
150
|
+
requestOptions.optionalServices = options.services;
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
const device = await navigator.bluetooth.requestDevice(requestOptions);
|
|
154
|
+
const bleDevice = {
|
|
155
|
+
deviceId: device.id,
|
|
156
|
+
name: (_a = device.name) !== null && _a !== void 0 ? _a : null,
|
|
157
|
+
};
|
|
158
|
+
this.devices.set(device.id, device);
|
|
159
|
+
this.notifyListeners('deviceScanned', { device: bleDevice });
|
|
160
|
+
}
|
|
161
|
+
catch (error) {
|
|
162
|
+
if (error instanceof Error && error.name === 'NotFoundError') {
|
|
163
|
+
// User cancelled the device picker
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async stopScan() {
|
|
170
|
+
// Web Bluetooth doesn't have a continuous scan - it uses a picker
|
|
171
|
+
// Nothing to do here
|
|
172
|
+
}
|
|
173
|
+
async connect(options) {
|
|
174
|
+
const device = this.devices.get(options.deviceId);
|
|
175
|
+
if (!device) {
|
|
176
|
+
throw new Error(`Device ${options.deviceId} not found`);
|
|
177
|
+
}
|
|
178
|
+
if (!device.gatt) {
|
|
179
|
+
throw new Error(`Device ${options.deviceId} does not support GATT`);
|
|
180
|
+
}
|
|
181
|
+
await device.gatt.connect();
|
|
182
|
+
this.notifyListeners('deviceConnected', { deviceId: options.deviceId });
|
|
183
|
+
}
|
|
184
|
+
async disconnect(options) {
|
|
185
|
+
var _a;
|
|
186
|
+
const device = this.devices.get(options.deviceId);
|
|
187
|
+
if (!device) {
|
|
188
|
+
throw new Error(`Device ${options.deviceId} not found`);
|
|
189
|
+
}
|
|
190
|
+
if ((_a = device.gatt) === null || _a === void 0 ? void 0 : _a.connected) {
|
|
191
|
+
device.gatt.disconnect();
|
|
192
|
+
}
|
|
193
|
+
this.notifyListeners('deviceDisconnected', { deviceId: options.deviceId });
|
|
194
|
+
}
|
|
195
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
196
|
+
async createBond(_options) {
|
|
197
|
+
throw new Error('createBond is not supported on web');
|
|
198
|
+
}
|
|
199
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
200
|
+
async isBonded(_options) {
|
|
201
|
+
throw new Error('isBonded is not supported on web');
|
|
202
|
+
}
|
|
203
|
+
async discoverServices(options) {
|
|
204
|
+
var _a;
|
|
205
|
+
const device = this.devices.get(options.deviceId);
|
|
206
|
+
if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
207
|
+
throw new Error(`Device ${options.deviceId} is not connected`);
|
|
208
|
+
}
|
|
209
|
+
const gattServices = await device.gatt.getPrimaryServices();
|
|
210
|
+
const services = [];
|
|
211
|
+
for (const gattService of gattServices) {
|
|
212
|
+
const characteristics = await gattService.getCharacteristics();
|
|
213
|
+
const bleCharacteristics = await Promise.all(characteristics.map(async (char) => {
|
|
214
|
+
const descriptors = await char.getDescriptors();
|
|
215
|
+
return {
|
|
216
|
+
uuid: char.uuid,
|
|
217
|
+
properties: {
|
|
218
|
+
broadcast: char.properties.broadcast,
|
|
219
|
+
read: char.properties.read,
|
|
220
|
+
writeWithoutResponse: char.properties.writeWithoutResponse,
|
|
221
|
+
write: char.properties.write,
|
|
222
|
+
notify: char.properties.notify,
|
|
223
|
+
indicate: char.properties.indicate,
|
|
224
|
+
authenticatedSignedWrites: char.properties.authenticatedSignedWrites,
|
|
225
|
+
extendedProperties: false,
|
|
226
|
+
},
|
|
227
|
+
descriptors: descriptors.map((desc) => ({ uuid: desc.uuid })),
|
|
228
|
+
};
|
|
229
|
+
}));
|
|
230
|
+
services.push({
|
|
231
|
+
uuid: gattService.uuid,
|
|
232
|
+
characteristics: bleCharacteristics,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
this.services.set(options.deviceId, services);
|
|
236
|
+
}
|
|
237
|
+
async getServices(options) {
|
|
238
|
+
const services = this.services.get(options.deviceId);
|
|
239
|
+
if (!services) {
|
|
240
|
+
return { services: [] };
|
|
241
|
+
}
|
|
242
|
+
return { services };
|
|
243
|
+
}
|
|
244
|
+
async getConnectedDevices() {
|
|
245
|
+
var _a, _b;
|
|
246
|
+
const devices = [];
|
|
247
|
+
for (const [deviceId, device] of this.devices) {
|
|
248
|
+
if ((_a = device.gatt) === null || _a === void 0 ? void 0 : _a.connected) {
|
|
249
|
+
devices.push({
|
|
250
|
+
deviceId,
|
|
251
|
+
name: (_b = device.name) !== null && _b !== void 0 ? _b : null,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
return { devices };
|
|
256
|
+
}
|
|
257
|
+
async readCharacteristic(options) {
|
|
258
|
+
var _a;
|
|
259
|
+
const device = this.devices.get(options.deviceId);
|
|
260
|
+
if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
261
|
+
throw new Error(`Device ${options.deviceId} is not connected`);
|
|
262
|
+
}
|
|
263
|
+
const service = await device.gatt.getPrimaryService(options.service);
|
|
264
|
+
const characteristic = await service.getCharacteristic(options.characteristic);
|
|
265
|
+
const dataView = await characteristic.readValue();
|
|
266
|
+
const value = [];
|
|
267
|
+
for (let i = 0; i < dataView.byteLength; i++) {
|
|
268
|
+
value.push(dataView.getUint8(i));
|
|
269
|
+
}
|
|
270
|
+
return { value };
|
|
271
|
+
}
|
|
272
|
+
async writeCharacteristic(options) {
|
|
273
|
+
var _a;
|
|
274
|
+
const device = this.devices.get(options.deviceId);
|
|
275
|
+
if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
276
|
+
throw new Error(`Device ${options.deviceId} is not connected`);
|
|
277
|
+
}
|
|
278
|
+
const service = await device.gatt.getPrimaryService(options.service);
|
|
279
|
+
const characteristic = await service.getCharacteristic(options.characteristic);
|
|
280
|
+
const data = new Uint8Array(options.value);
|
|
281
|
+
if (options.type === 'withoutResponse') {
|
|
282
|
+
await characteristic.writeValueWithoutResponse(data);
|
|
283
|
+
}
|
|
284
|
+
else {
|
|
285
|
+
await characteristic.writeValueWithResponse(data);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async startCharacteristicNotifications(options) {
|
|
289
|
+
var _a;
|
|
290
|
+
const device = this.devices.get(options.deviceId);
|
|
291
|
+
if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
292
|
+
throw new Error(`Device ${options.deviceId} is not connected`);
|
|
293
|
+
}
|
|
294
|
+
const service = await device.gatt.getPrimaryService(options.service);
|
|
295
|
+
const characteristic = await service.getCharacteristic(options.characteristic);
|
|
296
|
+
const key = `${options.deviceId}-${options.service}-${options.characteristic}`;
|
|
297
|
+
const listener = (event) => {
|
|
298
|
+
const dataView = event.target.value;
|
|
299
|
+
if (!dataView)
|
|
300
|
+
return;
|
|
301
|
+
const value = [];
|
|
302
|
+
for (let i = 0; i < dataView.byteLength; i++) {
|
|
303
|
+
value.push(dataView.getUint8(i));
|
|
304
|
+
}
|
|
305
|
+
this.notifyListeners('characteristicChanged', {
|
|
306
|
+
deviceId: options.deviceId,
|
|
307
|
+
service: options.service,
|
|
308
|
+
characteristic: options.characteristic,
|
|
309
|
+
value,
|
|
310
|
+
});
|
|
311
|
+
};
|
|
312
|
+
characteristic.addEventListener('characteristicvaluechanged', listener);
|
|
313
|
+
this.characteristicListeners.set(key, listener);
|
|
314
|
+
await characteristic.startNotifications();
|
|
315
|
+
}
|
|
316
|
+
async stopCharacteristicNotifications(options) {
|
|
317
|
+
var _a;
|
|
318
|
+
const device = this.devices.get(options.deviceId);
|
|
319
|
+
if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
320
|
+
throw new Error(`Device ${options.deviceId} is not connected`);
|
|
321
|
+
}
|
|
322
|
+
const service = await device.gatt.getPrimaryService(options.service);
|
|
323
|
+
const characteristic = await service.getCharacteristic(options.characteristic);
|
|
324
|
+
const key = `${options.deviceId}-${options.service}-${options.characteristic}`;
|
|
325
|
+
const listener = this.characteristicListeners.get(key);
|
|
326
|
+
if (listener) {
|
|
327
|
+
characteristic.removeEventListener('characteristicvaluechanged', listener);
|
|
328
|
+
this.characteristicListeners.delete(key);
|
|
329
|
+
}
|
|
330
|
+
await characteristic.stopNotifications();
|
|
331
|
+
}
|
|
332
|
+
async readDescriptor(options) {
|
|
333
|
+
var _a;
|
|
334
|
+
const device = this.devices.get(options.deviceId);
|
|
335
|
+
if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
336
|
+
throw new Error(`Device ${options.deviceId} is not connected`);
|
|
337
|
+
}
|
|
338
|
+
const service = await device.gatt.getPrimaryService(options.service);
|
|
339
|
+
const characteristic = await service.getCharacteristic(options.characteristic);
|
|
340
|
+
const descriptors = await characteristic.getDescriptors();
|
|
341
|
+
const descriptor = descriptors.find((d) => d.uuid === options.descriptor);
|
|
342
|
+
if (!descriptor) {
|
|
343
|
+
throw new Error(`Descriptor ${options.descriptor} not found`);
|
|
344
|
+
}
|
|
345
|
+
const dataView = await descriptor.readValue();
|
|
346
|
+
const value = [];
|
|
347
|
+
for (let i = 0; i < dataView.byteLength; i++) {
|
|
348
|
+
value.push(dataView.getUint8(i));
|
|
349
|
+
}
|
|
350
|
+
return { value };
|
|
351
|
+
}
|
|
352
|
+
async writeDescriptor(options) {
|
|
353
|
+
var _a;
|
|
354
|
+
const device = this.devices.get(options.deviceId);
|
|
355
|
+
if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {
|
|
356
|
+
throw new Error(`Device ${options.deviceId} is not connected`);
|
|
357
|
+
}
|
|
358
|
+
const service = await device.gatt.getPrimaryService(options.service);
|
|
359
|
+
const characteristic = await service.getCharacteristic(options.characteristic);
|
|
360
|
+
const descriptors = await characteristic.getDescriptors();
|
|
361
|
+
const descriptor = descriptors.find((d) => d.uuid === options.descriptor);
|
|
362
|
+
if (!descriptor) {
|
|
363
|
+
throw new Error(`Descriptor ${options.descriptor} not found`);
|
|
364
|
+
}
|
|
365
|
+
const data = new Uint8Array(options.value);
|
|
366
|
+
await descriptor.writeValue(data);
|
|
367
|
+
}
|
|
368
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
369
|
+
async readRssi(_options) {
|
|
370
|
+
throw new Error('readRssi is not supported on web');
|
|
371
|
+
}
|
|
372
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
373
|
+
async requestMtu(_options) {
|
|
374
|
+
throw new Error('requestMtu is not supported on web');
|
|
375
|
+
}
|
|
376
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
377
|
+
async requestConnectionPriority(_options) {
|
|
378
|
+
throw new Error('requestConnectionPriority is not supported on web');
|
|
379
|
+
}
|
|
380
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
381
|
+
async startAdvertising(_options) {
|
|
382
|
+
throw new Error('startAdvertising is not supported on web');
|
|
383
|
+
}
|
|
384
|
+
async stopAdvertising() {
|
|
385
|
+
throw new Error('stopAdvertising is not supported on web');
|
|
386
|
+
}
|
|
387
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
388
|
+
async startForegroundService(_options) {
|
|
389
|
+
throw new Error('startForegroundService is not supported on web');
|
|
390
|
+
}
|
|
391
|
+
async stopForegroundService() {
|
|
392
|
+
throw new Error('stopForegroundService is not supported on web');
|
|
393
|
+
}
|
|
394
|
+
async getPluginVersion() {
|
|
395
|
+
return { version: 'web' };
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
var web = /*#__PURE__*/Object.freeze({
|
|
400
|
+
__proto__: null,
|
|
401
|
+
BluetoothLowEnergyWeb: BluetoothLowEnergyWeb
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
exports.BluetoothLowEnergy = BluetoothLowEnergy;
|
|
405
|
+
exports.BluetoothLowEnergyUtils = BluetoothLowEnergyUtils;
|
|
406
|
+
//# sourceMappingURL=plugin.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.cjs.js","sources":["esm/definitions.js","esm/index.js","esm/web.js"],"sourcesContent":["/**\n * Utility class for BLE operations.\n *\n * @since 1.0.0\n */\nexport class BluetoothLowEnergyUtils {\n /**\n * Convert a byte array to a hex string.\n *\n * @param bytes - The byte array to convert\n * @returns The hex string\n * @since 1.0.0\n * @example\n * ```typescript\n * const hex = BluetoothLowEnergyUtils.convertBytesToHex([0x48, 0x65, 0x6c, 0x6c, 0x6f]);\n * console.log(hex); // \"48656c6c6f\"\n * ```\n */\n static convertBytesToHex(bytes) {\n return bytes.map((b) => b.toString(16).padStart(2, '0')).join('');\n }\n /**\n * Convert a hex string to a byte array.\n *\n * @param hex - The hex string to convert\n * @returns The byte array\n * @since 1.0.0\n * @example\n * ```typescript\n * const bytes = BluetoothLowEnergyUtils.convertHexToBytes(\"48656c6c6f\");\n * console.log(bytes); // [72, 101, 108, 108, 111]\n * ```\n */\n static convertHexToBytes(hex) {\n const bytes = [];\n for (let i = 0; i < hex.length; i += 2) {\n bytes.push(parseInt(hex.substr(i, 2), 16));\n }\n return bytes;\n }\n /**\n * Convert a string to a byte array (UTF-8).\n *\n * @param str - The string to convert\n * @returns The byte array\n * @since 1.0.0\n * @example\n * ```typescript\n * const bytes = BluetoothLowEnergyUtils.convertStringToBytes(\"Hello\");\n * console.log(bytes); // [72, 101, 108, 108, 111]\n * ```\n */\n static convertStringToBytes(str) {\n return Array.from(new TextEncoder().encode(str));\n }\n /**\n * Convert a byte array to a string (UTF-8).\n *\n * @param bytes - The byte array to convert\n * @returns The string\n * @since 1.0.0\n * @example\n * ```typescript\n * const str = BluetoothLowEnergyUtils.convertBytesToString([72, 101, 108, 108, 111]);\n * console.log(str); // \"Hello\"\n * ```\n */\n static convertBytesToString(bytes) {\n return new TextDecoder().decode(new Uint8Array(bytes));\n }\n}\n//# sourceMappingURL=definitions.js.map","import { registerPlugin } from '@capacitor/core';\nconst BluetoothLowEnergy = registerPlugin('BluetoothLowEnergy', {\n web: () => import('./web').then((m) => new m.BluetoothLowEnergyWeb()),\n});\nexport * from './definitions';\nexport { BluetoothLowEnergy };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport class BluetoothLowEnergyWeb extends WebPlugin {\n constructor() {\n super(...arguments);\n this.devices = new Map();\n this.services = new Map();\n this.characteristicListeners = new Map();\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async initialize(_options) {\n if (!navigator.bluetooth) {\n throw new Error('Web Bluetooth API is not available');\n }\n }\n async isAvailable() {\n if (!navigator.bluetooth) {\n return { available: false };\n }\n try {\n const available = await navigator.bluetooth.getAvailability();\n return { available };\n }\n catch (_a) {\n return { available: false };\n }\n }\n async isEnabled() {\n const { available } = await this.isAvailable();\n return { enabled: available };\n }\n async isLocationEnabled() {\n // Location is not relevant for Web Bluetooth\n return { enabled: true };\n }\n async openAppSettings() {\n throw new Error('openAppSettings is not supported on web');\n }\n async openBluetoothSettings() {\n throw new Error('openBluetoothSettings is not supported on web');\n }\n async openLocationSettings() {\n throw new Error('openLocationSettings is not supported on web');\n }\n async checkPermissions() {\n // Web Bluetooth handles permissions through requestDevice\n return {\n bluetooth: 'prompt',\n location: 'granted',\n };\n }\n async requestPermissions() {\n // Web Bluetooth handles permissions through requestDevice\n return {\n bluetooth: 'granted',\n location: 'granted',\n };\n }\n async startScan(options) {\n var _a;\n if (!navigator.bluetooth) {\n throw new Error('Web Bluetooth API is not available');\n }\n const requestOptions = {};\n if ((options === null || options === void 0 ? void 0 : options.services) && options.services.length > 0) {\n requestOptions.filters = [{ services: options.services }];\n }\n else {\n requestOptions.acceptAllDevices = true;\n }\n if (options === null || options === void 0 ? void 0 : options.services) {\n requestOptions.optionalServices = options.services;\n }\n try {\n const device = await navigator.bluetooth.requestDevice(requestOptions);\n const bleDevice = {\n deviceId: device.id,\n name: (_a = device.name) !== null && _a !== void 0 ? _a : null,\n };\n this.devices.set(device.id, device);\n this.notifyListeners('deviceScanned', { device: bleDevice });\n }\n catch (error) {\n if (error instanceof Error && error.name === 'NotFoundError') {\n // User cancelled the device picker\n return;\n }\n throw error;\n }\n }\n async stopScan() {\n // Web Bluetooth doesn't have a continuous scan - it uses a picker\n // Nothing to do here\n }\n async connect(options) {\n const device = this.devices.get(options.deviceId);\n if (!device) {\n throw new Error(`Device ${options.deviceId} not found`);\n }\n if (!device.gatt) {\n throw new Error(`Device ${options.deviceId} does not support GATT`);\n }\n await device.gatt.connect();\n this.notifyListeners('deviceConnected', { deviceId: options.deviceId });\n }\n async disconnect(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!device) {\n throw new Error(`Device ${options.deviceId} not found`);\n }\n if ((_a = device.gatt) === null || _a === void 0 ? void 0 : _a.connected) {\n device.gatt.disconnect();\n }\n this.notifyListeners('deviceDisconnected', { deviceId: options.deviceId });\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async createBond(_options) {\n throw new Error('createBond is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async isBonded(_options) {\n throw new Error('isBonded is not supported on web');\n }\n async discoverServices(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {\n throw new Error(`Device ${options.deviceId} is not connected`);\n }\n const gattServices = await device.gatt.getPrimaryServices();\n const services = [];\n for (const gattService of gattServices) {\n const characteristics = await gattService.getCharacteristics();\n const bleCharacteristics = await Promise.all(characteristics.map(async (char) => {\n const descriptors = await char.getDescriptors();\n return {\n uuid: char.uuid,\n properties: {\n broadcast: char.properties.broadcast,\n read: char.properties.read,\n writeWithoutResponse: char.properties.writeWithoutResponse,\n write: char.properties.write,\n notify: char.properties.notify,\n indicate: char.properties.indicate,\n authenticatedSignedWrites: char.properties.authenticatedSignedWrites,\n extendedProperties: false,\n },\n descriptors: descriptors.map((desc) => ({ uuid: desc.uuid })),\n };\n }));\n services.push({\n uuid: gattService.uuid,\n characteristics: bleCharacteristics,\n });\n }\n this.services.set(options.deviceId, services);\n }\n async getServices(options) {\n const services = this.services.get(options.deviceId);\n if (!services) {\n return { services: [] };\n }\n return { services };\n }\n async getConnectedDevices() {\n var _a, _b;\n const devices = [];\n for (const [deviceId, device] of this.devices) {\n if ((_a = device.gatt) === null || _a === void 0 ? void 0 : _a.connected) {\n devices.push({\n deviceId,\n name: (_b = device.name) !== null && _b !== void 0 ? _b : null,\n });\n }\n }\n return { devices };\n }\n async readCharacteristic(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {\n throw new Error(`Device ${options.deviceId} is not connected`);\n }\n const service = await device.gatt.getPrimaryService(options.service);\n const characteristic = await service.getCharacteristic(options.characteristic);\n const dataView = await characteristic.readValue();\n const value = [];\n for (let i = 0; i < dataView.byteLength; i++) {\n value.push(dataView.getUint8(i));\n }\n return { value };\n }\n async writeCharacteristic(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {\n throw new Error(`Device ${options.deviceId} is not connected`);\n }\n const service = await device.gatt.getPrimaryService(options.service);\n const characteristic = await service.getCharacteristic(options.characteristic);\n const data = new Uint8Array(options.value);\n if (options.type === 'withoutResponse') {\n await characteristic.writeValueWithoutResponse(data);\n }\n else {\n await characteristic.writeValueWithResponse(data);\n }\n }\n async startCharacteristicNotifications(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {\n throw new Error(`Device ${options.deviceId} is not connected`);\n }\n const service = await device.gatt.getPrimaryService(options.service);\n const characteristic = await service.getCharacteristic(options.characteristic);\n const key = `${options.deviceId}-${options.service}-${options.characteristic}`;\n const listener = (event) => {\n const dataView = event.target.value;\n if (!dataView)\n return;\n const value = [];\n for (let i = 0; i < dataView.byteLength; i++) {\n value.push(dataView.getUint8(i));\n }\n this.notifyListeners('characteristicChanged', {\n deviceId: options.deviceId,\n service: options.service,\n characteristic: options.characteristic,\n value,\n });\n };\n characteristic.addEventListener('characteristicvaluechanged', listener);\n this.characteristicListeners.set(key, listener);\n await characteristic.startNotifications();\n }\n async stopCharacteristicNotifications(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {\n throw new Error(`Device ${options.deviceId} is not connected`);\n }\n const service = await device.gatt.getPrimaryService(options.service);\n const characteristic = await service.getCharacteristic(options.characteristic);\n const key = `${options.deviceId}-${options.service}-${options.characteristic}`;\n const listener = this.characteristicListeners.get(key);\n if (listener) {\n characteristic.removeEventListener('characteristicvaluechanged', listener);\n this.characteristicListeners.delete(key);\n }\n await characteristic.stopNotifications();\n }\n async readDescriptor(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {\n throw new Error(`Device ${options.deviceId} is not connected`);\n }\n const service = await device.gatt.getPrimaryService(options.service);\n const characteristic = await service.getCharacteristic(options.characteristic);\n const descriptors = await characteristic.getDescriptors();\n const descriptor = descriptors.find((d) => d.uuid === options.descriptor);\n if (!descriptor) {\n throw new Error(`Descriptor ${options.descriptor} not found`);\n }\n const dataView = await descriptor.readValue();\n const value = [];\n for (let i = 0; i < dataView.byteLength; i++) {\n value.push(dataView.getUint8(i));\n }\n return { value };\n }\n async writeDescriptor(options) {\n var _a;\n const device = this.devices.get(options.deviceId);\n if (!((_a = device === null || device === void 0 ? void 0 : device.gatt) === null || _a === void 0 ? void 0 : _a.connected)) {\n throw new Error(`Device ${options.deviceId} is not connected`);\n }\n const service = await device.gatt.getPrimaryService(options.service);\n const characteristic = await service.getCharacteristic(options.characteristic);\n const descriptors = await characteristic.getDescriptors();\n const descriptor = descriptors.find((d) => d.uuid === options.descriptor);\n if (!descriptor) {\n throw new Error(`Descriptor ${options.descriptor} not found`);\n }\n const data = new Uint8Array(options.value);\n await descriptor.writeValue(data);\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async readRssi(_options) {\n throw new Error('readRssi is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async requestMtu(_options) {\n throw new Error('requestMtu is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async requestConnectionPriority(_options) {\n throw new Error('requestConnectionPriority is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async startAdvertising(_options) {\n throw new Error('startAdvertising is not supported on web');\n }\n async stopAdvertising() {\n throw new Error('stopAdvertising is not supported on web');\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n async startForegroundService(_options) {\n throw new Error('startForegroundService is not supported on web');\n }\n async stopForegroundService() {\n throw new Error('stopForegroundService is not supported on web');\n }\n async getPluginVersion() {\n return { version: 'web' };\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAM,uBAAuB,CAAC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,iBAAiB,CAAC,KAAK,EAAE;AACpC,QAAQ,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AACzE,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,iBAAiB,CAAC,GAAG,EAAE;AAClC,QAAQ,MAAM,KAAK,GAAG,EAAE;AACxB,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;AAChD,YAAY,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACtD,QAAQ;AACR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