mini_program_gizwits_sdk 3.6.37-cozev5 → 3.6.38-cozev5

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 (3) hide show
  1. package/README.md +400 -172
  2. package/dist/index.js +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,6 +12,7 @@
12
12
  ```txt
13
13
  https://api.gizwits.com
14
14
  https://site.gizwits.com
15
+ https://agent.gizwitsapi.com
15
16
  ```
16
17
 
17
18
  - socket 合法域名
@@ -72,8 +73,6 @@ export default class Index extends Component {
72
73
  productSecret: 'productSecret',
73
74
  },
74
75
  ],
75
- uid: 'giz_uid', // 必填
76
- token: 'giz_token', // 必填
77
76
  });
78
77
  }
79
78
 
@@ -86,10 +85,127 @@ export default class Index extends Component {
86
85
  ## 📋 日志
87
86
  sdk.setLogLevel("debug")
88
87
 
88
+ ## 用户相关
89
+
90
+ SDK 提供了两种登录方式:匿名登录和微信登录。
91
+
92
+ ### 匿名登录
93
+ ```typescript
94
+ // 使用 唯一ID 进行匿名登录
95
+ // 适用于 已经有业务后台的场景
96
+ const result = await sdk.login(openID);
97
+ if (result.success) {
98
+ // 登录成功,可以获取到 token 和 uid
99
+ const { token, uid } = result.data;
100
+ }
101
+ ```
102
+
103
+ ### 微信登录
104
+ ```typescript
105
+ // 使用微信登录 直接登录到 Gizwits
106
+ const result = await sdk.wxLogin();
107
+ if (result.success) {
108
+ // 登录成功,返回数据包含:
109
+ // - token: 访问令牌
110
+ // - uid: 用户ID
111
+ // - expire_at: 令牌过期时间
112
+ const { token, uid, expire_at } = result.data;
113
+ } else {
114
+ // 登录失败
115
+ console.error(result.message);
116
+ }
117
+ ```
118
+
119
+ ### 登录结果说明
120
+
121
+ 登录成功后会:
122
+ 1. 自动保存 token 和 uid 到全局数据
123
+ 2. 更新 WebSocket 连接的认证信息
124
+ 3. 返回登录结果,包含:
125
+ - token: 访问令牌
126
+ - uid: 用户ID
127
+ - expire_at: 令牌过期时间(仅微信登录返回)
128
+
129
+ #### 注意事项
130
+ 1. 登录是使用其他功能的前提,建议在初始化 SDK 后立即进行登录
131
+ 2. 微信登录需要确保小程序已经获取了用户授权
132
+ 3. 登录成功后,SDK 会自动处理 token 的存储和更新
133
+
134
+ #### 错误处理
135
+ ```typescript
136
+ try {
137
+ const result = await sdk.wxLogin();
138
+ if (!result.success) {
139
+ // 处理登录失败
140
+ console.error('登录失败:', result.message);
141
+ }
142
+ } catch (error) {
143
+ // 处理异常
144
+ console.error('登录异常:', error);
145
+ }
146
+ ```
147
+
89
148
  ## ota
90
149
 
91
- 检查更新
150
+ ### 获取设备当前版本
151
+
152
+ 获取设备的软硬件版本信息。
153
+
154
+ ```typescript
155
+ const result = await sdk.getDeviceVersion(deviceId);
156
+ if (result.success) {
157
+ // 获取成功
158
+ const { soft_version, hard_version } = result.data;
159
+ console.log('软件版本:', soft_version);
160
+ console.log('硬件版本:', hard_version);
161
+ } else {
162
+ // 获取失败
163
+ console.error('获取版本失败:', result.err);
164
+ }
92
165
  ```
166
+
167
+ #### 参数说明
168
+
169
+ | 参数 | 类型 | 必填 | 说明 |
170
+ |------|------|------|------|
171
+ | deviceId | string | 是 | 设备 ID |
172
+
173
+ #### 返回值说明
174
+
175
+ | 字段 | 类型 | 说明 |
176
+ |------|------|------|
177
+ | soft_version | string | 软件版本号 |
178
+ | hard_version | string | 硬件版本号 |
179
+
180
+ #### 注意事项
181
+
182
+ 1. 设备必须已经绑定
183
+ 2. 设备必须在线
184
+ 3. 版本号格式通常为 x.y.z 的形式
185
+
186
+ #### 错误处理
187
+
188
+ ```typescript
189
+ try {
190
+ const result = await sdk.getDeviceVersion(deviceId);
191
+
192
+ if (!result.success) {
193
+ // 处理获取失败
194
+ console.error('获取版本失败:', result.err);
195
+ return;
196
+ }
197
+
198
+ // 获取成功,可以开始使用版本信息
199
+ const { soft_version, hard_version } = result.data;
200
+
201
+ } catch (error) {
202
+ // 处理异常
203
+ console.error('获取版本异常:', error);
204
+ }
205
+ ```
206
+
207
+ ### 检查更新
208
+ ```typescript
93
209
  const result = await sdk.checkAvailableUpdates(deviceInfo.id, deviceInfo.soft_version);
94
210
  console.log('resultresultresult', result)
95
211
  if (result.success && result.data) {
@@ -104,103 +220,321 @@ if (result.success && result.data) {
104
220
  }
105
221
  ```
106
222
 
107
- 开始更新
108
-
109
- 固件暂不支持进度上报,所以得本地倒计时,超时提示失败
110
- ```
223
+ ### 开始更新
224
+ ```typescript
111
225
  const sdk = getGlobalData('gizSdk');
112
226
  const result = await sdk.startUpdate(deviceInfo.id);
113
227
  console.log('resultresultresult', result)
114
228
  ```
115
229
 
116
- ## 📖 API
230
+ ### 查询进度
231
+
232
+ 获取设备 OTA 更新的当前进度。
233
+
234
+ ```typescript
235
+ const result = await sdk.getOtaStatus(deviceId);
236
+ if (result.success) {
237
+ if (result.data !== null) {
238
+ // 有进度信息,显示进度
239
+ console.log('OTA 更新进度:', result.data);
240
+ } else {
241
+ // 没有进度信息
242
+ console.log('暂无 OTA 更新进度');
243
+ }
244
+ } else {
245
+ // 获取进度失败
246
+ console.error('获取 OTA 进度失败:', result.err);
247
+ }
248
+ ```
249
+
250
+ #### 参数说明
251
+
252
+ | 参数 | 类型 | 必填 | 说明 |
253
+ |------|------|------|------|
254
+ | deviceId | string | 是 | 设备 ID |
255
+
256
+ #### 返回值说明
257
+
258
+ | 字段 | 类型 | 说明 |
259
+ |------|------|------|
260
+ | data | number \| null | 更新进度百分比(0-100),如果为 null 表示暂无进度信息 |
261
+
262
+ #### 注意事项
117
263
 
118
- 小程序相关 API。
264
+ 1. 设备必须已经绑定
265
+ 2. 设备必须在线
266
+ 3. 只有在进行 OTA 更新时才会返回进度信息
267
+ 4. 进度信息有 1 分钟的有效期,超过 1 分钟未更新则返回 null
119
268
 
120
- ### sdk.initBle()
269
+ #### 错误处理
270
+
271
+ ```typescript
272
+ try {
273
+ const result = await sdk.getOtaStatus(deviceId);
274
+
275
+ if (!result.success) {
276
+ // 处理获取失败
277
+ console.error('获取 OTA 进度失败:', result.err);
278
+ return;
279
+ }
280
+
281
+ // 获取成功,处理进度信息
282
+ if (result.data !== null) {
283
+ // 有进度信息
284
+ console.log('OTA 更新进度:', result.data);
285
+ } else {
286
+ // 没有进度信息
287
+ console.log('暂无 OTA 更新进度');
288
+ }
289
+
290
+ } catch (error) {
291
+ // 处理异常
292
+ console.error('获取 OTA 进度异常:', error);
293
+ }
294
+ ```
295
+
296
+ ## 蓝牙相关
297
+
298
+ ### 初始化蓝牙
121
299
 
122
300
  初始化 sdk 蓝牙能力。使用其他`BLE API`前**必须**进行初始化。
123
301
 
124
- ### sdk.scanBleDevice(delay?:number, services?: string[])
302
+ ```typescript
303
+ sdk.initBle()
304
+ ```
125
305
 
306
+ ### 搜索蓝牙
126
307
  搜索蓝牙设备。搜索到的蓝牙设备会被 [onScanListChange](#onScanListChange) 事件监听。
127
308
 
128
- #### 参数
309
+ ```
310
+ // 参数
311
+ // - delay: 超时时间。
312
+ // - services: 过滤services的条件,不传默认 ['ABF8', 'ABF0', 'F0AB', 'F8AB']
129
313
 
130
- - delay: 超时时间。
131
- - services: 过滤services的条件,不传默认 ['ABF8', 'ABF0', 'F0AB', 'F8AB']
314
+ sdk.scanBleDevice(delay?:number, services?: string[])
315
+ ```
132
316
 
133
- ### sdk.startAutoScan(services?: string[])
317
+ ### 自动搜索
318
+
319
+ 间隔 3s 搜索一次
134
320
 
135
321
  间隔自动搜索蓝牙设备 [onScanListChange](#onScanListChange) 事件监听。
136
322
 
137
- #### 参数
138
- - services: 过滤services的条件,不传默认 ['ABF8', 'ABF0', 'F0AB', 'F8AB']
323
+ ```typescript
324
+ // 参数
325
+ // - services: 过滤services的条件,不传默认 ['ABF8', 'ABF0', 'F0AB', 'F8AB']
326
+ sdk.startAutoScan(services?: string[])
327
+ ```
139
328
 
140
- ### sdk.deviceSafetyRegister(Object object)
329
+ ## 设备管理
141
330
 
142
- 安全注册目标设备,蓝牙设备绑定前,需要调用这个接口,否则无法发起设备绑定。返回值中可以拿到注册结果。
143
331
 
144
- #### 参数
332
+ ### 获取设备列表
145
333
 
146
- - Object object
334
+ 刷新设备列表(同时也会在 GizDeviceListNotifications 事件里推送)
147
335
 
148
- | 属性 | 类型 | 描述 |
149
- | ---------- | ------ | ------------------ |
150
- | mac | string | 待注册设备 mac |
151
- | productKey | string | 待注册设备所属产品 |
336
+ ```typescript
337
+ const data = await sdk.getDevices()
338
+ console.log(data)
339
+ ```
152
340
 
153
- ### sdk.bindRemoteDevice(Object object)
341
+ ### 开始配网
342
+
343
+ 配网是将设备连接到 WiFi 网络的过程。SDK 支持多种配网方式:SoftAP、BLE 和 NFC(仅安卓)。
344
+
345
+ ```typescript
346
+ const result = await sdk.setDeviceOnboardingDeploy({
347
+ ssid: 'wifi_ssid', // WiFi 名称
348
+ password: 'wifi_password', // WiFi 密码
349
+ mode: 3, // 配网模式:0-SoftAP, 3-BLE, 5-NFC
350
+ timeout: 60, // 配网超时时间(秒)
351
+ productKey: 'product_key', // 产品 Key
352
+ isBind: true, // 是否自动绑定设备
353
+ softAPSSIDPrefix: 'XPG-GAgent-', // SoftAP 模式下的设备热点前缀,蓝牙配网模式下的蓝牙设备名称
354
+ eventCallBack: (event) => { // 配网过程事件回调
355
+ console.log('配网事件:', event);
356
+ }
357
+ });
154
358
 
155
- 绑定远程设备,否则无法发起设备订阅。返回值中可以拿到绑定结果。
359
+ if (result.success) {
360
+ // 配网成功,返回配网成功的设备列表
361
+ const devices = result.data;
362
+ console.log('配网成功:', devices);
363
+ } else {
364
+ // 配网失败
365
+ console.error('配网失败:', result.err);
366
+ }
367
+ ```
156
368
 
157
- ### sdk.unbindDevice({devices: [IDevice]})
369
+ #### 参数说明
158
370
 
159
- 解绑设备
371
+ | 参数 | 类型 | 必填 | 说明 |
372
+ |------|------|------|------|
373
+ | ssid | string | 是 | WiFi 网络名称 |
374
+ | password | string | 是 | WiFi 网络密码 |
375
+ | mode | number | 是 | 配网模式:0-SoftAP, 3-BLE, 5-NFC |
376
+ | timeout | number | 否 | 配网超时时间,单位秒,默认 60 |
377
+ | productKey | string | 否 | 产品 Key |
378
+ | isBind | boolean | 否 | 是否自动绑定设备,默认 true |
379
+ | softAPSSIDPrefix | string | 否 | SoftAP 模式下的设备热点前缀 |
380
+ | eventCallBack | function | 否 | 配网过程事件回调 |
160
381
 
161
- #### 参数
382
+ #### 配网模式说明
162
383
 
163
- - Object object
384
+ 1. **SoftAP 模式 (mode: 0)**
385
+ - 设备会创建一个 WiFi 热点
386
+ - 手机需要先连接到设备热点
387
+ - 适用于大多数 WiFi 设备
388
+
389
+ 2. **BLE 模式 (mode: 3)**
390
+ - 通过蓝牙传输配网信息
391
+ - 设备需要支持蓝牙功能
392
+ - 适用于支持蓝牙的 WiFi 设备
393
+
394
+ 3. **NFC 模式 (mode: 5)**
395
+ - 通过 NFC 传输配网信息
396
+ - 仅支持安卓设备
397
+ - 设备需要支持 NFC 功能
398
+
399
+ #### 注意事项
400
+
401
+ 1. 配网前确保设备处于配网状态
402
+ 2. 确保 WiFi 密码正确
403
+ 3. 配网过程中不要切换网络或关闭蓝牙
404
+ 4. 如果配网超时,可以调用 `stopDeviceOnboardingDeploy` 停止配网
405
+ 5. 配网成功后,设备会自动连接到指定的 WiFi 网络
406
+
407
+ #### 错误处理
408
+
409
+ ```typescript
410
+ try {
411
+ const result = await sdk.setDeviceOnboardingDeploy({
412
+ ssid: 'wifi_ssid',
413
+ password: 'wifi_password',
414
+ mode: 3
415
+ });
416
+
417
+ if (!result.success) {
418
+ // 处理配网失败
419
+ console.error('配网失败:', result.err);
420
+ return;
421
+ }
422
+
423
+ // 配网成功,可以开始使用设备
424
+ const devices = result.data;
425
+
426
+ } catch (error) {
427
+ // 处理异常
428
+ console.error('配网异常:', error);
429
+ }
430
+ ```
431
+
432
+ ### 停止配网
433
+
434
+ 取消当前正在进行的配网过程。
435
+
436
+ ```typescript
437
+ sdk.stopDeviceOnboardingDeploy();
438
+ ```
439
+
440
+ ### 绑定设备
441
+
442
+ 绑定设备到机智云平台,绑定成功后才能进行设备控制和数据交互。
443
+
444
+ ```typescript
445
+ const result = await sdk.bindRemoteDevice({
446
+ mac: 'device_mac', // 设备 MAC 地址
447
+ productKey: 'product_key', // 产品 Key
448
+ alias: 'device_name', // 可选,设备别名
449
+ beOwner: true // 可选,是否作为设备所有者
450
+ });
451
+
452
+ if (result.success) {
453
+ // 绑定成功
454
+ const device = result.data;
455
+ console.log('设备绑定成功:', device);
456
+ } else {
457
+ // 绑定失败
458
+ console.error('设备绑定失败:', result.err);
459
+ }
460
+ ```
461
+
462
+ #### 参数说明
463
+
464
+ | 参数 | 类型 | 必填 | 说明 |
465
+ |------|------|------|------|
466
+ | mac | string | 是 | 设备的 MAC 地址 |
467
+ | productKey | string | 是 | 产品 Key,用于标识设备类型 |
468
+ | alias | string | 否 | 设备别名,用于自定义设备名称 |
469
+ | beOwner | boolean | 否 | 是否作为设备所有者,默认为 true |
470
+
471
+ #### 注意事项
472
+
473
+ 1. 绑定前需要确保设备已经注册到机智云平台
474
+ 2. 绑定成功后,设备会自动添加到设备列表中
475
+ 3. 一个设备只能被一个用户绑定为所有者,但可以被多个用户共享
476
+
477
+ #### 错误处理
478
+
479
+ ```typescript
480
+ try {
481
+ const result = await sdk.bindRemoteDevice({
482
+ mac: 'device_mac',
483
+ productKey: 'product_key'
484
+ });
485
+
486
+ if (!result.success) {
487
+ // 处理绑定失败
488
+ console.error('绑定失败:', result.err);
489
+ return;
490
+ }
491
+
492
+ // 绑定成功,可以开始使用设备
493
+ const device = result.data;
494
+
495
+ } catch (error) {
496
+ // 处理异常
497
+ console.error('绑定异常:', error);
498
+ }
499
+ ```
500
+
501
+ ### 解绑设备
502
+
503
+ ```typescript
504
+ sdk.unbindDevice({devices: [{mac: string, productKey: string}]})
505
+ ```
506
+
507
+ #### 参数
164
508
 
165
509
  | 属性 | 类型 | 描述 |
166
510
  | ---------- | ------ | ------------------ |
167
511
  | mac | string | 待绑定设备 mac |
168
512
  | productKey | string | 待绑定设备所属产品 |
169
513
 
170
- ### sdk.subscribe(device:[IDevice](#IDevice),connectType:[TConnectType](#TConnectType))
171
-
172
- 订阅目标设备,订阅成功后可控制设备。返回值中可以拿到订阅结果。
173
-
174
- ### sdk.getDeviceStatus(device:[IDevice](#IDevice), attrNames?: string[])
514
+ ### 获取设备状态
175
515
 
176
516
  查询目标设备当前状态,attrNames 不传则查询所有数据
177
517
 
178
- ### sdk.write(device:[IDevice](#IDevice),cmd:{[key]:value})
518
+ ```typescript
519
+ sdk.getDeviceStatus(device:[IDevice], attrNames?: string[])
520
+ ```
521
+
522
+ ### 下发控制指令
179
523
 
180
524
  向目标设备发送指令。 其中`key`为数据点名称,value 为数据点的值。
181
525
 
182
- ### sdk.unSubscribe(device:[IDevice](#IDevice))
183
-
184
- 取消订阅目标设备。蓝牙设备会断开连接。返回值中可拿到取消订阅结果。
185
526
 
186
- ### sdk.getDevices()
187
- 刷新设备列表(同时也会在 GizDeviceListNotifications 事件里推送)
188
- ```ts
189
- const data = await sdk.getDevices()
190
- console.log(data)
527
+ ```typescript
528
+ sdk.write(device:[IDevice])
191
529
  ```
192
530
 
193
- ### sdk.stopDeviceOnboardingDeploy
194
- 停止配网
195
-
196
- ### sdk.setDeviceOnboardingDeploy
197
- 开始配网
198
-
199
- 详细参数请查阅类型定义
531
+ ## 事件监听
200
532
 
201
- ### sdk.addEventListener(type,listener)
533
+ ### 注册事件监听
202
534
 
203
- #### 概览
535
+ ```typescript
536
+ sdk.addEventListener(type,listener)
537
+ ```
204
538
 
205
539
  | 事件种类 type | 回调参数类型 | 回调参数描述 |
206
540
  | --------------------------- | ------------------------------------- | -------------------- |
@@ -210,7 +544,7 @@ console.log(data)
210
544
  | onScanListChange | [IDevice[]](#IDevice) | 扫描设备列表变更通知 |
211
545
  | onBleHandleError | [IError](#IError) | ble 错误通知 |
212
546
 
213
- - <a id="GizDeviceListNotifications"> GizDeviceListNotifications </a>
547
+ #### GizDeviceListNotifications
214
548
 
215
549
  ```ts
216
550
  this.gizSdk.addEventListener('GizDeviceListNotifications', (deviceList: IDevice[]) => {
@@ -218,7 +552,7 @@ this.gizSdk.addEventListener('GizDeviceListNotifications', (deviceList: IDevice[
218
552
  });
219
553
  ```
220
554
 
221
- - <a id="GizDeviceStatusNotifications"> GizDeviceStatusNotifications </a>
555
+ #### GizDeviceStatusNotifications
222
556
 
223
557
  ```ts
224
558
  this.gizSdk.addEventListener('GizDeviceStatusNotifications', (e: IDeviceStatusNoti) => {
@@ -226,7 +560,9 @@ this.gizSdk.addEventListener('GizDeviceStatusNotifications', (e: IDeviceStatusNo
226
560
  });
227
561
  ```
228
562
 
229
- - <a id="onScanListChange">onScanListChange</a>
563
+ #### onScanListChange
564
+
565
+ 蓝牙扫描的设备回调
230
566
 
231
567
  ```ts
232
568
  const initBle = () => {
@@ -247,7 +583,7 @@ initBle();
247
583
  scanBle();
248
584
  ```
249
585
 
250
- - <a id="GizDeviceAttrsNotifications">GizDeviceAttrsNotifications</a>
586
+ #### GizDeviceAttrsNotifications
251
587
 
252
588
  监听设备上报数据。
253
589
 
@@ -260,9 +596,9 @@ this.gizSdk.addEventListener(
260
596
  );
261
597
  ```
262
598
 
263
- #### 类型定义
599
+ ## 类型定义
264
600
 
265
- - <a id="IDevice">IDevice</a>
601
+ ### IDevice
266
602
 
267
603
  ```ts
268
604
  interface IDevice {
@@ -280,14 +616,14 @@ interface IDevice {
280
616
  }
281
617
  ```
282
618
 
283
- - <a id="TConnectType">TConnectType</a>
619
+ ### TConnectType
284
620
 
285
621
  ```ts
286
622
  type TConnectType = 'BLE' | 'BLE_BROADCAST' | 'LAN' | 'WAN' | 'NONE';
287
623
  }
288
624
  ```
289
625
 
290
- - <a id="IDeviceAttrsNoti">IDeviceAttrsNoti</a>
626
+ ### IDeviceAttrsNoti
291
627
 
292
628
  ```ts
293
629
  interface IDeviceAttrsNoti {
@@ -296,7 +632,7 @@ interface IDeviceAttrsNoti {
296
632
  }
297
633
  ```
298
634
 
299
- - <a id="IDeviceStatusNoti">IDeviceStatusNoti</a>
635
+ ### IDeviceStatusNoti
300
636
 
301
637
  ```ts
302
638
  interface IDeviceStatusNoti {
@@ -305,7 +641,7 @@ interface IDeviceStatusNoti {
305
641
  }
306
642
  ```
307
643
 
308
- - <a id="TConnectType">TConnectType</a>
644
+ ### TConnectType
309
645
 
310
646
  ```ts
311
647
  type TConnectType = 'BLE' | 'BLE_BROADCAST' | 'LAN' | 'WAN' | 'NONE';
@@ -319,111 +655,3 @@ interface IError {
319
655
  errorMessage?: string; // 错误信息
320
656
  }
321
657
  ```
322
-
323
- ### sdk.removeEventListener(type:K,func:TListenerType[K])
324
-
325
- 销毁事件监听。
326
-
327
- # 配网相关
328
-
329
- ## 使用方法
330
-
331
- ```javascript
332
- import GizwitsSdk, { errorCode } from 'mini_program_gizwits_sdk';
333
-
334
- const configData = {
335
- appID: "xxx",
336
- appSecret: "xxx",
337
- productInfo: [
338
- {
339
- productKey: "xxx",
340
- productSecret: "xxx",
341
- },
342
- ],
343
- };
344
- const sdk = new GizwitsSdk(configData);
345
-
346
- try {
347
- const data = await sdk.setDeviceOnboardingDeploy({
348
- ssid: SSID,
349
- password: password,
350
- mode: 3, // 蓝牙配网
351
- // mode:0 // softAp
352
- timeout: 60,
353
- softAPSSIDPrefix: 'XPG-GAgent-',
354
- });
355
- } catch (error) {
356
- console.log(error);
357
- }
358
- ```
359
-
360
- 其中`data`代表配网成功的设备。
361
-
362
- 如果失败的话会返回数据
363
-
364
- ```javascript
365
- {
366
- success: false,
367
- err: {
368
- errorCode: 'code',
369
- errorMessage: 'message',
370
- }
371
- }
372
- ```
373
-
374
- ```ts
375
- const errorCode: IErrorCode = {
376
- GIZ_OPENAPI_DEVICE_NOT_BOUND: {
377
- errorCode: 9017,
378
- errorMessage: 'not bind',
379
- },
380
- GIZ_SDK_HTTP_REQUEST_FAILED: {
381
- errorCode: 8099,
382
- errorMessage: '网络请求失败',
383
- },
384
- GIZ_SDK_SDK_NOT_INITIALIZED: {
385
- errorCode: 8300,
386
- errorMessage: 'not init',
387
- },
388
- CONFIG_TIME_OUT: {
389
- errorCode: 8023,
390
- errorMessage: 'Config Timeout',
391
- },
392
- WECHAT_ERROR: {
393
- errorCode: 10000,
394
- errorMessage: 'wechat error',
395
- },
396
- GIZ_SDK_ONBOARDING_STOPPED: {
397
- errorCode: 8318,
398
- errorMessage: '配网中断',
399
- },
400
- GIZ_SDK_DEVICE_CONFIG_IS_RUNNING: {
401
- errorCode: 8022,
402
- errorMessage: '配置正在进行中',
403
- },
404
- GIZ_OPENAPI_TOKEN_INVALID: {
405
- errorCode: 9004,
406
- errorMessage: 'token 失效',
407
- },
408
- GIZ_SDK_BIND_DEVICE_FAILED: {
409
- errorCode: 8039,
410
- errorMessage: '设备绑定失败',
411
- },
412
- GIZ_SDK_BLE_BLUETOOTH_FUNCTION_NOT_TURNED_ON: {
413
- errorCode: 8281,
414
- errorMessage: '蓝牙未启用',
415
- },
416
- GIZ_SDK_OTHERWISE: {
417
- errorCode: 8100,
418
- errorMessage: '',
419
- },
420
- GIZ_SDK_DEVICE_NOT_SUBSCRIBED: {
421
- errorCode: 8029,
422
- errorMessage: '设备还未订阅',
423
- },
424
- GIZ_SDK_PRODUCTKEY_NOT_IN_SPECIFY: {
425
- errorCode: 8250,
426
- errorMessage: '产品类型不在指定范围内',
427
- },
428
- };
429
- ```