mini_program_gizwits_sdk 3.4.9 → 3.4.13

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/README.md CHANGED
@@ -44,13 +44,13 @@ yarn add mini_program_gizwits_sdk
44
44
 
45
45
  > 采用小程序代码片段,安装新版小程序开发工具,点击链接即可打开
46
46
 
47
- ### 蓝牙和 softAp 配网
47
+ ### 蓝牙配网
48
48
 
49
- [点击打开微信开发者工具](https://developers.weixin.qq.com/s/UQI8fpm87jDI)
49
+ [点击打开微信开发者工具](https://developers.weixin.qq.com/s/Wk0aZlmg7jOR)
50
50
 
51
51
  ### 设备控制
52
52
 
53
- [点击打开微信开发者工具](https://developers.weixin.qq.com/s/NZI5gpmX7qD1)
53
+ [点击打开微信开发者工具](https://developers.weixin.qq.com/s/Kh0CMlmq77OA)
54
54
 
55
55
  ## 🏍 初始化 Sdk
56
56
 
@@ -112,7 +112,7 @@ sdk.setLogLevel("debug")
112
112
 
113
113
  ### sdk.deviceSafetyRegister(Object object)
114
114
 
115
- 安全注册目标设备,否则无法发起设备绑定。返回值中可以拿到注册结果。
115
+ 安全注册目标设备,蓝牙设备绑定前,需要调用这个接口,否则无法发起设备绑定。返回值中可以拿到注册结果。
116
116
 
117
117
  #### 参数
118
118
 
@@ -202,17 +202,23 @@ this.gizSdk.addEventListener(
202
202
 
203
203
  ```ts
204
204
  interface IDevice {
205
- mac: string; // 设备mac
206
- productKey: string; // 机智云pk
207
- did?: string; // 云平台did
208
- name: string; // 设备名称
209
- isBind: boolean; // 是否绑定
210
- bleDeviceID?: string; // 本地蓝牙设备id
205
+ mac: string;
206
+ productKey: string;
207
+ did: string;
208
+ bleWorkStatus?: number; // 0 默认状态 1 配网状态
209
+ name: string;
210
+ isBind: boolean;
211
+ rootDeviceId?: string;
212
+ bleDeviceID?: string;
213
+ remark?: string;
214
+ passcode?: string;
215
+ connectType: TConnectType;
211
216
  isOnline: boolean; // 代表大循环在线
212
217
  isLanOnline: boolean; // 代表小循环在线
213
218
  isBleOnline: boolean; // 代表蓝牙在线
214
- bleWorkStatus?: number; // 蓝牙设备状态 0 默认状态 1 配网状态
215
- connectType: TConnectType; // 当前连接类型
219
+ host?: string;
220
+ wss_port?: number;
221
+ ctime?: number;
216
222
  }
217
223
  ```
218
224
 
@@ -252,15 +258,17 @@ interface IError {
252
258
  ```javascript
253
259
  import GizwitsSdk, { errorCode } from 'mini_program_gizwits_sdk';
254
260
 
255
- const sdk = new GizwitsSdk({
256
- appID: '8f187b1deb9e44b6aa1374b8f13bccb1',
257
- appSecret: 'd73fa6d6d7c04d37b6b2cc13a18a9f37',
258
- specialProductKeys: ['00e7e327afa74a3d8ff1cc190bad78c0'],
259
- specialProductKeySecrets: ['aa3d301fa291466fbed20e4204609abc'],
260
- token: token,
261
- uid: uid,
262
- cloudServiceInfo: null,
263
- });
261
+ const configData = {
262
+ appID: "xxx",
263
+ appSecret: "xxx",
264
+ productInfo: [
265
+ {
266
+ productKey: "xxx",
267
+ productSecret: "xxx",
268
+ },
269
+ ],
270
+ };
271
+ const sdk = new GizwitsSdk(configData);
264
272
 
265
273
  try {
266
274
  const data = await sdk.setDeviceOnboardingDeploy({