@doubao-apps/create 0.0.25 → 0.0.27

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.
Files changed (91) hide show
  1. package/dist/36.js +4 -4
  2. package/dist/template-empty/.ai/examples/common-patterns.md +53 -43
  3. package/dist/template-empty/.ai/examples/component-basics.md +0 -17
  4. package/dist/template-empty/.ai/guides/component-development.md +96 -214
  5. package/dist/template-empty/.ai/guides/system-prompt.md +14 -14
  6. package/dist/template-empty/.ai/reference/framework-api-quick-ref.md +46 -85
  7. package/dist/template-empty/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +699 -0
  8. package/dist/template-empty/.ai/reference/open-api/02-/345/255/230/345/202/250.md +409 -0
  9. package/dist/template-empty/.ai/reference/open-api/03-/350/267/257/347/224/261.md +165 -0
  10. package/dist/template-empty/.ai/reference/open-api/04-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
  11. package/dist/template-empty/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
  12. package/dist/template-empty/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
  13. package/dist/template-empty/.ai/reference/open-api/07-/345/252/222/344/275/223.md +346 -0
  14. package/dist/template-empty/.ai/reference/open-api/08-/345/274/200/346/224/276/350/203/275/345/212/233-/344/270/232/345/212/241/350/203/275/345/212/233.md +546 -0
  15. package/dist/template-empty/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md +961 -0
  16. package/dist/template-empty/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md +277 -0
  17. package/dist/template-empty/.ai/reference/open-api/11-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +104 -0
  18. package/dist/template-empty/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
  19. package/dist/template-empty/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
  20. package/dist/template-empty/.ai/reference/open-api/14-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +70 -0
  21. package/dist/template-empty/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
  22. package/dist/template-empty/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
  23. package/dist/template-empty/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
  24. package/dist/template-empty/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
  25. package/dist/template-empty/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
  26. package/dist/template-empty/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
  27. package/dist/template-empty/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
  28. package/dist/template-empty/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
  29. package/dist/template-empty/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
  30. package/dist/template-empty/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
  31. package/dist/template-empty/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
  32. package/dist/template-empty/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
  33. package/dist/template-empty/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
  34. package/dist/template-empty/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
  35. package/dist/template-empty/.ai/reference/open-api/README.md +36 -0
  36. package/dist/template-empty/.ai/reference/open-api.md +1758 -266
  37. package/dist/template-empty/.ai/rules/dos-and-donts.md +50 -37
  38. package/dist/template-empty/AGENTS.md +56 -33
  39. package/dist/template-empty/README.md +57 -10
  40. package/dist/template-empty/package.json +2 -2
  41. package/dist/template-empty/src/app.config.ts +6 -0
  42. package/dist/template-empty/src/app.ts +0 -6
  43. package/dist/template-empty/tsconfig.json +2 -0
  44. package/dist/template-starter/.ai/examples/common-patterns.md +53 -43
  45. package/dist/template-starter/.ai/examples/component-basics.md +0 -17
  46. package/dist/template-starter/.ai/guides/component-development.md +96 -214
  47. package/dist/template-starter/.ai/guides/system-prompt.md +14 -14
  48. package/dist/template-starter/.ai/reference/framework-api-quick-ref.md +46 -85
  49. package/dist/template-starter/.ai/reference/open-api/01-/345/237/272/347/241/200-/350/264/246/345/217/267-/347/263/273/347/273/237.md +699 -0
  50. package/dist/template-starter/.ai/reference/open-api/02-/345/255/230/345/202/250.md +409 -0
  51. package/dist/template-starter/.ai/reference/open-api/03-/350/267/257/347/224/261.md +165 -0
  52. package/dist/template-starter/.ai/reference/open-api/04-/347/225/214/351/235/242-/344/272/244/344/272/222.md +432 -0
  53. package/dist/template-starter/.ai/reference/open-api/05-/347/225/214/351/235/242-/350/276/223/345/205/245.md +42 -0
  54. package/dist/template-starter/.ai/reference/open-api/06-/347/275/221/347/273/234.md +148 -0
  55. package/dist/template-starter/.ai/reference/open-api/07-/345/252/222/344/275/223.md +346 -0
  56. package/dist/template-starter/.ai/reference/open-api/08-/345/274/200/346/224/276/350/203/275/345/212/233-/344/270/232/345/212/241/350/203/275/345/212/233.md +546 -0
  57. package/dist/template-starter/.ai/reference/open-api/09-/350/256/276/345/244/207-/350/223/235/347/211/231.md +961 -0
  58. package/dist/template-starter/.ai/reference/open-api/10-/350/256/276/345/244/207-wi-fi.md +277 -0
  59. package/dist/template-starter/.ai/reference/open-api/11-/350/256/276/345/244/207-/345/212/240/351/200/237/345/272/246/350/256/241.md +104 -0
  60. package/dist/template-starter/.ai/reference/open-api/12-/350/256/276/345/244/207-ibeacon.md +148 -0
  61. package/dist/template-starter/.ai/reference/open-api/13-/350/256/276/345/244/207-/347/275/227/347/233/230.md +82 -0
  62. package/dist/template-starter/.ai/reference/open-api/14-/350/256/276/345/244/207-/350/256/276/345/244/207/346/226/271/345/220/221.md +70 -0
  63. package/dist/template-starter/.ai/reference/open-api/15-/350/256/276/345/244/207-/351/231/200/350/236/272/344/273/252.md +104 -0
  64. package/dist/template-starter/.ai/reference/open-api/16-ui-/350/276/223/345/205/245.md +65 -0
  65. package/dist/template-starter/.ai/reference/open-api/17-/350/256/276/345/244/207-/347/275/221/347/273/234.md +164 -0
  66. package/dist/template-starter/.ai/reference/open-api/18-/350/256/276/345/244/207-/347/237/255/344/277/241.md +62 -0
  67. package/dist/template-starter/.ai/reference/open-api/19-/350/256/276/345/244/207-/346/227/240/351/232/234/347/242/215.md +43 -0
  68. package/dist/template-starter/.ai/reference/open-api/20-/350/256/276/345/244/207-/347/224/265/346/261/240.md +83 -0
  69. package/dist/template-starter/.ai/reference/open-api/21-/350/256/276/345/244/207-/346/227/245/345/216/206.md +215 -0
  70. package/dist/template-starter/.ai/reference/open-api/22-/350/256/276/345/244/207-/345/211/252/350/264/264/346/235/277.md +70 -0
  71. package/dist/template-starter/.ai/reference/open-api/23-/350/256/276/345/244/207-/350/201/224/347/263/273/344/272/272.md +270 -0
  72. package/dist/template-starter/.ai/reference/open-api/24-/350/256/276/345/244/207-/345/212/240/345/257/206.md +56 -0
  73. package/dist/template-starter/.ai/reference/open-api/25-/350/256/276/345/244/207-/347/224/265/350/257/235.md +41 -0
  74. package/dist/template-starter/.ai/reference/open-api/26-/350/256/276/345/244/207-/346/211/253/347/240/201.md +100 -0
  75. package/dist/template-starter/.ai/reference/open-api/27-/350/256/276/345/244/207-/345/261/217/345/271/225.md +173 -0
  76. package/dist/template-starter/.ai/reference/open-api/28-/350/256/276/345/244/207-/351/234/207/345/212/250.md +66 -0
  77. package/dist/template-starter/.ai/reference/open-api/README.md +36 -0
  78. package/dist/template-starter/.ai/reference/open-api.md +1758 -266
  79. package/dist/template-starter/.ai/rules/dos-and-donts.md +50 -37
  80. package/dist/template-starter/AGENTS.md +56 -33
  81. package/dist/template-starter/README.md +6 -1
  82. package/dist/template-starter/package.json +2 -2
  83. package/dist/template-starter/src/app.config.ts +35 -0
  84. package/dist/template-starter/src/app.ts +0 -6
  85. package/dist/template-starter/src/pages/applet/index.tsx +0 -5
  86. package/dist/template-starter/src/pages/home/index.tsx +0 -5
  87. package/dist/template-starter/src/pages/lynx/index.tsx +0 -4
  88. package/dist/template-starter/src/pages/react-lynx/index.tsx +0 -5
  89. package/dist/template-starter/src/widgets/weather-card/index.tsx +0 -4
  90. package/dist/template-starter/tsconfig.json +2 -0
  91. package/package.json +1 -1
