@ray-js/api 1.6.31 → 2.0.0-alpha.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.
@@ -1,1731 +0,0 @@
1
- /**
2
- * PlayNetKit
3
- *
4
- * @version 1.3.30
5
- */
6
- declare namespace ty.playnet {
7
- /**
8
- *@description 开启搜索设备*/
9
- export function startScanDevice(params: {
10
- /**
11
- * 扫描类型 只包含下列扫描类型:
12
- * AP、EZ、SUB、BLUETOOTH、WN、QC
13
- */
14
- scanType: string[];
15
- /** 配网所需要的激活 Token */
16
- token?: string;
17
- /** 配网之后,设备工作 Wi-Fi 的名称 */
18
- ssid?: string;
19
- /** 配网之后,设备工作 Wi-Fi 的密码 */
20
- password?: string;
21
- /** 配网的超时时间设置,默认是 100s,单位是秒 */
22
- timeout?: number;
23
- /** 网关Id */
24
- gwId?: string;
25
- /** 家庭中支持闪电/免密配网/网关路由器设备的设备devId集合 */
26
- deviceIds?: string[];
27
- /** 空间Id */
28
- spaceId: number;
29
- success?: (params: null) => void;
30
- fail?: (params: {
31
- errorMsg: string;
32
- errorCode: string | number;
33
- innerError: {
34
- errorCode: string | number;
35
- errorMsg: string;
36
- };
37
- }) => void;
38
- complete?: () => void;
39
- }): void;
40
-
41
- /**
42
- *@description 停止搜索设备*/
43
- export function stopScanDevice(params: {
44
- /**
45
- * 扫描类型 只包含下列扫描类型:
46
- * AP、EZ、SUB、BLUETOOTH、WN、QC
47
- */
48
- scanType: string[];
49
- /** 配网所需要的激活 Token */
50
- token?: string;
51
- /** 配网之后,设备工作 Wi-Fi 的名称 */
52
- ssid?: string;
53
- /** 配网之后,设备工作 Wi-Fi 的密码 */
54
- password?: string;
55
- /** 配网的超时时间设置,默认是 100s,单位是秒 */
56
- timeout?: number;
57
- /** 网关Id */
58
- gwId?: string;
59
- /** 家庭中支持闪电/免密配网/网关路由器设备的设备devId集合 */
60
- deviceIds?: string[];
61
- /** 空间Id */
62
- spaceId: number;
63
- success?: (params: null) => void;
64
- fail?: (params: {
65
- errorMsg: string;
66
- errorCode: string | number;
67
- innerError: {
68
- errorCode: string | number;
69
- errorMsg: string;
70
- };
71
- }) => void;
72
- complete?: () => void;
73
- }): void;
74
-
75
- /**
76
- *@description 开始设备配网*/
77
- export function startDeviceActivate(params: {
78
- /**
79
- * 配网类型
80
- * AP/EZ/WN/BLE/BLE_WIFI/SUB/BEACON/SIG_MESH/MATTER/QC
81
- */
82
- activeModel: string;
83
- /** 关系id */
84
- relationId: number;
85
- /** 空间id */
86
- spaceId: number;
87
- /** 配网所需要的激活 Token */
88
- token?: string;
89
- /** 配网之后,设备工作 Wi-Fi 的名称 */
90
- ssid?: string;
91
- /** 配网之后,设备工作 Wi-Fi 的密码 */
92
- cipher?: string;
93
- /** 配网的超时时间设置,默认是 100s,单位是秒 */
94
- timeout?: number;
95
- /** 网关Id */
96
- gwId?: string;
97
- /** 设备的 uuid */
98
- uuid?: string;
99
- /** 设备的mac */
100
- mac?: string;
101
- /** 安装子设备的代码 */
102
- installCode?: string;
103
- /** 子设备的mac */
104
- subDevMac?: string;
105
- /** 虚拟设备需要pid */
106
- pid?: string;
107
- /** 设备icon */
108
- icon?: string;
109
- /** groupType ThingLink专用 */
110
- groupType?: string;
111
- /** GPRS使用 */
112
- devId?: string;
113
- /** 设备名称 */
114
- deviceName?: string;
115
- /** ap模式的安全信息 */
116
- securityConfig?: string;
117
- /** 新增扫描实体,通过该实体找到对应搜索时真实数据进行填充 */
118
- thingActivatorScanDeviceBean?: ScanDeviceResponse;
119
- /** 指定闪电配网的设备列表 */
120
- lightningSearchBeans?: ScanDeviceResponse[];
121
- /** mesh 配网搜索的数据 bean */
122
- meshSearchBeans?: ScanDeviceResponse[];
123
- /** 子设备 列表 */
124
- subSearchBeans?: ScanDeviceResponse[];
125
- /** 当前mesh网络 */
126
- currentMeshBean?: BlueMeshBean;
127
- /** 当前mesh网络 */
128
- hgwBean?: HgwBean;
129
- /**
130
- * matter类设备配网配置额外字段
131
- * 目前分三种类型设备:有线设备配网、有线子设备配网、双模设备配网
132
- * 扫码二维码解析实体或setupCode 手动输入码解析
133
- */
134
- matterPayload?: SetupPayload;
135
- /** connectResult */
136
- connectResult?: ConnectResult;
137
- /** 多模设备配网,扫描实体 */
138
- scanDeviceBean?: ScanDeviceBean;
139
- /** 目前 子设备配网是否是通过自发现配网 会添加到内部 */
140
- extensions?: any;
141
- /** 二维码信息 matter配网使用 */
142
- qrCodeStr?: string;
143
- success?: (params: null) => void;
144
- fail?: (params: {
145
- errorMsg: string;
146
- errorCode: string | number;
147
- innerError: {
148
- errorCode: string | number;
149
- errorMsg: string;
150
- };
151
- }) => void;
152
- complete?: () => void;
153
- }): void;
154
-
155
- /**
156
- *@description 停止设备配网*/
157
- export function stopDeviceActivate(params: {
158
- /**
159
- * 配网类型
160
- * AP/EZ/WN/BLE/BLE_WIFI/SUB/BEACON/SIG_MESH/MATTER/QC
161
- */
162
- activeModel: string;
163
- /** 关系id */
164
- relationId: number;
165
- /** 空间id */
166
- spaceId: number;
167
- /** 配网所需要的激活 Token */
168
- token?: string;
169
- /** 配网之后,设备工作 Wi-Fi 的名称 */
170
- ssid?: string;
171
- /** 配网之后,设备工作 Wi-Fi 的密码 */
172
- cipher?: string;
173
- /** 配网的超时时间设置,默认是 100s,单位是秒 */
174
- timeout?: number;
175
- /** 网关Id */
176
- gwId?: string;
177
- /** 设备的 uuid */
178
- uuid?: string;
179
- /** 设备的mac */
180
- mac?: string;
181
- /** 安装子设备的代码 */
182
- installCode?: string;
183
- /** 子设备的mac */
184
- subDevMac?: string;
185
- /** 虚拟设备需要pid */
186
- pid?: string;
187
- /** 设备icon */
188
- icon?: string;
189
- /** groupType ThingLink专用 */
190
- groupType?: string;
191
- /** GPRS使用 */
192
- devId?: string;
193
- /** 设备名称 */
194
- deviceName?: string;
195
- /** ap模式的安全信息 */
196
- securityConfig?: string;
197
- /** 新增扫描实体,通过该实体找到对应搜索时真实数据进行填充 */
198
- thingActivatorScanDeviceBean?: ScanDeviceResponse;
199
- /** 指定闪电配网的设备列表 */
200
- lightningSearchBeans?: ScanDeviceResponse[];
201
- /** mesh 配网搜索的数据 bean */
202
- meshSearchBeans?: ScanDeviceResponse[];
203
- /** 子设备 列表 */
204
- subSearchBeans?: ScanDeviceResponse[];
205
- /** 当前mesh网络 */
206
- currentMeshBean?: BlueMeshBean;
207
- /** 当前mesh网络 */
208
- hgwBean?: HgwBean;
209
- /**
210
- * matter类设备配网配置额外字段
211
- * 目前分三种类型设备:有线设备配网、有线子设备配网、双模设备配网
212
- * 扫码二维码解析实体或setupCode 手动输入码解析
213
- */
214
- matterPayload?: SetupPayload;
215
- /** connectResult */
216
- connectResult?: ConnectResult;
217
- /** 多模设备配网,扫描实体 */
218
- scanDeviceBean?: ScanDeviceBean;
219
- /** 目前 子设备配网是否是通过自发现配网 会添加到内部 */
220
- extensions?: any;
221
- /** 二维码信息 matter配网使用 */
222
- qrCodeStr?: string;
223
- success?: (params: null) => void;
224
- fail?: (params: {
225
- errorMsg: string;
226
- errorCode: string | number;
227
- innerError: {
228
- errorCode: string | number;
229
- errorMsg: string;
230
- };
231
- }) => void;
232
- complete?: () => void;
233
- }): void;
234
-
235
- /**
236
- *@description 解析matter配网二维码 仅安卓使用*/
237
- export function analysisMatterQRCode(params: {
238
- /** 二维码信息 */
239
- qrCodeStr: string;
240
- success?: (params: {
241
- /** version */
242
- version?: number;
243
- /** vendorId */
244
- vendorId?: number;
245
- /** productId */
246
- productId?: number;
247
- /** setupPinCode */
248
- setupPinCode?: number;
249
- /** commissioningFlow */
250
- commissioningFlow?: number;
251
- /** optionalQrCodeInfoMap */
252
- optionalQrCodeInfoMap?: any;
253
- /** discoveryCapabilities */
254
- discoveryCapabilities?: number[];
255
- /** commissioningFlow */
256
- discriminator?: Discriminator;
257
- }) => void;
258
- fail?: (params: {
259
- errorMsg: string;
260
- errorCode: string | number;
261
- innerError: {
262
- errorCode: string | number;
263
- errorMsg: string;
264
- };
265
- }) => void;
266
- complete?: () => void;
267
- }): void;
268
-
269
- /**
270
- *@description 连接matter设备-仅安卓使用*/
271
- export function connectMatterDevice(params: {
272
- /**
273
- * matter类设备配网配置额外字段
274
- * 目前分三种类型设备:有线设备配网、有线子设备配网、双模设备配网
275
- * 扫码二维码解析实体或setupCode 手动输入码解析
276
- */
277
- setupPayload?: SetupPayload;
278
- /** 空间id */
279
- spaceId: number;
280
- /** 超时时间 */
281
- timeout: number;
282
- /** 网关id */
283
- gwId?: string;
284
- success?: (params: {
285
- /**
286
- * 类型如下
287
- * BLE MDNS
288
- */
289
- discoveryType?: string;
290
- /** port */
291
- port?: number;
292
- /** ipAddress */
293
- ipAddress?: string;
294
- /** uuid */
295
- uuid?: string;
296
- /** thingProductId */
297
- thingProductId?: string;
298
- /** accessType */
299
- accessType?: number;
300
- /** nodeId */
301
- nodeId?: number;
302
- /** isThingMatter */
303
- isThingMatter?: boolean;
304
- /**
305
- * matter设备类型
306
- * UN_KNOW:0 WIFI:1 THREAD:2 SOFT_AP:3 ON_NETWORK:4
307
- */
308
- matterDeviceType?: number;
309
- /** 设备绑定的网关信息 */
310
- gwId?: string;
311
- }) => void;
312
- fail?: (params: {
313
- errorMsg: string;
314
- errorCode: string | number;
315
- innerError: {
316
- errorCode: string | number;
317
- errorMsg: string;
318
- };
319
- }) => void;
320
- complete?: () => void;
321
- }): void;
322
-
323
- /**
324
- *@description 继续matter配网-仅iOS使用*/
325
- export function continueMatterCommission(params: {
326
- /**
327
- * 配网类型
328
- * AP/EZ/WN/BLE/BLE_WIFI/SUB/BEACON/SIG_MESH/MATTER/QC
329
- */
330
- activeModel: string;
331
- /** 关系id */
332
- relationId: number;
333
- /** 空间id */
334
- spaceId: number;
335
- /** 配网所需要的激活 Token */
336
- token?: string;
337
- /** 配网之后,设备工作 Wi-Fi 的名称 */
338
- ssid?: string;
339
- /** 配网之后,设备工作 Wi-Fi 的密码 */
340
- cipher?: string;
341
- /** 配网的超时时间设置,默认是 100s,单位是秒 */
342
- timeout?: number;
343
- /** 网关Id */
344
- gwId?: string;
345
- /** 设备的 uuid */
346
- uuid?: string;
347
- /** 设备的mac */
348
- mac?: string;
349
- /** 安装子设备的代码 */
350
- installCode?: string;
351
- /** 子设备的mac */
352
- subDevMac?: string;
353
- /** 虚拟设备需要pid */
354
- pid?: string;
355
- /** 设备icon */
356
- icon?: string;
357
- /** groupType ThingLink专用 */
358
- groupType?: string;
359
- /** GPRS使用 */
360
- devId?: string;
361
- /** 设备名称 */
362
- deviceName?: string;
363
- /** ap模式的安全信息 */
364
- securityConfig?: string;
365
- /** 新增扫描实体,通过该实体找到对应搜索时真实数据进行填充 */
366
- thingActivatorScanDeviceBean?: ScanDeviceResponse;
367
- /** 指定闪电配网的设备列表 */
368
- lightningSearchBeans?: ScanDeviceResponse[];
369
- /** mesh 配网搜索的数据 bean */
370
- meshSearchBeans?: ScanDeviceResponse[];
371
- /** 子设备 列表 */
372
- subSearchBeans?: ScanDeviceResponse[];
373
- /** 当前mesh网络 */
374
- currentMeshBean?: BlueMeshBean;
375
- /** 当前mesh网络 */
376
- hgwBean?: HgwBean;
377
- /**
378
- * matter类设备配网配置额外字段
379
- * 目前分三种类型设备:有线设备配网、有线子设备配网、双模设备配网
380
- * 扫码二维码解析实体或setupCode 手动输入码解析
381
- */
382
- matterPayload?: SetupPayload;
383
- /** connectResult */
384
- connectResult?: ConnectResult;
385
- /** 多模设备配网,扫描实体 */
386
- scanDeviceBean?: ScanDeviceBean;
387
- /** 目前 子设备配网是否是通过自发现配网 会添加到内部 */
388
- extensions?: any;
389
- /** 二维码信息 matter配网使用 */
390
- qrCodeStr?: string;
391
- success?: (params: null) => void;
392
- fail?: (params: {
393
- errorMsg: string;
394
- errorCode: string | number;
395
- innerError: {
396
- errorCode: string | number;
397
- errorMsg: string;
398
- };
399
- }) => void;
400
- complete?: () => void;
401
- }): void;
402
-
403
- /**
404
- *@description 设备恢复配网*/
405
- export function resumeActive(params?: {
406
- /**
407
- * 恢复类型
408
- * 继续wifi配网->0 蓝牙兜底配网->1
409
- */
410
- resumeType?: number;
411
- /** 设备的 uuid */
412
- uuid?: string;
413
- /** Wi-Fi名称 */
414
- ssid?: string;
415
- /** Wi-Fi密码 */
416
- pwd?: string;
417
- /** Wi-Fi最大数量 */
418
- maxWifiCount?: number;
419
- /** Wi-Fi请求最大时间 */
420
- wifiRequestMaxTime?: number;
421
- /**
422
- * 配网类型
423
- * AP、EZ
424
- */
425
- scanType?: string;
426
- success?: (params: null) => void;
427
- fail?: (params: {
428
- errorMsg: string;
429
- errorCode: string | number;
430
- innerError: {
431
- errorCode: string | number;
432
- errorMsg: string;
433
- };
434
- }) => void;
435
- complete?: () => void;
436
- }): void;
437
-
438
- /**
439
- *@description 配网返回暂停状态时,可以请求设备可使用的WiFi列表*/
440
- export function requestWifiList(params?: {
441
- /** uuid */
442
- uuid?: string;
443
- /** Wi-Fi最大数量 */
444
- size?: number;
445
- /** Wi-Fi请求最大时间 */
446
- timeout?: number;
447
- /**
448
- * 配网类型
449
- * AP、BLUETOOTH
450
- */
451
- scanType?: string;
452
- success?: (params: {
453
- /** Wi-Fi列表 */
454
- wifiList: WifiInfoBean[];
455
- }) => void;
456
- fail?: (params: {
457
- errorMsg: string;
458
- errorCode: string | number;
459
- innerError: {
460
- errorCode: string | number;
461
- errorMsg: string;
462
- };
463
- }) => void;
464
- complete?: () => void;
465
- }): void;
466
-
467
- /**
468
- *@description 将设备重置为待配网状态*/
469
- export function resetDeviceActivatedStatus(params: {
470
- /** 需要重置设备的token */
471
- tokens: string[];
472
- /** 设备扫描的信息 */
473
- scanDeviceBeans: ScanDeviceResponse[];
474
- success?: (params: null) => void;
475
- fail?: (params: {
476
- errorMsg: string;
477
- errorCode: string | number;
478
- innerError: {
479
- errorCode: string | number;
480
- errorMsg: string;
481
- };
482
- }) => void;
483
- complete?: () => void;
484
- }): void;
485
-
486
- /**
487
- *@description 判断是否有这个权限
488
- *WIFI or BLE*/
489
- export function hasPermission(params: {
490
- /**
491
- * "WIFI" or "BLE"
492
- * 权限
493
- */
494
- permission: string;
495
- success?: (params: boolean) => void;
496
- fail?: (params: {
497
- errorMsg: string;
498
- errorCode: string | number;
499
- innerError: {
500
- errorCode: string | number;
501
- errorMsg: string;
502
- };
503
- }) => void;
504
- complete?: () => void;
505
- }): void;
506
-
507
- /**
508
- *@description 请求获取这个权限
509
- *WIFI or BLE*/
510
- export function requestPermission(params: {
511
- /**
512
- * "WIFI" or "BLE"
513
- * 权限
514
- */
515
- permission: string;
516
- success?: (params: null) => void;
517
- fail?: (params: {
518
- errorMsg: string;
519
- errorCode: string | number;
520
- innerError: {
521
- errorCode: string | number;
522
- errorMsg: string;
523
- };
524
- }) => void;
525
- complete?: () => void;
526
- }): void;
527
-
528
- /**
529
- *@description 指定时间内扫描已配网的设备,扫描结果通过【onBLEScanDevice】事件获取*/
530
- export function startBLEScanDevice(params: {
531
- /** 扫描超时时间 */
532
- timeout: number;
533
- /**
534
- * 扫描类型
535
- * SINGLE -> "SINGLE"
536
- * SINGLE_QR -> "SINGLE_QR"
537
- * MESH -> "MESH"
538
- * MESH -> "MESH"
539
- * SIG_MESH -> "SIG_MESH"
540
- * NORMAL -> "NORMAL" 默认
541
- * Thing_BEACON -> "Thing_BEACON"
542
- * Multi_Mode 双模
543
- */
544
- scanType: string;
545
- success?: (params: null) => void;
546
- fail?: (params: {
547
- errorMsg: string;
548
- errorCode: string | number;
549
- innerError: {
550
- errorCode: string | number;
551
- errorMsg: string;
552
- };
553
- }) => void;
554
- complete?: () => void;
555
- }): void;
556
-
557
- /**
558
- *@description 停止蓝牙扫描*/
559
- export function stopBLEScan(params?: {
560
- success?: (params: null) => void;
561
- fail?: (params: {
562
- errorMsg: string;
563
- errorCode: string | number;
564
- innerError: {
565
- errorCode: string | number;
566
- errorMsg: string;
567
- };
568
- }) => void;
569
- complete?: () => void;
570
- }): void;
571
-
572
- /**
573
- *@description 蓝牙连接 / AP监听广播包后 并查询状态 然后再开始查询wifi列表*/
574
- export function queryDeviceConfigState(params: {
575
- /** homeid */
576
- homeId: number;
577
- /** 超时时间 */
578
- timeout?: number;
579
- /**
580
- * 配网类型,后续新流程添加在这里
581
- * AP -> "AP"
582
- * WIFI_BLE -> "WIFI_BLE"
583
- */
584
- pairType: string;
585
- /** 蓝牙扫描出来的广播包,目前只有wifi双模需要填写 */
586
- bleWifiPairParams: ScanDevicePacket;
587
- /**
588
- * AP需要传的参数
589
- * 可以不传,使用扫码配网必传
590
- */
591
- apPairParams?: ApQueryParam;
592
- success?: (params: WiFiInfo[]) => void;
593
- fail?: (params: {
594
- errorMsg: string;
595
- errorCode: string | number;
596
- innerError: {
597
- errorCode: string | number;
598
- errorMsg: string;
599
- };
600
- }) => void;
601
- complete?: () => void;
602
- }): void;
603
-
604
- /**
605
- *@description 开始配网*/
606
- export function startActivator(params: {
607
- /**
608
- * 配网类型,后续新流程添加在这里
609
- * AP -> "AP"
610
- * WIFI_BLE -> "WIFI_BLE"
611
- */
612
- pairType: string;
613
- /** AP 模式下AP配网参数 */
614
- apActivatorParams: ApActivatorParam;
615
- /** WIFI双模 模式下配网参数 */
616
- bleWifiActivatorParams: BleWifiActivatorParam;
617
- success?: (params: {
618
- /** 设备id */
619
- devId: string;
620
- /** 设备名称 */
621
- name: string;
622
- /** 设备房间id */
623
- roomId: string;
624
- /** 设备图标url */
625
- iconUrl: string;
626
- }) => void;
627
- fail?: (params: {
628
- errorMsg: string;
629
- errorCode: string | number;
630
- innerError: {
631
- errorCode: string | number;
632
- errorMsg: string;
633
- };
634
- }) => void;
635
- complete?: () => void;
636
- }): void;
637
-
638
- /**
639
- *@description 停止配网*/
640
- export function stopActivator(params: {
641
- /** uuid 根据uuid来匹配找到对应的蓝牙配网设备 */
642
- uuid: string;
643
- /**
644
- * 配网类型,后续新流程添加在这里
645
- * AP -> "AP"
646
- * WIFI_BLE -> "WIFI_BLE", 蓝牙配网需要填uuid
647
- */
648
- pairType: string;
649
- success?: (params: null) => void;
650
- fail?: (params: {
651
- errorMsg: string;
652
- errorCode: string | number;
653
- innerError: {
654
- errorCode: string | number;
655
- errorMsg: string;
656
- };
657
- }) => void;
658
- complete?: () => void;
659
- }): void;
660
-
661
- /**
662
- *@description 自动连接wifi*/
663
- export function autoConnectToAp(params: {
664
- /** ssid prefix */
665
- ssidPrefix: string;
666
- /** ssid */
667
- ssid: string;
668
- /** pwd */
669
- pwd: string;
670
- success?: (params: null) => void;
671
- fail?: (params: {
672
- errorMsg: string;
673
- errorCode: string | number;
674
- innerError: {
675
- errorCode: string | number;
676
- errorMsg: string;
677
- };
678
- }) => void;
679
- complete?: () => void;
680
- }): void;
681
-
682
- /**
683
- *@description 自动连接wifi P2P By SDK*/
684
- export function connectWifi(params: {
685
- /** ssid prefix */
686
- ssidPrefix: string;
687
- /** ssid */
688
- ssid: string;
689
- /** pwd */
690
- pwd: string;
691
- success?: (params: null) => void;
692
- fail?: (params: {
693
- errorMsg: string;
694
- errorCode: string | number;
695
- innerError: {
696
- errorCode: string | number;
697
- errorMsg: string;
698
- };
699
- }) => void;
700
- complete?: () => void;
701
- }): void;
702
-
703
- /**
704
- *@description 根据SSID前缀,自动连接Wifi*/
705
- export function autoConnectToApWithSSIDPrefix(params: {
706
- /** ssid prefix */
707
- ssidPrefix: string;
708
- /** ssid */
709
- ssid: string;
710
- /** pwd */
711
- pwd: string;
712
- success?: (params: null) => void;
713
- fail?: (params: {
714
- errorMsg: string;
715
- errorCode: string | number;
716
- innerError: {
717
- errorCode: string | number;
718
- errorMsg: string;
719
- };
720
- }) => void;
721
- complete?: () => void;
722
- }): void;
723
-
724
- /**
725
- *@description 根据SSID,移除WiFi连接*/
726
- export function removeApConfigration(params: {
727
- /** ssid prefix */
728
- ssidPrefix: string;
729
- /** ssid */
730
- ssid: string;
731
- /** pwd */
732
- pwd: string;
733
- success?: (params: null) => void;
734
- fail?: (params: {
735
- errorMsg: string;
736
- errorCode: string | number;
737
- innerError: {
738
- errorCode: string | number;
739
- errorMsg: string;
740
- };
741
- }) => void;
742
- complete?: () => void;
743
- }): void;
744
-
745
- /**
746
- *@description 获取配网token*/
747
- export function getPairConfigToken(params: {
748
- /** 家庭id */
749
- gid: number;
750
- success?: (params: string) => void;
751
- fail?: (params: {
752
- errorMsg: string;
753
- errorCode: string | number;
754
- innerError: {
755
- errorCode: string | number;
756
- errorMsg: string;
757
- };
758
- }) => void;
759
- complete?: () => void;
760
- }): void;
761
-
762
- /**
763
- *@description 重置设备*/
764
- export function resetDevice(params: {
765
- /** uuid 根据uuid来匹配找到对应的蓝牙配网设备 */
766
- uuid: string;
767
- /**
768
- * 配网类型,后续新流程添加在这里
769
- * AP -> "AP"
770
- * WIFI_BLE -> "WIFI_BLE", 蓝牙配网需要填uuid
771
- */
772
- pairType: string;
773
- success?: (params: boolean) => void;
774
- fail?: (params: {
775
- errorMsg: string;
776
- errorCode: string | number;
777
- innerError: {
778
- errorCode: string | number;
779
- errorMsg: string;
780
- };
781
- }) => void;
782
- complete?: () => void;
783
- }): void;
784
-
785
- /**
786
- *@description 获取sl等级配置*/
787
- export function getDeviceSecurityConfigs(params?: {
788
- success?: (params: string) => void;
789
- fail?: (params: {
790
- errorMsg: string;
791
- errorCode: string | number;
792
- innerError: {
793
- errorCode: string | number;
794
- errorMsg: string;
795
- };
796
- }) => void;
797
- complete?: () => void;
798
- }): void;
799
-
800
- /**
801
- *@description 在自动连接热点场景下,是否是系统控制弹窗的*/
802
- export function isSystemPopupInAutoConnectAp(params?: {
803
- success?: (params: boolean) => void;
804
- fail?: (params: {
805
- errorMsg: string;
806
- errorCode: string | number;
807
- innerError: {
808
- errorCode: string | number;
809
- errorMsg: string;
810
- };
811
- }) => void;
812
- complete?: () => void;
813
- }): void;
814
-
815
- /**
816
- *@description 是否仅有蓝牙权限*/
817
- export function hasBlePermission(params?: {
818
- success?: (params: boolean) => void;
819
- fail?: (params: {
820
- errorMsg: string;
821
- errorCode: string | number;
822
- innerError: {
823
- errorCode: string | number;
824
- errorMsg: string;
825
- };
826
- }) => void;
827
- complete?: () => void;
828
- }): void;
829
-
830
- /**
831
- *@description 是否有本地网络权限*/
832
- export function hasLocalNetworkPermission(params?: {
833
- success?: (params: boolean) => void;
834
- fail?: (params: {
835
- errorMsg: string;
836
- errorCode: string | number;
837
- innerError: {
838
- errorCode: string | number;
839
- errorMsg: string;
840
- };
841
- }) => void;
842
- complete?: () => void;
843
- }): void;
844
-
845
- /**
846
- *@description 老流程开始配网(AP、双模)*/
847
- export function startActivatorNormal(params: {
848
- /**
849
- * 配网类型,后续新流程添加在这里
850
- * AP -> "AP"
851
- * WIFI_BLE -> "WIFI_BLE"
852
- */
853
- pairType: string;
854
- /** AP 模式下AP配网参数 */
855
- apParams: ApNormalActivatorParam;
856
- /** WIFI双模 模式下配网参数 */
857
- bleWifiParams: BleWifiNormalActivatorParam;
858
- success?: (params: {
859
- /** 设备id */
860
- devId: string;
861
- /** 设备名称 */
862
- name: string;
863
- /** 设备房间id */
864
- roomId: string;
865
- /** 设备图标url */
866
- iconUrl: string;
867
- }) => void;
868
- fail?: (params: {
869
- errorMsg: string;
870
- errorCode: string | number;
871
- innerError: {
872
- errorCode: string | number;
873
- errorMsg: string;
874
- };
875
- }) => void;
876
- complete?: () => void;
877
- }): void;
878
-
879
- /**
880
- *@description 老流程停止配网*/
881
- export function stopActivatorNormal(params: {
882
- /** uuid 根据uuid来匹配找到对应的蓝牙配网设备 */
883
- uuid: string;
884
- /**
885
- * 配网类型,后续新流程添加在这里
886
- * AP -> "AP"
887
- * WIFI_BLE -> "WIFI_BLE", 蓝牙配网需要填uuid
888
- */
889
- pairType: string;
890
- success?: (params: null) => void;
891
- fail?: (params: {
892
- errorMsg: string;
893
- errorCode: string | number;
894
- innerError: {
895
- errorCode: string | number;
896
- errorMsg: string;
897
- };
898
- }) => void;
899
- complete?: () => void;
900
- }): void;
901
-
902
- /**
903
- *@description 老配网流程,获取wifi列表*/
904
- export function queryWifiListByNormalChannel(params: {
905
- /** 超时时间, unit: s */
906
- timeout: number;
907
- /** 需要返回多少个WIFI */
908
- size: number;
909
- /**
910
- * 配网类型,后续新流程添加在这里
911
- * AP -> "AP"
912
- * WIFI_BLE -> "WIFI_BLE"
913
- */
914
- pairType: string;
915
- /** 如果是蓝牙设备,需要传uuid,每个uuid对应一个配网 */
916
- uuid: string;
917
- success?: (params: WiFiInfo[]) => void;
918
- fail?: (params: {
919
- errorMsg: string;
920
- errorCode: string | number;
921
- innerError: {
922
- errorCode: string | number;
923
- errorMsg: string;
924
- };
925
- }) => void;
926
- complete?: () => void;
927
- }): void;
928
-
929
- /**
930
- *@description 扫描 Wi-Fi*/
931
- export function startScanWifi(params?: {
932
- success?: (params: WifiScanInfo[]) => void;
933
- fail?: (params: {
934
- errorMsg: string;
935
- errorCode: string | number;
936
- innerError: {
937
- errorCode: string | number;
938
- errorMsg: string;
939
- };
940
- }) => void;
941
- complete?: () => void;
942
- }): void;
943
-
944
- /**
945
- *@description 释放 Wi-Fi P2P*/
946
- export function releaseP2PWifi(params?: {
947
- success?: (params: null) => void;
948
- fail?: (params: {
949
- errorMsg: string;
950
- errorCode: string | number;
951
- innerError: {
952
- errorCode: string | number;
953
- errorMsg: string;
954
- };
955
- }) => void;
956
- complete?: () => void;
957
- }): void;
958
-
959
- /**
960
- *@description 获取当前连接的WiFi的SSID*/
961
- export function getCurrentWifiSSID(params?: {
962
- success?: (params: string) => void;
963
- fail?: (params: {
964
- errorMsg: string;
965
- errorCode: string | number;
966
- innerError: {
967
- errorCode: string | number;
968
- errorMsg: string;
969
- };
970
- }) => void;
971
- complete?: () => void;
972
- }): void;
973
-
974
- /**
975
- *@description 指定时间内扫描对应uuid的设备,扫描结果通过【onBLEScanDeviceWithUUID】事件获取*/
976
- export function startBLEScanDeviceWithUUID(params: {
977
- /** 扫描超时时间 */
978
- timeout?: number;
979
- /**
980
- * 扫描类型
981
- * SINGLE -> "SINGLE"
982
- * SINGLE_QR -> "SINGLE_QR"
983
- * MESH -> "MESH"
984
- * MESH -> "MESH"
985
- * SIG_MESH -> "SIG_MESH"
986
- * NORMAL -> "NORMAL" 默认
987
- * Thing_BEACON -> "Thing_BEACON"
988
- * Multi_Mode 双模
989
- */
990
- scanType: string;
991
- /** 要匹配的uuid */
992
- uuid: string;
993
- success?: (params: null) => void;
994
- fail?: (params: {
995
- errorMsg: string;
996
- errorCode: string | number;
997
- innerError: {
998
- errorCode: string | number;
999
- errorMsg: string;
1000
- };
1001
- }) => void;
1002
- complete?: () => void;
1003
- }): void;
1004
-
1005
- /**
1006
- *@description 停止扫描 used by startBLEScanDeviceWithUUID*/
1007
- export function stopBleScanWithUUID(params?: {
1008
- success?: (params: null) => void;
1009
- fail?: (params: {
1010
- errorMsg: string;
1011
- errorCode: string | number;
1012
- innerError: {
1013
- errorCode: string | number;
1014
- errorMsg: string;
1015
- };
1016
- }) => void;
1017
- complete?: () => void;
1018
- }): void;
1019
-
1020
- /**
1021
- *@description 是否可以被重置,以及云端绑定状态下是否还要重置*/
1022
- export function checkBleWifiDeviceReset(params: {
1023
- /** 短链 */
1024
- link: string;
1025
- /** 广播包 */
1026
- packet: ScanDevicePacket;
1027
- success?: (params: {
1028
- /** 业务错误码 */
1029
- businessCode: number;
1030
- /** 返回的加密字段 */
1031
- encryptedAuthKey?: string;
1032
- /** 返回加密的random */
1033
- random?: string;
1034
- }) => void;
1035
- fail?: (params: {
1036
- errorMsg: string;
1037
- errorCode: string | number;
1038
- innerError: {
1039
- errorCode: string | number;
1040
- errorMsg: string;
1041
- };
1042
- }) => void;
1043
- complete?: () => void;
1044
- }): void;
1045
-
1046
- /**
1047
- *@description 触发扫码重置流程*/
1048
- export function startResetBleWifiDevice(params: {
1049
- /** 广播包 */
1050
- packet: ScanDevicePacket;
1051
- /** 返回的加密字段 */
1052
- encryptedAuthKey: string;
1053
- /** 返回加密的random */
1054
- random: string;
1055
- success?: (params: boolean) => void;
1056
- fail?: (params: {
1057
- errorMsg: string;
1058
- errorCode: string | number;
1059
- innerError: {
1060
- errorCode: string | number;
1061
- errorMsg: string;
1062
- };
1063
- }) => void;
1064
- complete?: () => void;
1065
- }): void;
1066
-
1067
- /**
1068
- *@description 当前账号下是否有这个设备
1069
- *目前只有蓝牙设备使用场景:判断是否在当前列表里
1070
- *规则: 根据uuid匹配对应的设备是否在首页列表里,不在则通过传入的mac匹配。如果是扫描到的蓝牙广播包后使用,尽量传mac和uuid一起比较*/
1071
- export function isExistInCurrentAccount(params: {
1072
- /** uuid */
1073
- uuid: string;
1074
- /** mac */
1075
- mac: string;
1076
- success?: (params: {
1077
- /** 是否存在设备 */
1078
- exists: boolean;
1079
- /** 如果存在,返回设备id */
1080
- devId?: string;
1081
- }) => void;
1082
- fail?: (params: {
1083
- errorMsg: string;
1084
- errorCode: string | number;
1085
- innerError: {
1086
- errorCode: string | number;
1087
- errorMsg: string;
1088
- };
1089
- }) => void;
1090
- complete?: () => void;
1091
- }): void;
1092
-
1093
- /**
1094
- *@description 配网中间态事件*/
1095
- export function onActivateIntermediateState(
1096
- listener: (params: IntermediateStateResponse) => void
1097
- ): void;
1098
-
1099
- /**
1100
- *@description 移除监听:配网中间态事件*/
1101
- export function offActivateIntermediateState(
1102
- listener: (params: IntermediateStateResponse) => void
1103
- ): void;
1104
-
1105
- /**
1106
- *@description 扫描到的设备信息*/
1107
- export function onScanDeviceInfo(listener: (params: ScanDeviceResponse) => void): void;
1108
-
1109
- /**
1110
- *@description 移除监听:扫描到的设备信息*/
1111
- export function offScanDeviceInfo(listener: (params: ScanDeviceResponse) => void): void;
1112
-
1113
- /**
1114
- *@description 配网的结果*/
1115
- export function onDeviceActivateResult(
1116
- listener: (params: DeviceActivateResultResponse) => void
1117
- ): void;
1118
-
1119
- /**
1120
- *@description 移除监听:配网的结果*/
1121
- export function offDeviceActivateResult(
1122
- listener: (params: DeviceActivateResultResponse) => void
1123
- ): void;
1124
-
1125
- /**
1126
- *@description 扫描到设备后进行通知*/
1127
- export function onBLEScanDevice(listener: (params: ScanDevicePacket) => void): void;
1128
-
1129
- /**
1130
- *@description 移除监听:扫描到设备后进行通知*/
1131
- export function offBLEScanDevice(listener: (params: ScanDevicePacket) => void): void;
1132
-
1133
- /**
1134
- *@description wifi状态发生变化*/
1135
- export function onWifiStateChange(listener: (params: Privacy) => void): void;
1136
-
1137
- /**
1138
- *@description 移除监听:wifi状态发生变化*/
1139
- export function offWifiStateChange(listener: (params: Privacy) => void): void;
1140
-
1141
- /**
1142
- *@description 蓝牙状态发生变化*/
1143
- export function onBLEStateChange(listener: (params: Privacy) => void): void;
1144
-
1145
- /**
1146
- *@description 移除监听:蓝牙状态发生变化*/
1147
- export function offBLEStateChange(listener: (params: Privacy) => void): void;
1148
-
1149
- /**
1150
- *@description 蓝牙权限发生变化*/
1151
- export function onBlePermissionChange(listener: (params: Privacy) => void): void;
1152
-
1153
- /**
1154
- *@description 移除监听:蓝牙权限发生变化*/
1155
- export function offBlePermissionChange(listener: (params: Privacy) => void): void;
1156
-
1157
- /**
1158
- *@description 本地网络权限发生变化*/
1159
- export function onlocalNetWorkPermissionChange(listener: (params: Privacy) => void): void;
1160
-
1161
- /**
1162
- *@description 移除监听:本地网络权限发生变化*/
1163
- export function offlocalNetWorkPermissionChange(listener: (params: Privacy) => void): void;
1164
-
1165
- /**
1166
- *@description 老流程配网,阶段上报*/
1167
- export function onReceiveActivatorState(listener: (params: ConfigState) => void): void;
1168
-
1169
- /**
1170
- *@description 移除监听:老流程配网,阶段上报*/
1171
- export function offReceiveActivatorState(listener: (params: ConfigState) => void): void;
1172
-
1173
- /**
1174
- *@description 扫描到设备后进行通知*/
1175
- export function onBLEScanDeviceWithUUID(listener: (params: ScanDevicePacket) => void): void;
1176
-
1177
- /**
1178
- *@description 移除监听:扫描到设备后进行通知*/
1179
- export function offBLEScanDeviceWithUUID(listener: (params: ScanDevicePacket) => void): void;
1180
-
1181
- export type ScanDeviceResponse = {
1182
- /** 唯一标识 */
1183
- uniqueId?: string;
1184
- /** 设备名称 */
1185
- name?: string;
1186
- /** 设备icon */
1187
- icon?: string;
1188
- /** 设备icon */
1189
- pid?: string;
1190
- /** 通过什么扫描能力扫描到 */
1191
- scanDeviceTypeList?: string[];
1192
- /** 支持什么配网能力 */
1193
- supportActivatorTypeList?: string[];
1194
- /**
1195
- * matter设备类型
1196
- * UN_KNOW:0 WIFI:1 THREAD:2 SOFT_AP:3 ON_NETWORK:4
1197
- */
1198
- matterDeviceType?: number;
1199
- /** 是否为涂鸦matter设备 */
1200
- isThingMatter?: boolean;
1201
- /** 错误码,0-为成功 */
1202
- errorCode?: string;
1203
- };
1204
-
1205
- export type BlueMeshBean = {
1206
- /** 来自服务器的时间 */
1207
- resptime: number;
1208
- /** 设备的localKey */
1209
- localKey: string;
1210
- /** meshId */
1211
- meshId?: string;
1212
- /** 设备名称 */
1213
- name?: string;
1214
- /** 网关协议版本 */
1215
- pv?: string;
1216
- /** Mesh 名称, 只用在私有mesh */
1217
- code?: string;
1218
- /** Wi-Fi密码,仅适用于mesh网关 */
1219
- password?: string;
1220
- /** 被其他人分享 */
1221
- share?: boolean;
1222
- };
1223
-
1224
- export type HgwBean = {
1225
- /** ip */
1226
- ip: string;
1227
- /** gwId */
1228
- gwId: string;
1229
- /** active */
1230
- active?: number;
1231
- /** ablilty */
1232
- ablilty?: number;
1233
- /** lastSeenTime */
1234
- lastSeenTime?: number;
1235
- /** mode */
1236
- mode?: number;
1237
- /** productKey */
1238
- productKey?: string;
1239
- /** encrypt */
1240
- encrypt?: boolean;
1241
- /** version */
1242
- version: string;
1243
- /** token */
1244
- token?: boolean;
1245
- /** wf_cfg */
1246
- wf_cfg?: boolean;
1247
- /** extend */
1248
- extend?: string;
1249
- /** ssid */
1250
- ssid?: string;
1251
- /** devConfigAttribute */
1252
- devConfigAttribute?: number;
1253
- /** apConfigType */
1254
- apConfigType?: number;
1255
- /** sl */
1256
- sl?: number;
1257
- /** uuid */
1258
- uuid?: string;
1259
- /** proAbility */
1260
- proAbility?: number;
1261
- };
1262
-
1263
- export type SetupPayload = {
1264
- /** version */
1265
- version?: number;
1266
- /** vendorId */
1267
- vendorId?: number;
1268
- /** productId */
1269
- productId?: number;
1270
- /** setupPinCode */
1271
- setupPinCode?: number;
1272
- /** commissioningFlow */
1273
- commissioningFlow?: number;
1274
- /** optionalQrCodeInfoMap */
1275
- optionalQrCodeInfoMap?: any;
1276
- /** discoveryCapabilities */
1277
- discoveryCapabilities?: number[];
1278
- /** commissioningFlow */
1279
- discriminator?: Discriminator;
1280
- };
1281
-
1282
- export type ConnectResult = {
1283
- /**
1284
- * 类型如下
1285
- * BLE MDNS
1286
- */
1287
- discoveryType?: string;
1288
- /** port */
1289
- port?: number;
1290
- /** ipAddress */
1291
- ipAddress?: string;
1292
- /** uuid */
1293
- uuid?: string;
1294
- /** thingProductId */
1295
- thingProductId?: string;
1296
- /** accessType */
1297
- accessType?: number;
1298
- /** nodeId */
1299
- nodeId?: number;
1300
- /** isThingMatter */
1301
- isThingMatter?: boolean;
1302
- /**
1303
- * matter设备类型
1304
- * UN_KNOW:0 WIFI:1 THREAD:2 SOFT_AP:3 ON_NETWORK:4
1305
- */
1306
- matterDeviceType?: number;
1307
- /** 设备绑定的网关信息 */
1308
- gwId?: string;
1309
- };
1310
-
1311
- export type ScanDeviceBean = {
1312
- /** id */
1313
- id?: string;
1314
- /** name */
1315
- name?: string;
1316
- /** providerName */
1317
- providerName?: string;
1318
- /** data */
1319
- data?: string;
1320
- /** configType */
1321
- configType?: string;
1322
- /** productId */
1323
- productId?: string;
1324
- /** uuid */
1325
- uuid?: string;
1326
- /** mac */
1327
- mac?: string;
1328
- /** address */
1329
- address?: string;
1330
- /** deviceType */
1331
- deviceType?: number;
1332
- /** isbind */
1333
- isbind?: boolean;
1334
- /** flag */
1335
- flag?: number;
1336
- /**
1337
- * /**
1338
- * isShare
1339
- */
1340
- isShare?: boolean;
1341
- /** isRoam */
1342
- isRoam?: boolean;
1343
- };
1344
-
1345
- export type Discriminator = {
1346
- /** value */
1347
- value?: number;
1348
- /** shortDiscriminator */
1349
- shortDiscriminator?: boolean;
1350
- };
1351
-
1352
- export type WifiInfoBean = {
1353
- /** Wi-Fi名称 */
1354
- ssid?: string;
1355
- /** i-Fi信号强度 */
1356
- rssi?: number;
1357
- /** 加密方式,0为未加密 */
1358
- sec?: number;
1359
- };
1360
-
1361
- export type ScanDevicePacket = {
1362
- /** id */
1363
- id: string;
1364
- /** name */
1365
- name: string;
1366
- /** providerName */
1367
- providerName: string;
1368
- /** data */
1369
- data: string;
1370
- /** configType */
1371
- configType: string;
1372
- /** productId */
1373
- productId: string;
1374
- /** uuid */
1375
- uuid: string;
1376
- /** mac */
1377
- mac: string;
1378
- /** address */
1379
- address: string;
1380
- /** deviceType */
1381
- deviceType: number;
1382
- /** isbind */
1383
- isbind: boolean;
1384
- /** flag */
1385
- flag: number;
1386
- /** isShare */
1387
- isShare: boolean;
1388
- /** rssi */
1389
- rssi: number;
1390
- /** pid hex */
1391
- pidHexString: string;
1392
- };
1393
-
1394
- export type ApQueryParam = {
1395
- /** pin, option 可选 */
1396
- pin: string;
1397
- /** uuid , option 可选 */
1398
- uuid: string;
1399
- };
1400
-
1401
- export type WiFiInfo = {
1402
- /** ssid */
1403
- ssid: string;
1404
- /** 强度 */
1405
- rssi: number;
1406
- /** sec */
1407
- sec: number;
1408
- };
1409
-
1410
- export type ApActivatorParam = {
1411
- /** ssid */
1412
- ssid: string;
1413
- /** pwd */
1414
- pwd: string;
1415
- /** token */
1416
- token: string;
1417
- /** 配网超时时间 */
1418
- timeout: number;
1419
- /** 是否为密码错误恢复配网 */
1420
- isRecovery: boolean;
1421
- /**
1422
- * securityConfig
1423
- * use getDeviceSecurityConfigs() method to get
1424
- */
1425
- securityConfig: string;
1426
- };
1427
-
1428
- export type BleWifiActivatorParam = {
1429
- /** uuid */
1430
- uuid: string;
1431
- /** ssid */
1432
- ssid: string;
1433
- /** pwd */
1434
- pwd: string;
1435
- /** token */
1436
- token: string;
1437
- /** timeout */
1438
- timeout: number;
1439
- /** 是否为密码错误恢复配网 */
1440
- isRecovery: boolean;
1441
- /**
1442
- * the phase 1 timeout value, in milliseconds. Default 60000
1443
- * Note
1444
- * <p>
1445
- * For devices with WiFi and Bluetooth capabilities, use WiFi to activate in the first stage, if it fails, use Bluetooth to activate.
1446
- */
1447
- phase1Timeout: number;
1448
- };
1449
-
1450
- export type ApNormalActivatorParam = {
1451
- /** homeid */
1452
- homeId: number;
1453
- /** ssid */
1454
- ssid: string;
1455
- /** pwd */
1456
- pwd: string;
1457
- /** token */
1458
- token: string;
1459
- /** 配网超时时间 */
1460
- timeout: number;
1461
- /** 是否为密码错误恢复配网 */
1462
- isRecovery: boolean;
1463
- /**
1464
- * securityConfig
1465
- * use getDeviceSecurityConfigs() method to get
1466
- */
1467
- securityConfig: string;
1468
- };
1469
-
1470
- export type BleWifiNormalActivatorParam = {
1471
- /** homeid */
1472
- homeId: number;
1473
- /** uuid */
1474
- uuid: string;
1475
- /** ssid */
1476
- ssid: string;
1477
- /** pwd */
1478
- pwd: string;
1479
- /** token */
1480
- token: string;
1481
- /** timeout */
1482
- timeout: number;
1483
- /** 是否为密码错误恢复配网 */
1484
- isRecovery: boolean;
1485
- /**
1486
- * the phase 1 timeout value, in milliseconds. Default 60000
1487
- * Note
1488
- * <p>
1489
- * For devices with WiFi and Bluetooth capabilities, use WiFi to activate in the first stage, if it fails, use Bluetooth to activate.
1490
- */
1491
- phase1Timeout: number;
1492
- /** 蓝牙扫描出来的广播包,目前只有wifi双模需要填写 */
1493
- bleWifiPacket: ScanDevicePacket;
1494
- };
1495
-
1496
- export type WifiScanInfo = {
1497
- /** Wi-Fi type */
1498
- wifiType: number;
1499
- /** Wi-Fi ssid */
1500
- ssid: string;
1501
- /** Wi-Fi bssid */
1502
- bssid: string;
1503
- /** the same as ScanResult#level */
1504
- level: number;
1505
- /** need password */
1506
- isNeedPwd: boolean;
1507
- /** the same as ScanResult#level */
1508
- signalStrengthLevel: number;
1509
- /** the same as ScanResult#level */
1510
- capabilities: string;
1511
- };
1512
-
1513
- export type IntermediateStateResponse = {
1514
- /** 设备uuid */
1515
- uuid: string;
1516
- /** 配网阶段 */
1517
- configStage: number;
1518
- /** 状态 */
1519
- state: number;
1520
- /**
1521
- * matter设备类型
1522
- * UN_KNOW:0 WIFI:1 THREAD:2 SOFT_AP:3 ON_NETWORK:4
1523
- */
1524
- matterDeviceType: number;
1525
- /** 是否为涂鸦matter */
1526
- isThingMatter: boolean;
1527
- };
1528
-
1529
- export type DeviceActivateResultResponse = {
1530
- /** 配网成功的设备Id */
1531
- deviceId?: string;
1532
- /** 配网类型 */
1533
- activeModel?: string;
1534
- /** 错误码,0-为成功 */
1535
- errorCode?: string;
1536
- };
1537
-
1538
- export type Privacy = {
1539
- /** enable */
1540
- enable: boolean;
1541
- };
1542
-
1543
- export type ConfigState = {
1544
- /** 配网阶段 */
1545
- stage: number;
1546
- /** 配网状态 */
1547
- status: number;
1548
- /** 双模配网时候,对应的uuid */
1549
- uuid: string;
1550
- };
1551
-
1552
- export type PermissionParam = {
1553
- /**
1554
- * "WIFI" or "BLE"
1555
- * 权限
1556
- */
1557
- permission: string;
1558
- };
1559
-
1560
- export type BLEScanParam = {
1561
- /** 扫描超时时间 */
1562
- timeout: number;
1563
- /**
1564
- * 扫描类型
1565
- * SINGLE -> "SINGLE"
1566
- * SINGLE_QR -> "SINGLE_QR"
1567
- * MESH -> "MESH"
1568
- * MESH -> "MESH"
1569
- * SIG_MESH -> "SIG_MESH"
1570
- * NORMAL -> "NORMAL" 默认
1571
- * Thing_BEACON -> "Thing_BEACON"
1572
- * Multi_Mode 双模
1573
- */
1574
- scanType: string;
1575
- };
1576
-
1577
- export type QueryConfigParam = {
1578
- /** homeid */
1579
- homeId: number;
1580
- /** 超时时间 */
1581
- timeout?: number;
1582
- /**
1583
- * 配网类型,后续新流程添加在这里
1584
- * AP -> "AP"
1585
- * WIFI_BLE -> "WIFI_BLE"
1586
- */
1587
- pairType: string;
1588
- /** 蓝牙扫描出来的广播包,目前只有wifi双模需要填写 */
1589
- bleWifiPairParams: ScanDevicePacket;
1590
- /**
1591
- * AP需要传的参数
1592
- * 可以不传,使用扫码配网必传
1593
- */
1594
- apPairParams?: ApQueryParam;
1595
- };
1596
-
1597
- export type ActivatorParam = {
1598
- /**
1599
- * 配网类型,后续新流程添加在这里
1600
- * AP -> "AP"
1601
- * WIFI_BLE -> "WIFI_BLE"
1602
- */
1603
- pairType: string;
1604
- /** AP 模式下AP配网参数 */
1605
- apActivatorParams: ApActivatorParam;
1606
- /** WIFI双模 模式下配网参数 */
1607
- bleWifiActivatorParams: BleWifiActivatorParam;
1608
- };
1609
-
1610
- export type DeviceInfo = {
1611
- /** 设备id */
1612
- devId: string;
1613
- /** 设备名称 */
1614
- name: string;
1615
- /** 设备房间id */
1616
- roomId: string;
1617
- /** 设备图标url */
1618
- iconUrl: string;
1619
- };
1620
-
1621
- export type StopActivatorParam = {
1622
- /** uuid 根据uuid来匹配找到对应的蓝牙配网设备 */
1623
- uuid: string;
1624
- /**
1625
- * 配网类型,后续新流程添加在这里
1626
- * AP -> "AP"
1627
- * WIFI_BLE -> "WIFI_BLE", 蓝牙配网需要填uuid
1628
- */
1629
- pairType: string;
1630
- };
1631
-
1632
- export type SsidInfo = {
1633
- /** ssid prefix */
1634
- ssidPrefix: string;
1635
- /** ssid */
1636
- ssid: string;
1637
- /** pwd */
1638
- pwd: string;
1639
- };
1640
-
1641
- export type TokenParam = {
1642
- /** 家庭id */
1643
- gid: number;
1644
- };
1645
-
1646
- export type ActivatorNormalParam = {
1647
- /**
1648
- * 配网类型,后续新流程添加在这里
1649
- * AP -> "AP"
1650
- * WIFI_BLE -> "WIFI_BLE"
1651
- */
1652
- pairType: string;
1653
- /** AP 模式下AP配网参数 */
1654
- apParams: ApNormalActivatorParam;
1655
- /** WIFI双模 模式下配网参数 */
1656
- bleWifiParams: BleWifiNormalActivatorParam;
1657
- };
1658
-
1659
- export type QueryWifiListParam = {
1660
- /** 超时时间, unit: s */
1661
- timeout: number;
1662
- /** 需要返回多少个WIFI */
1663
- size: number;
1664
- /**
1665
- * 配网类型,后续新流程添加在这里
1666
- * AP -> "AP"
1667
- * WIFI_BLE -> "WIFI_BLE"
1668
- */
1669
- pairType: string;
1670
- /** 如果是蓝牙设备,需要传uuid,每个uuid对应一个配网 */
1671
- uuid: string;
1672
- };
1673
-
1674
- export type BLEScanMatchParam = {
1675
- /** 扫描超时时间 */
1676
- timeout?: number;
1677
- /**
1678
- * 扫描类型
1679
- * SINGLE -> "SINGLE"
1680
- * SINGLE_QR -> "SINGLE_QR"
1681
- * MESH -> "MESH"
1682
- * MESH -> "MESH"
1683
- * SIG_MESH -> "SIG_MESH"
1684
- * NORMAL -> "NORMAL" 默认
1685
- * Thing_BEACON -> "Thing_BEACON"
1686
- * Multi_Mode 双模
1687
- */
1688
- scanType: string;
1689
- /** 要匹配的uuid */
1690
- uuid: string;
1691
- };
1692
-
1693
- export type CheckDeviceParam = {
1694
- /** 短链 */
1695
- link: string;
1696
- /** 广播包 */
1697
- packet: ScanDevicePacket;
1698
- };
1699
-
1700
- export type CheckResultCallBack = {
1701
- /** 业务错误码 */
1702
- businessCode: number;
1703
- /** 返回的加密字段 */
1704
- encryptedAuthKey?: string;
1705
- /** 返回加密的random */
1706
- random?: string;
1707
- };
1708
-
1709
- export type ResetDeviceParam = {
1710
- /** 广播包 */
1711
- packet: ScanDevicePacket;
1712
- /** 返回的加密字段 */
1713
- encryptedAuthKey: string;
1714
- /** 返回加密的random */
1715
- random: string;
1716
- };
1717
-
1718
- export type JudgmentParam = {
1719
- /** uuid */
1720
- uuid: string;
1721
- /** mac */
1722
- mac: string;
1723
- };
1724
-
1725
- export type SuccessInfo = {
1726
- /** 是否存在设备 */
1727
- exists: boolean;
1728
- /** 如果存在,返回设备id */
1729
- devId?: string;
1730
- };
1731
- }