mini_program_gizwits_sdk 3.7.0-kuka → 3.7.0
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 +96 -25
- package/{index.ts → dist/index.d.ts} +3 -3
- package/dist/index.js +5 -5
- package/global.d.ts +3 -19
- package/package.json +5 -5
- package/yarn-error.log +34 -34
- package/src/GizLog.ts +0 -51
- package/src/aepApi/aepApiRequest.ts +0 -61
- package/src/crc/calculators/crc16modbus.ts +0 -36
- package/src/crc/calculators/crc32.ts +0 -47
- package/src/crc/crc16modbus.ts +0 -3
- package/src/crc/crc32.ts +0 -4
- package/src/crc/create_buffer.ts +0 -7
- package/src/crc/define_crc.ts +0 -9
- package/src/crc/index.ts +0 -10
- package/src/crc/package.json +0 -3
- package/src/crc/types.ts +0 -10
- package/src/errorCode.ts +0 -84
- package/src/global.d.ts +0 -53
- package/src/globalData.ts +0 -9
- package/src/handler/EventListener.ts +0 -44
- package/src/handler/ble.ts +0 -1485
- package/src/handler/lan.ts +0 -409
- package/src/handler/socket.ts +0 -625
- package/src/openApiRequest.ts +0 -62
- package/src/productConfigFileManage.ts +0 -58
- package/src/protocol/Bind.ts +0 -22
- package/src/protocol/DeviceInfo.ts +0 -36
- package/src/protocol/DiscoverUDP.ts +0 -80
- package/src/protocol/GetDeviceStatus.ts +0 -63
- package/src/protocol/Login.ts +0 -43
- package/src/protocol/Ntp.ts +0 -13
- package/src/protocol/OTA/AwaitNoti.ts +0 -14
- package/src/protocol/OTA/CheckCanOTA.ts +0 -23
- package/src/protocol/OTA/OTAPackPackage.ts +0 -36
- package/src/protocol/OTA/OtaComplete.ts +0 -17
- package/src/protocol/OTA/PreOTA.ts +0 -47
- package/src/protocol/OTA/ResetPosition.ts +0 -14
- package/src/protocol/OffLineData.ts +0 -81
- package/src/protocol/ProtocolBase.ts +0 -54
- package/src/protocol/Reset.ts +0 -15
- package/src/protocol/SetReset.ts +0 -11
- package/src/protocol/WifiConfig.ts +0 -42
- package/src/protocol/dataPoint.ts +0 -769
- package/src/protocol/thirdProtocol/YunZhiMianBleProtocolBase.ts +0 -39
- package/src/protocol/tool.ts +0 -147
- package/src/randomCode.ts +0 -36
- package/src/request.ts +0 -22
- package/src/sdk.ts +0 -1472
- package/src/sentry.ts +0 -55
- package/src/services/devices.ts +0 -309
- package/src/services/login.ts +0 -15
- package/src/services/ota.ts +0 -30
- package/src/services/tool.ts +0 -10
- package/src/services/uploadP0.ts +0 -56
- package/src/sleep.ts +0 -2
- package/src/types/index.ts +0 -48
- package/src/utils.ts +0 -419
- package/src/wechatApi.ts +0 -210
- package/src/wifiConfig/ConfigBase.ts +0 -185
- package/src/wifiConfig/ap.ts +0 -192
- package/src/wifiConfig/ble.ts +0 -436
- package/src/wifiConfig/ble_ailCloud.ts +0 -554
package/src/global.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
interface IError {
|
|
2
|
-
errorCode: number;
|
|
3
|
-
errorMessage?: string;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface ICommonObj {
|
|
7
|
-
[key: string]: any
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface IDeviceStatusChangedProps {
|
|
11
|
-
did: string;
|
|
12
|
-
attrs: ICommonObj;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface IDeviceRawStatusChangedProps {
|
|
16
|
-
did: string;
|
|
17
|
-
raw: Uint8Array;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface IOnDeviceStatusChanged {
|
|
21
|
-
(data: IDeviceStatusChangedProps | IDeviceRawStatusChangedProps): void;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface IOnSocketStatusChanged {
|
|
25
|
-
(dids: string[], enabled: boolean): void;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
interface IEmptyFn {
|
|
29
|
-
(): void;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
interface IDevice {
|
|
33
|
-
mac: string;
|
|
34
|
-
productKey: string;
|
|
35
|
-
did: string;
|
|
36
|
-
bleWorkStatus?: number; // 0 默认状态 1 配网状态
|
|
37
|
-
name: string;
|
|
38
|
-
isBind: boolean;
|
|
39
|
-
rootDeviceId?: string;
|
|
40
|
-
bleDeviceID?: string;
|
|
41
|
-
remark?: string;
|
|
42
|
-
passcode?: string;
|
|
43
|
-
connectType: TConnectType;
|
|
44
|
-
isOnline: boolean; // 代表大循环在线
|
|
45
|
-
isLanOnline: boolean; // 代表小循环在线
|
|
46
|
-
isBleOnline: boolean; // 代表蓝牙在线
|
|
47
|
-
host?: string;
|
|
48
|
-
wss_port?: number;
|
|
49
|
-
ctime?: number;
|
|
50
|
-
RSSI?: number; // 蓝牙信号强度
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
type TConnectType = 'BLE' | 'BLE_BROADCAST' | 'LAN' | 'WAN' | 'NONE';
|
package/src/globalData.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export default class EventListener<T> {
|
|
2
|
-
public listenerMap: any = {};
|
|
3
|
-
public addEventListener = async <K extends keyof T>(
|
|
4
|
-
type: K,
|
|
5
|
-
func: T[K]
|
|
6
|
-
) => {
|
|
7
|
-
if (!this.listenerMap[type]) {
|
|
8
|
-
// 创建一个新的
|
|
9
|
-
this.listenerMap[type] = [];
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (this.listenerMap[type].indexOf(func) === -1) {
|
|
13
|
-
this.listenerMap[type].push(func);
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
success: true,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 移除事件监听
|
|
22
|
-
* @param type 事件监听名称,详见下表
|
|
23
|
-
* @param func 事件监听回调
|
|
24
|
-
* @returns
|
|
25
|
-
*/
|
|
26
|
-
public removeEventListener = <K extends keyof T>(
|
|
27
|
-
type: K,
|
|
28
|
-
func: T[K]
|
|
29
|
-
) => {
|
|
30
|
-
if (this.listenerMap[type]) {
|
|
31
|
-
const index = this.listenerMap[type].indexOf(func);
|
|
32
|
-
if (index !== -1) {
|
|
33
|
-
// 删除数组中的这一行
|
|
34
|
-
this.listenerMap[type].splice(index, 1);
|
|
35
|
-
return {
|
|
36
|
-
success: true,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return {
|
|
41
|
-
success: false,
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
}
|