mini_program_gizwits_sdk 3.0.5 → 3.0.6
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/package.json +5 -2
- package/src/wifiConfig/ble.ts +11 -8
package/package.json
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mini_program_gizwits_sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"description": "兼容模组重置,蓝牙卡死的情况",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "node_modules/mocha/bin/_mocha -r ts-node/register tests/**/*.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
8
8
|
"testMy": "node_modules/mocha/bin/_mocha -r ts-node/register tests/utils/productConfigFileManage.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
9
9
|
"testBle": "node_modules/mocha/bin/_mocha -r ts-node/register tests/bleConfig/sdk.ble.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
10
|
-
"build": "webpack",
|
|
10
|
+
"build": "rm -r ./dist && webpack",
|
|
11
|
+
"release": "release-it",
|
|
11
12
|
"cover": "istanbul cover node_modules/mocha/bin/_mocha -- -r ts-node/register tests/**/*.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
12
13
|
"coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls"
|
|
13
14
|
},
|
|
@@ -37,6 +38,8 @@
|
|
|
37
38
|
"typescript": "^3.8.3",
|
|
38
39
|
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
39
40
|
"webpack": "^4.42.1",
|
|
41
|
+
"@release-it/conventional-changelog": "^2.0.0",
|
|
42
|
+
"release-it": "^14.2.2",
|
|
40
43
|
"webpack-bundle-analyzer": "^4.5.0",
|
|
41
44
|
"webpack-cli": "^3.3.11"
|
|
42
45
|
},
|
package/src/wifiConfig/ble.ts
CHANGED
|
@@ -374,6 +374,7 @@ class BLEConfig extends ConfigBase {
|
|
|
374
374
|
}
|
|
375
375
|
const bleDevice = bleDevices.shift();
|
|
376
376
|
console.debug('GIZ_SDK: startConfigDevice, target device: ', bleDevice);
|
|
377
|
+
|
|
377
378
|
const success =
|
|
378
379
|
bleDevice &&
|
|
379
380
|
(await sendBLEConfigCmd({
|
|
@@ -395,16 +396,18 @@ class BLEConfig extends ConfigBase {
|
|
|
395
396
|
// 如果有一个设备发送成功,则不再发现新设备
|
|
396
397
|
console.debug("GIZ_SDK: offBluetoothDeviceFound ready search device")
|
|
397
398
|
wx.offBluetoothDeviceFound(handleFoundDevices);
|
|
399
|
+
};
|
|
398
400
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
401
|
+
// 开始大循环搜索
|
|
402
|
+
try {
|
|
403
|
+
// const devicesReturn = await this.searchDevice({ ssid, password });
|
|
404
|
+
this.searchDevice({ ssid, password }).then(devicesReturn => {
|
|
402
405
|
res(devicesReturn);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
}
|
|
406
|
+
})
|
|
407
|
+
} catch (error) {
|
|
408
|
+
rej(error);
|
|
409
|
+
console.error("GIZ_SDK: searchDevice error", error)
|
|
410
|
+
}
|
|
408
411
|
|
|
409
412
|
await startConfigDevice();
|
|
410
413
|
});
|