mini_program_gizwits_sdk 3.4.1-kuka → 3.4.2
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 +28 -11
- package/dist/index.js +10 -3
- package/dist/src/GizLog.d.ts +1 -1
- 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 +3 -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 +11 -0
- package/dist/src/handler/ble.d.ts +62 -16
- package/dist/src/handler/lan.d.ts +5 -5
- package/dist/src/handler/socket.d.ts +3 -3
- package/dist/src/productConfigFileManage.d.ts +1 -1
- package/dist/src/protocol/DataPoint.d.ts +6 -5
- package/dist/src/protocol/DeviceInfo.d.ts +11 -0
- package/dist/src/protocol/{DiscoverUdp.d.ts → DiscoverUDP.d.ts} +1 -1
- 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/Reset.d.ts +8 -0
- package/dist/src/protocol/SetReset.d.ts +7 -0
- package/dist/src/protocol/tool.d.ts +4 -1
- package/dist/src/sdk.d.ts +47 -45
- package/dist/src/services/monitor.d.ts +11 -0
- package/dist/src/services/ota.d.ts +11 -0
- package/dist/src/utils.d.ts +5 -2
- package/dist/src/wechatApi.d.ts +5 -1
- package/dist/src/wifiConfig/ConfigBase.d.ts +2 -1
- package/dist/src/wifiConfig/ble.d.ts +2 -2
- 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/package.json +5 -5
- package/src/crc/calculators/crc16modbus.ts +36 -0
- package/src/crc/calculators/crc32.ts +47 -0
- package/src/crc/crc16modbus.ts +3 -0
- package/src/crc/crc32.ts +4 -0
- package/src/crc/create_buffer.ts +7 -0
- package/src/crc/define_crc.ts +9 -0
- package/src/crc/index.ts +10 -0
- package/src/crc/package.json +3 -0
- package/src/crc/types.ts +10 -0
- package/src/errorCode.ts +20 -1
- package/src/handler/ble.ts +743 -144
- package/src/handler/lan.ts +8 -8
- package/src/handler/socket.ts +8 -15
- package/src/openApiRequest.ts +4 -4
- package/src/protocol/DeviceInfo.ts +37 -0
- package/src/protocol/OTA/AwaitNoti.ts +16 -0
- package/src/protocol/OTA/CheckCanOTA.ts +24 -0
- package/src/protocol/OTA/OTAPackPackage.ts +37 -0
- package/src/protocol/OTA/OtaComplete.ts +17 -0
- package/src/protocol/OTA/PreOTA.ts +49 -0
- package/src/protocol/OTA/ResetPosition.ts +15 -0
- package/src/protocol/OffLineData.ts +4 -4
- package/src/protocol/Reset.ts +16 -0
- package/src/protocol/SetReset.ts +13 -0
- package/src/protocol/dataPoint.ts +1 -1
- package/src/protocol/tool.ts +30 -1
- package/src/randomCode.ts +1 -1
- package/src/sdk.ts +247 -83
- package/src/sentry.ts +1 -1
- package/src/services/devices.ts +93 -4
- package/src/services/monitor.ts +116 -0
- package/src/services/ota.ts +21 -0
- package/src/utils.ts +17 -1
- package/src/wechatApi.ts +34 -5
- package/src/wifiConfig/ConfigBase.ts +3 -1
- package/src/wifiConfig/ble.ts +21 -27
- package/src/wifiConfig/nfc/disposeData.ts +63 -0
- package/src/wifiConfig/nfc/formatData.ts +46 -0
- package/src/wifiConfig/nfc/formatSSID.ts +59 -0
- package/src/wifiConfig/nfc/index.ts +136 -0
- package/src/wifiConfig/nfc/isIncludedCH.ts +8 -0
- package/src/wifiConfig/nfc/nfcAConnect.ts +30 -0
- package/src/wifiConfig/nfc/nfcATransceive.ts +29 -0
- package/src/wifiConfig/nfc/ssIDToASC.ts +12 -0
- package/src/wifiConfig/nfc/stringToGbk.ts +51 -0
- package/src/wifiConfig/nfc/transceive.wx.ts +124 -0
- package/src/wifiConfig/nfc/types.ts +18 -0
- package/dist/src/aepApi/aepApiRequest.d.ts +0 -7
- package/dist/src/wifiConfig/ble_ailCloud.d.ts +0 -69
- package/src/aepApi/aepApiRequest.ts +0 -62
- package/src/wifiConfig/ble_ailCloud.ts +0 -586
- package/yarn-error.log +0 -3415
package/README.md
CHANGED
|
@@ -3,13 +3,6 @@
|
|
|
3
3
|
# 机智云小程序 SDK
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
## 🔴 破坏性更新
|
|
7
|
-
|
|
8
|
-
- 3.2.4(含)开始蓝牙广播包过滤增加了 `['ABF8', 'ABF0', 'F0AB', 'F8AB']` 四个过滤字段,为了兼容部分低端手机不过滤,长时间挂机会假死的问题。
|
|
9
|
-
- 乐鑫_0ESP32C3_0403000G 和 博流_00BL602L_0403000B 之后的版本都支持这个特性。
|
|
10
|
-
- 如果您使用的是更早期的固件,请联系我们。
|
|
11
|
-
|
|
12
|
-
|
|
13
6
|
## ⚠️ 重要
|
|
14
7
|
|
|
15
8
|
使用小程序 sdk 前,请在微信开发者后台-开发管理-开发设置-服务器域名添加以下请求地址。
|
|
@@ -28,6 +21,17 @@ wss://wxstage.gizwits.com
|
|
|
28
21
|
wss://wxm2m.gizwits.com
|
|
29
22
|
```
|
|
30
23
|
|
|
24
|
+
- 关于services
|
|
25
|
+
|
|
26
|
+
为了搜索效率,sdk会根据`services `过滤蓝牙设备。默认 ['ABF8', 'ABF0', 'F0AB', 'F8AB']。
|
|
27
|
+
如果有特殊情况,不想用`services `过滤设备,可以
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
sdk.scanBleDevice(3000, [])
|
|
31
|
+
sdk.startAutoScan([])
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
|
|
31
35
|
## 🔧 安装
|
|
32
36
|
|
|
33
37
|
```bash
|
|
@@ -82,9 +86,9 @@ export default class Index extends Component {
|
|
|
82
86
|
## 📋 日志
|
|
83
87
|
sdk.setLogLevel("debug")
|
|
84
88
|
|
|
85
|
-
## 📖
|
|
89
|
+
## 📖 API
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
小程序相关 API。
|
|
88
92
|
|
|
89
93
|
### sdk.initBle()
|
|
90
94
|
|
|
@@ -132,10 +136,14 @@ sdk.setLogLevel("debug")
|
|
|
132
136
|
| mac | string | 待绑定设备 mac |
|
|
133
137
|
| productKey | string | 待绑定设备所属产品 |
|
|
134
138
|
|
|
135
|
-
### sdk.subscribe(device:[IDevice](#IDevice)
|
|
139
|
+
### sdk.subscribe(device:[IDevice](#IDevice),connectType:[TConnectType](#TConnectType))
|
|
136
140
|
|
|
137
141
|
订阅目标设备,订阅成功后可控制设备。返回值中可以拿到订阅结果。
|
|
138
142
|
|
|
143
|
+
### sdk.getDeviceStatus(device:[IDevice](#IDevice), attrNames?: string[])
|
|
144
|
+
|
|
145
|
+
查询目标设备当前状态,attrNames 不传则查询所有数据
|
|
146
|
+
|
|
139
147
|
### sdk.write(device:[IDevice](#IDevice),cmd:{[key]:value})
|
|
140
148
|
|
|
141
149
|
向目标设备发送指令。 其中`key`为数据点名称,value 为数据点的值。
|
|
@@ -203,6 +211,15 @@ interface IDevice {
|
|
|
203
211
|
isOnline: boolean; // 代表大循环在线
|
|
204
212
|
isLanOnline: boolean; // 代表小循环在线
|
|
205
213
|
isBleOnline: boolean; // 代表蓝牙在线
|
|
214
|
+
bleWorkStatus?: number; // 蓝牙设备状态 0 默认状态 1 配网状态
|
|
215
|
+
connectType: TConnectType; // 当前连接类型
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- <a id="TConnectType">TConnectType</a>
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
type TConnectType = 'BLE' | 'BLE_BROADCAST' | 'LAN' | 'WAN' | 'NONE';
|
|
206
223
|
}
|
|
207
224
|
```
|
|
208
225
|
|
|
@@ -228,7 +245,7 @@ interface IError {
|
|
|
228
245
|
|
|
229
246
|
销毁事件监听。
|
|
230
247
|
|
|
231
|
-
#
|
|
248
|
+
# 配网相关
|
|
232
249
|
|
|
233
250
|
## 使用方法
|
|
234
251
|
|