mini_program_gizwits_sdk 3.7.0 → 3.7.1-beta.1
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 +27 -0
- package/dist/index.js +5 -5
- package/dist/src/crc/calculators/crc16modbus.d.ts +2 -0
- package/dist/src/crc/calculators/crc32.d.ts +2 -0
- package/dist/src/crc/crc16modbus.d.ts +7 -0
- package/dist/src/crc/crc32.d.ts +7 -0
- package/dist/src/crc/create_buffer.d.ts +4 -0
- package/dist/src/crc/define_crc.d.ts +7 -0
- package/dist/src/crc/index.d.ts +19 -0
- package/dist/src/crc/types.d.ts +10 -0
- package/dist/src/handler/EventListener.d.ts +9 -0
- package/dist/src/handler/ble.d.ts +128 -0
- package/dist/src/handler/lan.d.ts +78 -0
- package/dist/src/handler/socket.d.ts +161 -0
- package/dist/src/protocol/Bind.d.ts +7 -0
- package/dist/src/protocol/DeviceInfo.d.ts +11 -0
- package/dist/src/protocol/DiscoverUDP.d.ts +17 -0
- package/dist/src/protocol/GetDeviceStatus.d.ts +5 -0
- package/dist/src/protocol/Login.d.ts +12 -0
- package/dist/src/protocol/Ntp.d.ts +5 -0
- package/dist/src/protocol/OTA/AwaitNoti.d.ts +7 -0
- package/dist/src/protocol/OTA/CheckCanOTA.d.ts +10 -0
- package/dist/src/protocol/OTA/OTAPackPackage.d.ts +8 -0
- package/dist/src/protocol/OTA/OtaComplete.d.ts +8 -0
- package/dist/src/protocol/OTA/PreOTA.d.ts +11 -0
- package/dist/src/protocol/OTA/ResetPosition.d.ts +6 -0
- package/dist/src/protocol/OffLineData.d.ts +23 -0
- package/dist/src/protocol/ProtocolBase.d.ts +12 -0
- package/dist/src/protocol/Reset.d.ts +8 -0
- package/dist/src/protocol/SetReset.d.ts +7 -0
- package/dist/src/protocol/WifiConfig.d.ts +11 -0
- package/dist/src/protocol/dataPoint.d.ts +34 -0
- package/dist/src/protocol/tool.d.ts +14 -0
- package/dist/src/sdk.d.ts +146 -0
- package/dist/src/services/devices.d.ts +52 -0
- package/dist/src/services/login.d.ts +4 -0
- package/dist/src/services/monitor.d.ts +12 -0
- package/dist/src/services/ota.d.ts +7 -0
- package/dist/src/services/tool.d.ts +4 -0
- package/dist/src/services/uploadP0.d.ts +14 -0
- package/dist/src/types/index.d.ts +398 -0
- package/dist/src/utils/GizLog.d.ts +18 -0
- package/dist/src/utils/bleConfigLog.d.ts +11 -0
- package/dist/src/utils/connectedBssid.d.ts +6 -0
- package/dist/src/utils/errorCode.d.ts +3 -0
- package/dist/src/utils/globalData.d.ts +2 -0
- package/dist/src/utils/openApiRequest.d.ts +27 -0
- package/dist/src/utils/productConfigFileManage.d.ts +15 -0
- package/dist/src/utils/randomCode.d.ts +3 -0
- package/dist/src/utils/request.d.ts +1 -0
- package/dist/src/utils/sentry.d.ts +2 -0
- package/dist/src/utils/sleep.d.ts +2 -0
- package/dist/src/utils/utils.d.ts +55 -0
- package/dist/src/utils/wechatApi.d.ts +23 -0
- package/dist/src/utils/wifiConfigLogReport.d.ts +28 -0
- package/dist/src/wifiConfig/ConfigBase.d.ts +30 -0
- package/dist/src/wifiConfig/ap.d.ts +11 -0
- package/dist/src/wifiConfig/ble.d.ts +43 -0
- package/dist/src/wifiConfig/nfc/disposeData.d.ts +2 -0
- package/dist/src/wifiConfig/nfc/formatData.d.ts +3 -0
- package/dist/src/wifiConfig/nfc/formatSSID.d.ts +6 -0
- package/dist/src/wifiConfig/nfc/index.d.ts +22 -0
- package/dist/src/wifiConfig/nfc/isIncludedCH.d.ts +1 -0
- package/dist/src/wifiConfig/nfc/nfcAConnect.d.ts +6 -0
- package/dist/src/wifiConfig/nfc/nfcATransceive.d.ts +5 -0
- package/dist/src/wifiConfig/nfc/ssIDToASC.d.ts +1 -0
- package/dist/src/wifiConfig/nfc/stringToGbk.d.ts +1 -0
- package/dist/src/wifiConfig/nfc/transceive.wx.d.ts +2 -0
- package/dist/src/wifiConfig/nfc/types.d.ts +15 -0
- package/docs/ble-bssid.md +38 -0
- package/package.json +5 -2
- package/.istanbul.yml +0 -4
- package/.travis.yml +0 -23
- package/.vscode/launch.json +0 -19
- package/.vscode/settings.json +0 -3
- package/yarn-error.log +0 -6901
package/README.md
CHANGED
|
@@ -48,6 +48,33 @@ yarn add mini_program_gizwits_sdk
|
|
|
48
48
|
|
|
49
49
|
[点击打开微信开发者工具](https://developers.weixin.qq.com/s/Wk0aZlmg7jOR)
|
|
50
50
|
|
|
51
|
+
#### 配网过程回调(3.7.1-beta.1)
|
|
52
|
+
|
|
53
|
+
`setDeviceOnboardingDeploy({ ..., eventCallBack })` 保留原有事件,并新增
|
|
54
|
+
`GIZ_CONFIG_PROGRESS`。应用可收集事件,在配网结束时统一上报。
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
const processDetails: ConfigEventData[] = [];
|
|
58
|
+
const result = await sdk.setDeviceOnboardingDeploy({
|
|
59
|
+
ssid, password, mode: 3, timeout: 60,
|
|
60
|
+
eventCallBack: event => processDetails.push(event),
|
|
61
|
+
});
|
|
62
|
+
// 应用侧结束事件:monitorTarget.sdkResult.msg = JSON.stringify({ processDetails })
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
过程事件包含 `stage`、`status`、毫秒时间戳 `timestamp` 和本次配网累计耗时
|
|
66
|
+
`elapsedMs`。阶段包括 `discover`、`connect`、`services`、`characteristics`、
|
|
67
|
+
`notify`、`protocol`、`write`、`ack`、`cloud_search`、`bind`、`complete`。
|
|
68
|
+
状态包括 `start`、`success`、`failure`、`timeout`、`retry`、`ignored`、`cancelled`。
|
|
69
|
+
按实际结果附带 `reason`、`errorCode`、`errno`、写入次数 `attempt` 和包头元数据,
|
|
70
|
+
不附带密码、原始数据包或任意错误对象。`attempt: 0` 表示尚未写入。
|
|
71
|
+
|
|
72
|
+
`GIZ_CONFIG_SEND_SUCCESS` 仅在蓝牙写入调用成功后触发;
|
|
73
|
+
`GIZ_CONFIG_RECV_SUCCESS` 仅在同一设备的回复通过配网 ACK 校验后触发。
|
|
74
|
+
ACK 不代表设备已经联网:云端发现设备由 `cloud_search/success` 和原有
|
|
75
|
+
`GIZ_CONFIG_SUCCESS` 表示。无效或否定回复会产生 `ack/ignored` 并保留命令码、状态。
|
|
76
|
+
阶段失败可能重试,最终结果仍以配网方法返回值为准。应用回调抛错不会中断配网。
|
|
77
|
+
|
|
51
78
|
### 设备控制
|
|
52
79
|
|
|
53
80
|
[点击打开微信开发者工具](https://developers.weixin.qq.com/s/Kh0CMlmq77OA)
|