@dg-kit/transport-webbluetooth 1.3.0 → 1.4.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/dist/client.js +2 -2
- package/package.json +3 -3
package/dist/client.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DG_LAB_REQUEST_DEVICE_OPTIONS, } from '@dg-kit/protocol';
|
|
2
2
|
import { getWebBluetoothAvailability } from './availability.js';
|
|
3
3
|
const DEFAULT_RECONNECT_ATTEMPTS = 3;
|
|
4
4
|
const DEFAULT_RECONNECT_BACKOFF_MS = [500, 1500, 4000];
|
|
@@ -31,7 +31,7 @@ export class WebBluetoothDeviceClient {
|
|
|
31
31
|
if (!bluetooth) {
|
|
32
32
|
throw new Error('当前环境不支持 Web Bluetooth');
|
|
33
33
|
}
|
|
34
|
-
const nextDevice = await bluetooth.requestDevice(this.options.requestDeviceOptions ??
|
|
34
|
+
const nextDevice = await bluetooth.requestDevice(this.options.requestDeviceOptions ?? DG_LAB_REQUEST_DEVICE_OPTIONS);
|
|
35
35
|
const gatt = nextDevice.gatt;
|
|
36
36
|
if (!gatt) {
|
|
37
37
|
throw new Error('所选蓝牙设备不支持 GATT');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dg-kit/transport-webbluetooth",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Web Bluetooth DeviceClient for DG-Lab Coyote (browser-only)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "0xNullAI",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@dg-kit/core": "1.
|
|
31
|
-
"@dg-kit/protocol": "1.
|
|
30
|
+
"@dg-kit/core": "1.4.0",
|
|
31
|
+
"@dg-kit/protocol": "1.4.0"
|
|
32
32
|
},
|
|
33
33
|
"scripts": {
|
|
34
34
|
"build": "tsc -p tsconfig.json",
|