mini_program_gizwits_sdk 3.6.2 → 3.6.4
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 +4 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +2 -2
- package/dist/src/types/index.d.ts +1 -0
- package/index.ts +2 -3
- package/package.json +1 -1
- package/src/handler/lan.ts +1 -0
- package/src/services/devices.ts +1 -0
- package/src/types/index.ts +1 -0
- package/src/utils.ts +2 -1
- package/src/wifiConfig/ap.ts +1 -0
- package/src/wifiConfig/ble.ts +2 -23
- package/src/wifiConfig/nfc/index.ts +1 -0
- package/dist/package.json +0 -55
- package/dist/src/sdk.js +0 -1101
- package/dist/src/services/monitor.js +0 -72
package/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import gizwitsSdk from './src/sdk';
|
|
|
3
3
|
import errorCode from './src/errorCode';
|
|
4
4
|
import { BleHandle } from './src/handler/ble';
|
|
5
5
|
|
|
6
|
-
import * as types from './src/types';
|
|
7
6
|
export { errorCode, BleHandle };
|
|
8
|
-
export
|
|
9
|
-
export
|
|
7
|
+
export default gizwitsSdk;
|
|
8
|
+
export * from './src/types';
|
package/package.json
CHANGED
package/src/handler/lan.ts
CHANGED
package/src/services/devices.ts
CHANGED
package/src/types/index.ts
CHANGED
package/src/utils.ts
CHANGED
|
@@ -248,7 +248,8 @@ export const BTDevice2GDevice = (
|
|
|
248
248
|
isBleOnline: true,
|
|
249
249
|
isLanOnline: false,
|
|
250
250
|
isOnline: false,
|
|
251
|
-
name: BTDevice.
|
|
251
|
+
name: BTDevice.localName,
|
|
252
|
+
localName: BTDevice.localName,
|
|
252
253
|
isBind: false,
|
|
253
254
|
bleDeviceID: BTDevice.deviceId,
|
|
254
255
|
ctime: new Date().getTime(),
|
package/src/wifiConfig/ap.ts
CHANGED
package/src/wifiConfig/ble.ts
CHANGED
|
@@ -244,31 +244,9 @@ class BLEConfig extends ConfigBase {
|
|
|
244
244
|
return (
|
|
245
245
|
!softAPSSIDPrefix ||
|
|
246
246
|
(device.name && device.name.startsWith(softAPSSIDPrefix))
|
|
247
|
+
|| (device.localName && device.localName.startsWith(softAPSSIDPrefix))
|
|
247
248
|
)
|
|
248
249
|
}
|
|
249
|
-
// isValidBleDevice = (
|
|
250
|
-
// bleDevice: WechatMiniprogram.BlueToothDevice,
|
|
251
|
-
// softAPSSIDPrefix?: string
|
|
252
|
-
// ) => {
|
|
253
|
-
// if (!bleDevice || !bleDevice.advertisData) {
|
|
254
|
-
// // 无效蓝牙设备或者蓝牙设备广播数据为空,返回失败
|
|
255
|
-
// return false;
|
|
256
|
-
// }
|
|
257
|
-
// const {productKey, mac, bleWorkStatus} = advertisData2PkAndMac(bleDevice.advertisData, this.specialProductKeys)
|
|
258
|
-
// if (!this.specialProductKeys.includes(productKey)) {
|
|
259
|
-
// // 不在PK列表
|
|
260
|
-
// return false;
|
|
261
|
-
// }
|
|
262
|
-
// // 判断广播包是否可以配网
|
|
263
|
-
// if (bleWorkStatus !== 1) return;
|
|
264
|
-
// GizLog.debug(`GIZ_SDK: isValidBleDevice mac: ${mac} pk: ${productKey} name: ${bleDevice.name}`)
|
|
265
|
-
// GizLog.debug(`GIZ_SDK: softAPSSIDPrefix: ${softAPSSIDPrefix} ismatch : ${bleDevice.name && bleDevice.name.startsWith(softAPSSIDPrefix)}`)
|
|
266
|
-
// return (
|
|
267
|
-
// !softAPSSIDPrefix ||
|
|
268
|
-
// (bleDevice.name && bleDevice.name.startsWith(softAPSSIDPrefix))
|
|
269
|
-
// );
|
|
270
|
-
// };
|
|
271
|
-
|
|
272
250
|
|
|
273
251
|
enableBluetoothDevicesDescovery = async (): Promise<
|
|
274
252
|
{ success: false; err: IError } | { success: true }
|
|
@@ -348,6 +326,7 @@ class BLEConfig extends ConfigBase {
|
|
|
348
326
|
productKey: item.product_key,
|
|
349
327
|
did: item.did,
|
|
350
328
|
name: '',
|
|
329
|
+
localName: '',
|
|
351
330
|
isBind: false,
|
|
352
331
|
connectType: 'NONE',
|
|
353
332
|
isBleOnline: false,
|
package/dist/package.json
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "mini_program_gizwits_sdk",
|
|
3
|
-
"version": "3.6.2",
|
|
4
|
-
"description": "更新类型",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "node_modules/mocha/bin/_mocha -r ts-node/register tests/**/*.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
8
|
-
"testBle": "node_modules/mocha/bin/_mocha -r ts-node/register tests/utils/randomCode.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
9
|
-
"build": "rm -rf ./dist && webpack",
|
|
10
|
-
"release": "npm run build && release-it",
|
|
11
|
-
"cover": "istanbul cover node_modules/mocha/bin/_mocha -- -r ts-node/register tests/**/*.spec.ts -file ./tests/setup-wx.js -timeout 60s",
|
|
12
|
-
"coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/gizwits/mini_program_gizwits_sdk.git"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"gizwits",
|
|
20
|
-
"miniprogram",
|
|
21
|
-
"sdk"
|
|
22
|
-
],
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@babel/plugin-transform-modules-commonjs": "^7.12.1",
|
|
25
|
-
"@release-it/conventional-changelog": "^2.0.0",
|
|
26
|
-
"@types/chai": "^4.2.11",
|
|
27
|
-
"@types/crypto-js": "^4.0.2",
|
|
28
|
-
"@types/mocha": "^7.0.2",
|
|
29
|
-
"@types/node": "^12.12.14",
|
|
30
|
-
"@types/sinon": "^10.0.6",
|
|
31
|
-
"chai": "^4.2.0",
|
|
32
|
-
"coveralls": "^3.0.11",
|
|
33
|
-
"istanbul": "^1.1.0-alpha.1",
|
|
34
|
-
"miniprogram-api-typings": "^3.9.0",
|
|
35
|
-
"mocha": "^7.1.1",
|
|
36
|
-
"release-it": "^14.2.2",
|
|
37
|
-
"sinon": "^9.2.4",
|
|
38
|
-
"ts-loader": "^6.2.2",
|
|
39
|
-
"ts-node": "^8.8.1",
|
|
40
|
-
"typescript": "^4.9.5",
|
|
41
|
-
"uglifyjs-webpack-plugin": "^2.2.0",
|
|
42
|
-
"webpack": "^4.42.1",
|
|
43
|
-
"webpack-bundle-analyzer": "^4.5.0",
|
|
44
|
-
"webpack-cli": "^3.3.11"
|
|
45
|
-
},
|
|
46
|
-
"author": "gizwits",
|
|
47
|
-
"license": "ISC",
|
|
48
|
-
"bugs": {
|
|
49
|
-
"url": "https://github.com/gizwits/mini_program_gizwits_sdk/issues"
|
|
50
|
-
},
|
|
51
|
-
"homepage": "https://github.com/gizwits/mini_program_gizwits_sdk#readme",
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"crypto-js": "^4.1.1"
|
|
54
|
-
}
|
|
55
|
-
}
|