@@ -0,0 +1,961 @@
1
+ # Open API: 设备 / 蓝牙
2
+
3
+ 蓝牙和 BLE 能力;通常先打开适配器,再扫描、连接和读写。
4
+
5
+ [返回目录](./README.md) | [返回速查](../open-api.md)
6
+
7
+ ## 速查
8
+
9
+ | API | 说明 |
10
+ | --- | --- |
11
+ | [openBluetoothAdapter](#openbluetoothadapter) | 打开蓝牙适配器。<br><br>蓝牙流程入口。 |
12
+ | [startBluetoothDevicesDiscovery](#startbluetoothdevicesdiscovery) | 开始搜索附近的蓝牙设备。<br><br>通常先调用 openBluetoothAdapter。 |
13
+ | [stopBluetoothDevicesDiscovery](#stopbluetoothdevicesdiscovery) | 停止搜索附近的蓝牙设备。 |
14
+ | [getBluetoothAdapterState](#getbluetoothadapterstate) | 获取蓝牙适配器状态。 |
15
+ | [getBluetoothDevices](#getbluetoothdevices) | 获取当前蓝牙模块发现的设备列表。<br><br>通常先调用 startBluetoothDevicesDiscovery。 |
16
+ | [getConnectedBluetoothDevices](#getconnectedbluetoothdevices) | 获取已连接的蓝牙设备列表。 |
17
+ | [makeBluetoothPair](#makebluetoothpair) | 发起蓝牙配对。 |
18
+ | [isBluetoothDevicePaired](#isbluetoothdevicepaired) | 查询蓝牙设备是否已经配对。 |
19
+ | [closeBluetoothAdapter](#closebluetoothadapter) | 关闭蓝牙适配器。<br><br>会关闭蓝牙模块。 |
20
+ | [createBLEConnection](#createbleconnection) | 创建 BLE 连接。<br><br>需要传入 deviceId。 |
21
+ | [closeBLEConnection](#closebleconnection) | 关闭 BLE 连接。 |
22
+ | [getBLEDeviceServices](#getbledeviceservices) | 获取 BLE 服务列表。<br><br>通常先调用 createBLEConnection。 |
23
+ | [getBLEDeviceCharacteristics](#getbledevicecharacteristics) | 获取 BLE 特征值列表。<br><br>通常先获取 BLE 服务列表。 |
24
+ | [getBLEDeviceRSSI](#getbledevicerssi) | 获取 BLE 设备 RSSI。 |
25
+ | [getBLEMTU](#getblemtu) | 获取 BLE MTU。 |
26
+ | [notifyBLECharacteristicValueChange](#notifyblecharacteristicvaluechange) | 订阅 BLE 特征值变化。<br><br>订阅指定特征值变化。 |
27
+ | [readBLECharacteristicValue](#readblecharacteristicvalue) | 读取 BLE 特征值。<br><br>需要传入 serviceId 和 characteristicId。 |
28
+ | [setBLEMTU](#setblemtu) | 设置 BLE MTU。 |
29
+ | [writeBLECharacteristicValue](#writeblecharacteristicvalue) | 写入 BLE 特征值。<br><br>value 需要是 ArrayBuffer。 |
30
+
31
+ ## API 详情
32
+
33
+ <a id="openbluetoothadapter"></a>
34
+ ### openBluetoothAdapter()
35
+
36
+ > **openBluetoothAdapter**(`params`?): `Promise`\<`object`\>
37
+
38
+ 打开蓝牙适配器。
39
+
40
+ #### Parameters
41
+
42
+ • **params?**: [`OpenBluetoothAdapterParams`](#openbluetoothadapterparams)
43
+
44
+ #### Returns
45
+
46
+ `Promise`\<`object`\>
47
+
48
+ #### Remarks
49
+
50
+ 蓝牙流程入口。
51
+
52
+ <a id="startbluetoothdevicesdiscovery"></a>
53
+ ### startBluetoothDevicesDiscovery()
54
+
55
+ > **startBluetoothDevicesDiscovery**(`params`?): `Promise`\<`object`\>
56
+
57
+ 开始搜索附近的蓝牙设备。
58
+
59
+ #### Parameters
60
+
61
+ • **params?**: [`StartBluetoothDevicesDiscoveryParams`](#startbluetoothdevicesdiscoveryparams)
62
+
63
+ #### Returns
64
+
65
+ `Promise`\<`object`\>
66
+
67
+ #### Remarks
68
+
69
+ 通常先调用 openBluetoothAdapter。
70
+
71
+ <a id="stopbluetoothdevicesdiscovery"></a>
72
+ ### stopBluetoothDevicesDiscovery()
73
+
74
+ > **stopBluetoothDevicesDiscovery**(`params`?): `Promise`\<`object`\>
75
+
76
+ 停止搜索附近的蓝牙设备。
77
+
78
+ #### Parameters
79
+
80
+ • **params?**
81
+
82
+ #### Returns
83
+
84
+ `Promise`\<`object`\>
85
+
86
+ <a id="getbluetoothadapterstate"></a>
87
+ ### getBluetoothAdapterState()
88
+
89
+ > **getBluetoothAdapterState**(`params`?): `Promise`\<[`GetBluetoothAdapterStateResult`](#getbluetoothadapterstateresult)\>
90
+
91
+ 获取蓝牙适配器状态。
92
+
93
+ #### Parameters
94
+
95
+ • **params?**
96
+
97
+ #### Returns
98
+
99
+ `Promise`\<[`GetBluetoothAdapterStateResult`](#getbluetoothadapterstateresult)\>
100
+
101
+ <a id="getbluetoothdevices"></a>
102
+ ### getBluetoothDevices()
103
+
104
+ > **getBluetoothDevices**(`params`?): `Promise`\<[`GetBluetoothDevicesResult`](#getbluetoothdevicesresult)\>
105
+
106
+ 获取当前蓝牙模块发现的设备列表。
107
+
108
+ #### Parameters
109
+
110
+ • **params?**
111
+
112
+ #### Returns
113
+
114
+ `Promise`\<[`GetBluetoothDevicesResult`](#getbluetoothdevicesresult)\>
115
+
116
+ #### Remarks
117
+
118
+ 通常先调用 startBluetoothDevicesDiscovery。
119
+
120
+ <a id="getconnectedbluetoothdevices"></a>
121
+ ### getConnectedBluetoothDevices()
122
+
123
+ > **getConnectedBluetoothDevices**(`params`): `Promise`\<[`GetConnectedBluetoothDevicesResult`](#getconnectedbluetoothdevicesresult)\>
124
+
125
+ 获取已连接的蓝牙设备列表。
126
+
127
+ #### Parameters
128
+
129
+ • **params**: [`GetConnectedBluetoothDevicesParams`](#getconnectedbluetoothdevicesparams)
130
+
131
+ #### Returns
132
+
133
+ `Promise`\<[`GetConnectedBluetoothDevicesResult`](#getconnectedbluetoothdevicesresult)\>
134
+
135
+ <a id="makebluetoothpair"></a>
136
+ ### makeBluetoothPair()
137
+
138
+ > **makeBluetoothPair**(`params`): `Promise`\<`object`\>
139
+
140
+ 发起蓝牙配对。
141
+
142
+ #### Parameters
143
+
144
+ • **params**: [`MakeBluetoothPairParams`](#makebluetoothpairparams)
145
+
146
+ #### Returns
147
+
148
+ `Promise`\<`object`\>
149
+
150
+ <a id="isbluetoothdevicepaired"></a>
151
+ ### isBluetoothDevicePaired()
152
+
153
+ > **isBluetoothDevicePaired**(`params`): `Promise`\<`object`\>
154
+
155
+ 查询蓝牙设备是否已经配对。
156
+
157
+ #### Parameters
158
+
159
+ • **params**: [`IsBluetoothDevicePairedParams`](#isbluetoothdevicepairedparams)
160
+
161
+ #### Returns
162
+
163
+ `Promise`\<`object`\>
164
+
165
+ <a id="closebluetoothadapter"></a>
166
+ ### closeBluetoothAdapter()
167
+
168
+ > **closeBluetoothAdapter**(`params`?): `Promise`\<`object`\>
169
+
170
+ 关闭蓝牙适配器。
171
+
172
+ #### Parameters
173
+
174
+ • **params?**
175
+
176
+ #### Returns
177
+
178
+ `Promise`\<`object`\>
179
+
180
+ #### Remarks
181
+
182
+ 会关闭蓝牙模块。
183
+
184
+ <a id="createbleconnection"></a>
185
+ ### createBLEConnection()
186
+
187
+ > **createBLEConnection**(`params`): `Promise`\<`object`\>
188
+
189
+ 创建 BLE 连接。
190
+
191
+ #### Parameters
192
+
193
+ • **params**: [`CreateBLEConnectionParams`](#createbleconnectionparams)
194
+
195
+ #### Returns
196
+
197
+ `Promise`\<`object`\>
198
+
199
+ #### Remarks
200
+
201
+ 需要传入 deviceId。
202
+
203
+ <a id="closebleconnection"></a>
204
+ ### closeBLEConnection()
205
+
206
+ > **closeBLEConnection**(`params`): `Promise`\<`object`\>
207
+
208
+ 关闭 BLE 连接。
209
+
210
+ #### Parameters
211
+
212
+ • **params**: [`CloseBLEConnectionParams`](#closebleconnectionparams)
213
+
214
+ #### Returns
215
+
216
+ `Promise`\<`object`\>
217
+
218
+ <a id="getbledeviceservices"></a>
219
+ ### getBLEDeviceServices()
220
+
221
+ > **getBLEDeviceServices**(`params`): `Promise`\<[`GetBLEDeviceServicesResult`](#getbledeviceservicesresult)\>
222
+
223
+ 获取 BLE 服务列表。
224
+
225
+ #### Parameters
226
+
227
+ • **params**: [`GetBLEDeviceServicesParams`](#getbledeviceservicesparams)
228
+
229
+ #### Returns
230
+
231
+ `Promise`\<[`GetBLEDeviceServicesResult`](#getbledeviceservicesresult)\>
232
+
233
+ #### Remarks
234
+
235
+ 通常先调用 createBLEConnection。
236
+
237
+ <a id="getbledevicecharacteristics"></a>
238
+ ### getBLEDeviceCharacteristics()
239
+
240
+ > **getBLEDeviceCharacteristics**(`params`): `Promise`\<[`GetBLEDeviceCharacteristicsResult`](#getbledevicecharacteristicsresult)\>
241
+
242
+ 获取 BLE 特征值列表。
243
+
244
+ #### Parameters
245
+
246
+ • **params**: [`GetBLEDeviceCharacteristicsParams`](#getbledevicecharacteristicsparams)
247
+
248
+ #### Returns
249
+
250
+ `Promise`\<[`GetBLEDeviceCharacteristicsResult`](#getbledevicecharacteristicsresult)\>
251
+
252
+ #### Remarks
253
+
254
+ 通常先获取 BLE 服务列表。
255
+
256
+ <a id="getbledevicerssi"></a>
257
+ ### getBLEDeviceRSSI()
258
+
259
+ > **getBLEDeviceRSSI**(`params`): `Promise`\<[`GetBLEDeviceRSSIResult`](#getbledevicerssiresult)\>
260
+
261
+ 获取 BLE 设备 RSSI。
262
+
263
+ #### Parameters
264
+
265
+ • **params**: [`GetBLEDeviceRSSIParams`](#getbledevicerssiparams)
266
+
267
+ #### Returns
268
+
269
+ `Promise`\<[`GetBLEDeviceRSSIResult`](#getbledevicerssiresult)\>
270
+
271
+ <a id="getblemtu"></a>
272
+ ### getBLEMTU()
273
+
274
+ > **getBLEMTU**(`params`): `Promise`\<[`GetBLEMTUResult`](#getblemturesult)\>
275
+
276
+ 获取 BLE MTU。
277
+
278
+ #### Parameters
279
+
280
+ • **params**: [`GetBLEMTUParams`](#getblemtuparams)
281
+
282
+ #### Returns
283
+
284
+ `Promise`\<[`GetBLEMTUResult`](#getblemturesult)\>
285
+
286
+ <a id="notifyblecharacteristicvaluechange"></a>
287
+ ### notifyBLECharacteristicValueChange()
288
+
289
+ > **notifyBLECharacteristicValueChange**(`params`): `Promise`\<`object`\>
290
+
291
+ 订阅 BLE 特征值变化。
292
+
293
+ #### Parameters
294
+
295
+ • **params**: [`NotifyBLECharacteristicValueChangeParams`](#notifyblecharacteristicvaluechangeparams)
296
+
297
+ #### Returns
298
+
299
+ `Promise`\<`object`\>
300
+
301
+ #### Remarks
302
+
303
+ 订阅指定特征值变化。
304
+
305
+ <a id="readblecharacteristicvalue"></a>
306
+ ### readBLECharacteristicValue()
307
+
308
+ > **readBLECharacteristicValue**(`params`): `Promise`\<`object`\>
309
+
310
+ 读取 BLE 特征值。
311
+
312
+ #### Parameters
313
+
314
+ • **params**: [`ReadBLECharacteristicValueParams`](#readblecharacteristicvalueparams)
315
+
316
+ #### Returns
317
+
318
+ `Promise`\<`object`\>
319
+
320
+ #### Remarks
321
+
322
+ 需要传入 serviceId 和 characteristicId。
323
+
324
+ <a id="setblemtu"></a>
325
+ ### setBLEMTU()
326
+
327
+ > **setBLEMTU**(`params`): `Promise`\<[`SetBLEMTUResult`](#setblemturesult)\>
328
+
329
+ 设置 BLE MTU。
330
+
331
+ #### Parameters
332
+
333
+ • **params**: [`SetBLEMTUParams`](#setblemtuparams)
334
+
335
+ #### Returns
336
+
337
+ `Promise`\<[`SetBLEMTUResult`](#setblemturesult)\>
338
+
339
+ <a id="writeblecharacteristicvalue"></a>
340
+ ### writeBLECharacteristicValue()
341
+
342
+ > **writeBLECharacteristicValue**(`params`): `Promise`\<`object`\>
343
+
344
+ 写入 BLE 特征值。
345
+
346
+ #### Parameters
347
+
348
+ • **params**: [`WriteBLECharacteristicValueParams`](#writeblecharacteristicvalueparams)
349
+
350
+ #### Returns
351
+
352
+ `Promise`\<`object`\>
353
+
354
+ #### Remarks
355
+
356
+ value 需要是 ArrayBuffer。
357
+
358
+ ## 相关类型
359
+
360
+ <a id="openbluetoothadapterparams"></a>
361
+ ### OpenBluetoothAdapterParams
362
+
363
+ 打开蓝牙适配器的请求参数。
364
+
365
+ #### Properties
366
+
367
+ ##### mode?
368
+
369
+ > `optional` **mode**: [`BluetoothAdapterMode`](#bluetoothadaptermode)
370
+
371
+ 蓝牙模式。
372
+
373
+ <a id="bluetoothadaptermode"></a>
374
+ ### BluetoothAdapterMode
375
+
376
+ > **BluetoothAdapterMode**: `"central"` \| `"peripheral"`
377
+
378
+ 蓝牙适配器模式。
379
+
380
+ <a id="startbluetoothdevicesdiscoveryparams"></a>
381
+ ### StartBluetoothDevicesDiscoveryParams
382
+
383
+ 开始搜索蓝牙设备的请求参数。
384
+
385
+ #### Properties
386
+
387
+ ##### allowDuplicatesKey?
388
+
389
+ > `optional` **allowDuplicatesKey**: `boolean`
390
+
391
+ 是否允许重复上报同一设备。
392
+
393
+ ##### interval?
394
+
395
+ > `optional` **interval**: `number`
396
+
397
+ 上报设备的间隔,单位毫秒。
398
+
399
+ ##### powerLevel?
400
+
401
+ > `optional` **powerLevel**: [`BluetoothPowerLevel`](#bluetoothpowerlevel)
402
+
403
+ 扫描功耗等级。
404
+
405
+ ##### services?
406
+
407
+ > `optional` **services**: `string`[]
408
+
409
+ 按主服务 UUID 过滤搜索范围。
410
+
411
+ <a id="bluetoothpowerlevel"></a>
412
+ ### BluetoothPowerLevel
413
+
414
+ > **BluetoothPowerLevel**: `"low"` \| `"medium"` \| `"high"`
415
+
416
+ 蓝牙扫描功耗等级。
417
+
418
+ <a id="getbluetoothadapterstateresult"></a>
419
+ ### GetBluetoothAdapterStateResult
420
+
421
+ 蓝牙适配器状态。
422
+
423
+ #### Properties
424
+
425
+ ##### available
426
+
427
+ > **available**: `boolean`
428
+
429
+ 蓝牙适配器是否可用。
430
+
431
+ ##### discovering
432
+
433
+ > **discovering**: `boolean`
434
+
435
+ 是否正在搜索蓝牙设备。
436
+
437
+ <a id="getbluetoothdevicesresult"></a>
438
+ ### GetBluetoothDevicesResult
439
+
440
+ 获取蓝牙设备列表的返回结果。
441
+
442
+ #### Properties
443
+
444
+ ##### devices
445
+
446
+ > **devices**: [`BluetoothDevice`](#bluetoothdevice)[]
447
+
448
+ 当前蓝牙模块已发现的设备列表。
449
+
450
+ <a id="bluetoothdevice"></a>
451
+ ### BluetoothDevice
452
+
453
+ 蓝牙设备信息。
454
+
455
+ #### Properties
456
+
457
+ ##### advertisingData
458
+
459
+ > **advertisingData**: `ArrayBuffer`
460
+
461
+ 广播二进制数据。
462
+
463
+ ##### advertisingServiceUuids
464
+
465
+ > **advertisingServiceUuids**: `string`[]
466
+
467
+ 广播中的服务 UUID 列表。
468
+
469
+ ##### connectable?
470
+
471
+ > `optional` **connectable**: `boolean`
472
+
473
+ 是否可连接。
474
+
475
+ ##### deviceId
476
+
477
+ > **deviceId**: `string`
478
+
479
+ 设备 ID。
480
+
481
+ ##### localName
482
+
483
+ > **localName**: `string`
484
+
485
+ 广播中的本地名称。
486
+
487
+ ##### name
488
+
489
+ > **name**: `string`
490
+
491
+ 设备名称。
492
+
493
+ ##### rssi
494
+
495
+ > **rssi**: `number`
496
+
497
+ RSSI 信号强度,单位 dBm。
498
+
499
+ ##### serviceData
500
+
501
+ > **serviceData**: `Record`\<`string`, `unknown`\>
502
+
503
+ 广播中的服务数据。
504
+
505
+ <a id="getconnectedbluetoothdevicesparams"></a>
506
+ ### GetConnectedBluetoothDevicesParams
507
+
508
+ 获取已连接蓝牙设备的请求参数。
509
+
510
+ #### Properties
511
+
512
+ ##### services
513
+
514
+ > **services**: `string`[]
515
+
516
+ 蓝牙主服务 UUID 列表。
517
+
518
+ <a id="getconnectedbluetoothdevicesresult"></a>
519
+ ### GetConnectedBluetoothDevicesResult
520
+
521
+ 获取已连接蓝牙设备的返回结果。
522
+
523
+ #### Properties
524
+
525
+ ##### devices
526
+
527
+ > **devices**: [`ConnectedBluetoothDevice`](#connectedbluetoothdevice)[]
528
+
529
+ 已连接设备列表。
530
+
531
+ <a id="connectedbluetoothdevice"></a>
532
+ ### ConnectedBluetoothDevice
533
+
534
+ 已连接蓝牙设备信息。
535
+
536
+ #### Properties
537
+
538
+ ##### deviceId
539
+
540
+ > **deviceId**: `string`
541
+
542
+ 设备 ID。
543
+
544
+ ##### name
545
+
546
+ > **name**: `string`
547
+
548
+ 设备名称。
549
+
550
+ <a id="makebluetoothpairparams"></a>
551
+ ### MakeBluetoothPairParams
552
+
553
+ 蓝牙配对请求参数。
554
+
555
+ #### Properties
556
+
557
+ ##### deviceId
558
+
559
+ > **deviceId**: `string`
560
+
561
+ 蓝牙设备 ID。
562
+
563
+ ##### pin
564
+
565
+ > **pin**: `string`
566
+
567
+ 配对 PIN 码。
568
+
569
+ ##### timeout?
570
+
571
+ > `optional` **timeout**: `number`
572
+
573
+ 超时时间,单位毫秒。
574
+
575
+ <a id="isbluetoothdevicepairedparams"></a>
576
+ ### IsBluetoothDevicePairedParams
577
+
578
+ 查询蓝牙设备配对状态的请求参数。
579
+
580
+ #### Properties
581
+
582
+ ##### deviceId
583
+
584
+ > **deviceId**: `string`
585
+
586
+ 蓝牙设备 ID。
587
+
588
+ <a id="createbleconnectionparams"></a>
589
+ ### CreateBLEConnectionParams
590
+
591
+ 创建 BLE 连接的请求参数。
592
+
593
+ #### Properties
594
+
595
+ ##### deviceId
596
+
597
+ > **deviceId**: `string`
598
+
599
+ 蓝牙设备 ID。
600
+
601
+ ##### timeout?
602
+
603
+ > `optional` **timeout**: `number`
604
+
605
+ 超时时间,单位毫秒。
606
+
607
+ <a id="closebleconnectionparams"></a>
608
+ ### CloseBLEConnectionParams
609
+
610
+ 关闭 BLE 连接的请求参数。
611
+
612
+ #### Properties
613
+
614
+ ##### deviceId
615
+
616
+ > **deviceId**: `string`
617
+
618
+ 蓝牙设备 ID。
619
+
620
+ <a id="getbledeviceservicesparams"></a>
621
+ ### GetBLEDeviceServicesParams
622
+
623
+ 获取 BLE 服务列表的请求参数。
624
+
625
+ #### Properties
626
+
627
+ ##### deviceId
628
+
629
+ > **deviceId**: `string`
630
+
631
+ 蓝牙设备 ID。
632
+
633
+ <a id="getbledeviceservicesresult"></a>
634
+ ### GetBLEDeviceServicesResult
635
+
636
+ 获取 BLE 服务列表的返回结果。
637
+
638
+ #### Properties
639
+
640
+ ##### services
641
+
642
+ > **services**: [`BluetoothService`](#bluetoothservice)[]
643
+
644
+ 设备服务列表。
645
+
646
+ <a id="bluetoothservice"></a>
647
+ ### BluetoothService
648
+
649
+ 蓝牙服务信息。
650
+
651
+ #### Properties
652
+
653
+ ##### isPrimary
654
+
655
+ > **isPrimary**: `boolean`
656
+
657
+ 是否为主服务。
658
+
659
+ ##### uuid
660
+
661
+ > **uuid**: `string`
662
+
663
+ 服务 UUID。
664
+
665
+ <a id="getbledevicecharacteristicsparams"></a>
666
+ ### GetBLEDeviceCharacteristicsParams
667
+
668
+ 获取 BLE 特征值列表的请求参数。
669
+
670
+ #### Properties
671
+
672
+ ##### deviceId
673
+
674
+ > **deviceId**: `string`
675
+
676
+ 蓝牙设备 ID。
677
+
678
+ ##### serviceId
679
+
680
+ > **serviceId**: `string`
681
+
682
+ 服务 ID。
683
+
684
+ <a id="getbledevicecharacteristicsresult"></a>
685
+ ### GetBLEDeviceCharacteristicsResult
686
+
687
+ 获取 BLE 特征值列表的返回结果。
688
+
689
+ #### Properties
690
+
691
+ ##### characteristics
692
+
693
+ > **characteristics**: [`BluetoothCharacteristic`](#bluetoothcharacteristic)[]
694
+
695
+ 特征值列表。
696
+
697
+ <a id="bluetoothcharacteristicproperties"></a>
698
+ <a id="bluetoothcharacteristic"></a>
699
+ ### BluetoothCharacteristic
700
+
701
+ 蓝牙特征值信息。
702
+
703
+ #### Properties
704
+
705
+ ##### properties
706
+
707
+ > **properties**: [`BluetoothCharacteristicProperties`](#bluetoothcharacteristicproperties)
708
+
709
+ 特征值能力。
710
+
711
+ ##### uuid
712
+
713
+ > **uuid**: `string`
714
+
715
+ 特征值 UUID。
716
+
717
+ <a id="bluetoothcharacteristicproperties"></a>
718
+ ### BluetoothCharacteristicProperties
719
+
720
+ 蓝牙特征值支持的能力。
721
+
722
+ #### Properties
723
+
724
+ ##### indicate
725
+
726
+ > **indicate**: `boolean`
727
+
728
+ 是否支持 indicate。
729
+
730
+ ##### notify
731
+
732
+ > **notify**: `boolean`
733
+
734
+ 是否支持 notify。
735
+
736
+ ##### read
737
+
738
+ > **read**: `boolean`
739
+
740
+ 是否支持 read。
741
+
742
+ ##### write
743
+
744
+ > **write**: `boolean`
745
+
746
+ 是否支持 write。
747
+
748
+ ##### writeDefault
749
+
750
+ > **writeDefault**: `boolean`
751
+
752
+ 是否支持带响应写入。
753
+
754
+ ##### writeNoResponse
755
+
756
+ > **writeNoResponse**: `boolean`
757
+
758
+ 是否支持无响应写入。
759
+
760
+ <a id="getbledevicerssiparams"></a>
761
+ ### GetBLEDeviceRSSIParams
762
+
763
+ 获取 BLE RSSI 的请求参数。
764
+
765
+ #### Properties
766
+
767
+ ##### deviceId
768
+
769
+ > **deviceId**: `string`
770
+
771
+ 蓝牙设备 ID。
772
+
773
+ <a id="getbledevicerssiresult"></a>
774
+ ### GetBLEDeviceRSSIResult
775
+
776
+ 获取 BLE RSSI 的返回结果。
777
+
778
+ #### Properties
779
+
780
+ ##### rssi
781
+
782
+ > **rssi**: `number`
783
+
784
+ RSSI 信号强度,单位 dBm。
785
+
786
+ <a id="getblemtuparams"></a>
787
+ ### GetBLEMTUParams
788
+
789
+ 获取 BLE MTU 的请求参数。
790
+
791
+ #### Properties
792
+
793
+ ##### deviceId
794
+
795
+ > **deviceId**: `string`
796
+
797
+ 蓝牙设备 ID。
798
+
799
+ ##### writeType?
800
+
801
+ > `optional` **writeType**: [`BluetoothWriteType`](#bluetoothwritetype)
802
+
803
+ 写入模式。
804
+
805
+ <a id="getblemturesult"></a>
806
+ ### GetBLEMTUResult
807
+
808
+ 获取 BLE MTU 的返回结果。
809
+
810
+ #### Properties
811
+
812
+ ##### mtu
813
+
814
+ > **mtu**: `number`
815
+
816
+ 当前 MTU。
817
+
818
+ <a id="bluetoothwritetype"></a>
819
+ ### BluetoothWriteType
820
+
821
+ > **BluetoothWriteType**: `"write"` \| `"writeNoResponse"`
822
+
823
+ 蓝牙写入模式。
824
+
825
+ <a id="notifyblecharacteristicvaluechangeparams"></a>
826
+ ### NotifyBLECharacteristicValueChangeParams
827
+
828
+ 订阅 BLE 特征值变化的请求参数。
829
+
830
+ #### Properties
831
+
832
+ ##### characteristicId
833
+
834
+ > **characteristicId**: `string`
835
+
836
+ 特征值 ID。
837
+
838
+ ##### deviceId
839
+
840
+ > **deviceId**: `string`
841
+
842
+ 蓝牙设备 ID。
843
+
844
+ ##### serviceId
845
+
846
+ > **serviceId**: `string`
847
+
848
+ 服务 ID。
849
+
850
+ ##### state
851
+
852
+ > **state**: `boolean`
853
+
854
+ 是否启用订阅。
855
+
856
+ ##### type?
857
+
858
+ > `optional` **type**: [`BluetoothNotifyType`](#bluetoothnotifytype)
859
+
860
+ 订阅类型。
861
+
862
+ <a id="bluetoothnotifytype"></a>
863
+ ### BluetoothNotifyType
864
+
865
+ > **BluetoothNotifyType**: `"notification"` \| `"indication"`
866
+
867
+ 蓝牙特征值订阅类型。
868
+
869
+ <a id="readblecharacteristicvalueparams"></a>
870
+ ### ReadBLECharacteristicValueParams
871
+
872
+ 读取 BLE 特征值的请求参数。
873
+
874
+ #### Properties
875
+
876
+ ##### characteristicId
877
+
878
+ > **characteristicId**: `string`
879
+
880
+ 特征值 ID。
881
+
882
+ ##### deviceId
883
+
884
+ > **deviceId**: `string`
885
+
886
+ 蓝牙设备 ID。
887
+
888
+ ##### serviceId
889
+
890
+ > **serviceId**: `string`
891
+
892
+ 服务 ID。
893
+
894
+ <a id="setblemtuparams"></a>
895
+ ### SetBLEMTUParams
896
+
897
+ 设置 BLE MTU 的请求参数。
898
+
899
+ #### Properties
900
+
901
+ ##### deviceId
902
+
903
+ > **deviceId**: `string`
904
+
905
+ 蓝牙设备 ID。
906
+
907
+ ##### mtu
908
+
909
+ > **mtu**: `number`
910
+
911
+ 目标 MTU。
912
+
913
+ <a id="setblemturesult"></a>
914
+ ### SetBLEMTUResult
915
+
916
+ 设置 BLE MTU 的返回结果。
917
+
918
+ #### Properties
919
+
920
+ ##### mtu
921
+
922
+ > **mtu**: `string` \| `number`
923
+
924
+ 最终协商得到的 MTU。
925
+
926
+ <a id="writeblecharacteristicvalueparams"></a>
927
+ ### WriteBLECharacteristicValueParams
928
+
929
+ 写入 BLE 特征值的请求参数。
930
+
931
+ #### Properties
932
+
933
+ ##### characteristicId
934
+
935
+ > **characteristicId**: `string`
936
+
937
+ 特征值 ID。
938
+
939
+ ##### deviceId
940
+
941
+ > **deviceId**: `string`
942
+
943
+ 蓝牙设备 ID。
944
+
945
+ ##### serviceId
946
+
947
+ > **serviceId**: `string`
948
+
949
+ 服务 ID。
950
+
951
+ ##### value
952
+
953
+ > **value**: `ArrayBuffer`
954
+
955
+ 要写入的二进制数据。
956
+
957
+ ##### writeType?
958
+
959
+ > `optional` **writeType**: [`BluetoothWriteType`](#bluetoothwritetype)
960
+
961
+ 写入模式。