mini_program_gizwits_sdk 3.7.1-kuka → 3.7.2-beta.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 +209 -25
- package/{index.ts → dist/index.d.ts} +3 -3
- package/dist/index.js +6 -4
- 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/{src/crc/types.ts → dist/src/crc/types.d.ts} +1 -1
- package/dist/src/handler/EventListener.d.ts +9 -0
- package/dist/src/handler/ble.d.ts +130 -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/TransparentData.d.ts +12 -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 +154 -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 +24 -0
- package/dist/src/utils/wifiConfigLogReport.d.ts +28 -0
- package/dist/src/wifiConfig/ConfigBase.d.ts +27 -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/global.d.ts +3 -19
- package/package.json +16 -7
- package/.istanbul.yml +0 -4
- package/.travis.yml +0 -23
- package/.vscode/launch.json +0 -19
- package/.vscode/settings.json +0 -3
- 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/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 -286
- 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/yarn-error.log +0 -6901
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface IRawData {
|
|
2
|
+
header: string;
|
|
3
|
+
len: string;
|
|
4
|
+
flag: string;
|
|
5
|
+
cmd: string;
|
|
6
|
+
sn: string;
|
|
7
|
+
action: string;
|
|
8
|
+
payload: string;
|
|
9
|
+
}
|
|
10
|
+
type messageType = 'APP2DEV' | 'DEV2APP' | 'UNKNOW';
|
|
11
|
+
export declare function getVariableLength(data: number[]): number[];
|
|
12
|
+
declare const unpack: (data: number[], pk: string) => Promise<{
|
|
13
|
+
kvData: {};
|
|
14
|
+
rawData: IRawData;
|
|
15
|
+
message: string;
|
|
16
|
+
messageType: messageType;
|
|
17
|
+
}>;
|
|
18
|
+
declare const pack: (data: object, pk: string) => Promise<{
|
|
19
|
+
data: number[];
|
|
20
|
+
raw: {
|
|
21
|
+
header: number[];
|
|
22
|
+
flag: number[];
|
|
23
|
+
len: number[];
|
|
24
|
+
headerCmd: number[];
|
|
25
|
+
sn: number[];
|
|
26
|
+
cmd: number[];
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
declare const padBoradcastData: (data: number[]) => string;
|
|
30
|
+
type TargetType = 'int' | 'string';
|
|
31
|
+
declare const formatEnum: (attrs: any, pk: string, targetType: TargetType) => Promise<any>;
|
|
32
|
+
type BTargetType = 'string' | 'object';
|
|
33
|
+
declare const formatBinary: (attrs: any, pk: string, targetType: BTargetType) => Promise<any>;
|
|
34
|
+
export { pack, unpack, padBoradcastData, formatEnum, formatBinary };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const checkHeader: (data: any) => number | false;
|
|
2
|
+
export declare const completeBlock: (cmd: string) => number[];
|
|
3
|
+
declare const getProtocolLen: (data: any) => number;
|
|
4
|
+
declare function arrayToString(arr: number[]): string;
|
|
5
|
+
export declare function arrayToASCII(arr: number[]): string;
|
|
6
|
+
declare const fillString: (string: string, num: number, foot?: boolean) => string;
|
|
7
|
+
declare const bytesToInt: (data: number[]) => number;
|
|
8
|
+
declare const bytesToHexString: (data: number[]) => string;
|
|
9
|
+
declare const string2Bytes: (str: string) => number[];
|
|
10
|
+
declare const hexStrint2byte: (str: string) => number[];
|
|
11
|
+
declare const formatCode: (str: any) => number[];
|
|
12
|
+
declare const formatCodesFromStr: (str: string) => number[][];
|
|
13
|
+
declare const arrayToUint8: (config: number[]) => Uint8Array;
|
|
14
|
+
export { checkHeader, getProtocolLen, arrayToString, fillString, string2Bytes, hexStrint2byte, formatCodesFromStr, formatCode, arrayToUint8, bytesToInt, bytesToHexString };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { TLogType } from './utils/GizLog';
|
|
2
|
+
import { ISafeRegisterReturn, IUnbindReturn } from './services/devices';
|
|
3
|
+
import { IDevice, TConnectType, IOpenApiDevice, GizwitsSdkOption, SyncCallBack, ISDKResult, IResult, IOTAType, IBindRemoteDeviceParams, TListenerType, ISetDeviceOnboardingDeployProps, IDataPointConfig, OTAEventCallback, OTAProgressEventCallback, ILoginRes, IDeviceSafetyRegisterParams } from './types';
|
|
4
|
+
declare class GizwitsMiniSDK {
|
|
5
|
+
private listenerMap;
|
|
6
|
+
private keepScanTimer;
|
|
7
|
+
private _deviceList;
|
|
8
|
+
private get deviceList();
|
|
9
|
+
private set deviceList(value);
|
|
10
|
+
private _bleDevices;
|
|
11
|
+
get bleDevices(): IDevice[];
|
|
12
|
+
set bleDevices(data: IDevice[]);
|
|
13
|
+
private _lanDevices;
|
|
14
|
+
private get lanDevices();
|
|
15
|
+
private set lanDevices(value);
|
|
16
|
+
private get allDevices();
|
|
17
|
+
private get bleScanDevice();
|
|
18
|
+
private productInfo;
|
|
19
|
+
private currentWifiConfigHandle;
|
|
20
|
+
private _bleHandle;
|
|
21
|
+
private _lanHandle;
|
|
22
|
+
private _gizSocket;
|
|
23
|
+
private offlineThreshold?;
|
|
24
|
+
private syncDataCallBack?;
|
|
25
|
+
private syncDataLengthCallback?;
|
|
26
|
+
private syncTotalNum;
|
|
27
|
+
private syncCurrnetNum;
|
|
28
|
+
private syncDataTimoutTimer;
|
|
29
|
+
private SYNC_TIMEOUT;
|
|
30
|
+
private syncDevice?;
|
|
31
|
+
private writeRetryMaxTimes;
|
|
32
|
+
private writeRetryInterval;
|
|
33
|
+
constructor(props: GizwitsSdkOption);
|
|
34
|
+
private get bleHandle();
|
|
35
|
+
private get lanHandle();
|
|
36
|
+
private get socketHandle();
|
|
37
|
+
private init;
|
|
38
|
+
reInit(props: GizwitsSdkOption): void;
|
|
39
|
+
get specialProductKeys(): string[];
|
|
40
|
+
get specialProductKeySecrets(): string[];
|
|
41
|
+
private handleBleError;
|
|
42
|
+
private handleBleDevices;
|
|
43
|
+
handleLanDevices: (devices: IDevice[]) => void;
|
|
44
|
+
private handleLanDeviceData;
|
|
45
|
+
private handleBleDeviceData;
|
|
46
|
+
private handleSocketDeviceData;
|
|
47
|
+
private handleSocketStatus;
|
|
48
|
+
private notiDeviceList;
|
|
49
|
+
private initLan;
|
|
50
|
+
startAutoScan: (services?: string[]) => void;
|
|
51
|
+
stopAutoScan: () => void;
|
|
52
|
+
setDeviceMeta: <K extends keyof IDevice>(curDev: IDevice, key: K, value: IDevice[K], force?: boolean) => void;
|
|
53
|
+
setDevicesMeta: <K extends keyof IDevice>(devices: IDevice[], key: K, value: IDevice[K], force?: boolean) => void;
|
|
54
|
+
static getVersion: () => {
|
|
55
|
+
success: boolean;
|
|
56
|
+
data: string;
|
|
57
|
+
};
|
|
58
|
+
initBle: () => Promise<ISDKResult<null>>;
|
|
59
|
+
scanBleDevice: (delay: number, services?: string[]) => Promise<ISDKResult<IDevice[]>>;
|
|
60
|
+
writeBigData: (device: IDevice, data: number[]) => Promise<unknown>;
|
|
61
|
+
_canControlByOpenApi: (data: Record<string, any>) => boolean;
|
|
62
|
+
_controlByOpenApi: (data: Record<string, any>) => Promise<{
|
|
63
|
+
message: string;
|
|
64
|
+
success: boolean;
|
|
65
|
+
data?: unknown;
|
|
66
|
+
err?: import("./types").IError;
|
|
67
|
+
}>;
|
|
68
|
+
write: (device: IDevice, attrs: object) => Promise<any>;
|
|
69
|
+
getTransparentDevice: (device: Pick<IDevice, 'mac' | 'productKey'>) => IDevice;
|
|
70
|
+
private exclusiveTransfers;
|
|
71
|
+
acquireTransparentTransfer: (device: Pick<IDevice, 'mac' | 'productKey'>) => (requiresReconnect?: boolean) => void;
|
|
72
|
+
private transparentSn;
|
|
73
|
+
private transparentDevices;
|
|
74
|
+
enableTransparentData: (device: Pick<IDevice, 'mac' | 'productKey'>) => void;
|
|
75
|
+
sendTransparentData: (device: Pick<IDevice, 'mac' | 'productKey'>, payload: Uint8Array) => Promise<any>;
|
|
76
|
+
writeRaw: (device: IDevice, data: number[]) => Promise<any>;
|
|
77
|
+
setDeviceTimeStamp: (device: IDevice) => Promise<any>;
|
|
78
|
+
syncDeviceData: (device: IDevice, callback?: SyncCallBack) => Promise<any>;
|
|
79
|
+
queryNeedSyncDataLength: (device: IDevice) => Promise<ISDKResult<number>>;
|
|
80
|
+
cancelSyncDeviceData: () => Promise<void>;
|
|
81
|
+
private cleanSyncDeviceData;
|
|
82
|
+
getProductConfig: (pk: string) => Promise<ISDKResult<IDataPointConfig>>;
|
|
83
|
+
stopScanBleDevice: () => void;
|
|
84
|
+
login: (openID: string) => Promise<ISDKResult<ILoginRes>>;
|
|
85
|
+
getDeviceStatus: (device: IDevice, attrNames?: string[]) => Promise<any>;
|
|
86
|
+
subscribe: (device: IDevice, connectType?: TConnectType, _autoGetDeviceStatus?: boolean) => Promise<IResult<any> | {
|
|
87
|
+
success: boolean;
|
|
88
|
+
errorCode: import("./types").IError;
|
|
89
|
+
} | {
|
|
90
|
+
success: boolean;
|
|
91
|
+
errorCode?: undefined;
|
|
92
|
+
} | {
|
|
93
|
+
success: boolean;
|
|
94
|
+
message: string;
|
|
95
|
+
}>;
|
|
96
|
+
batchSubscribe: (devices: IDevice[], connectType?: TConnectType) => Promise<{
|
|
97
|
+
success: boolean;
|
|
98
|
+
errorCode: import("./types").IError;
|
|
99
|
+
} | {
|
|
100
|
+
success: boolean;
|
|
101
|
+
errorCode?: undefined;
|
|
102
|
+
} | {
|
|
103
|
+
success: boolean;
|
|
104
|
+
message: string;
|
|
105
|
+
}>;
|
|
106
|
+
batchWanUnSubscribe: (devices: IDevice[]) => Promise<{
|
|
107
|
+
success: boolean;
|
|
108
|
+
}>;
|
|
109
|
+
unSubscribe: (device: IDevice) => Promise<{
|
|
110
|
+
success: boolean;
|
|
111
|
+
}>;
|
|
112
|
+
bindRemoteDevice: ({ mac, productKey, alias, beOwner, }: IBindRemoteDeviceParams) => Promise<ISDKResult<IOpenApiDevice>>;
|
|
113
|
+
checkUpdate: ({ device, type }: {
|
|
114
|
+
device: IDevice;
|
|
115
|
+
type: IOTAType;
|
|
116
|
+
}) => Promise<import("./types").IServiceResult<import("./types").OTARes>>;
|
|
117
|
+
getDeviceInfo: ({ device }: {
|
|
118
|
+
device: IDevice;
|
|
119
|
+
}) => Promise<IResult<import("./protocol/DeviceInfo").default>>;
|
|
120
|
+
startUpgrade: (params: {
|
|
121
|
+
device: IDevice;
|
|
122
|
+
type: IOTAType;
|
|
123
|
+
onProgress: OTAProgressEventCallback;
|
|
124
|
+
onEvent: OTAEventCallback;
|
|
125
|
+
}) => Promise<import("./types").IServiceResult<import("./types").OTARes>>;
|
|
126
|
+
private startUpgradeInternal;
|
|
127
|
+
unbindDevice: ({ devices }: {
|
|
128
|
+
devices: IDevice[];
|
|
129
|
+
}) => Promise<ISDKResult<IUnbindReturn>>;
|
|
130
|
+
deviceSafetyRegister: ({ mac, productKey, }: IDeviceSafetyRegisterParams) => Promise<ISDKResult<ISafeRegisterReturn>>;
|
|
131
|
+
deviceSafetyUnbind: ({ mac, productKey, }: IDeviceSafetyRegisterParams) => Promise<ISDKResult<ISafeRegisterReturn>>;
|
|
132
|
+
setDeviceOnboardingDeploy: ({ ssid, bssid, password, mode, timeout, productKey, isBind, softAPSSIDPrefix, eventCallBack, }: ISetDeviceOnboardingDeployProps) => Promise<ISDKResult<IDevice[]>>;
|
|
133
|
+
private setDomain;
|
|
134
|
+
private deviceSafetyApi;
|
|
135
|
+
getBindingList: () => Promise<import("./types").IServiceResult<IDevice[]>>;
|
|
136
|
+
getDevices: () => Promise<ISDKResult<IDevice[]>>;
|
|
137
|
+
stopDeviceOnboardingDeploy: () => void;
|
|
138
|
+
setLogLevel: (level: TLogType) => {
|
|
139
|
+
success: boolean;
|
|
140
|
+
err: import("./types").IError;
|
|
141
|
+
};
|
|
142
|
+
renameDevice: (device: IDevice, name: string) => Promise<import("./types").IServiceResult<import("./services/devices").IRenamePropsReturn> | {
|
|
143
|
+
success: boolean;
|
|
144
|
+
message: string;
|
|
145
|
+
}>;
|
|
146
|
+
removeEventListener: <K extends keyof TListenerType>(type: K, func: TListenerType[K]) => {
|
|
147
|
+
success: boolean;
|
|
148
|
+
};
|
|
149
|
+
addEventListener: <K extends keyof TListenerType>(type: K, func: TListenerType[K]) => Promise<{
|
|
150
|
+
success: boolean;
|
|
151
|
+
}>;
|
|
152
|
+
destory: () => void;
|
|
153
|
+
}
|
|
154
|
+
export default GizwitsMiniSDK;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IDevice, IOpenApiDevice, IRandomCodesResult, IServiceResult } from '../types';
|
|
2
|
+
export declare const getBindingList: () => Promise<IServiceResult<IDevice[]>>;
|
|
3
|
+
export interface IBindMacParams {
|
|
4
|
+
mac: string;
|
|
5
|
+
productKey: string;
|
|
6
|
+
productSecret: string;
|
|
7
|
+
alias?: string;
|
|
8
|
+
beOwner?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function bindMac({ mac, productKey, productSecret, alias, beOwner, }: IBindMacParams): Promise<IServiceResult<IOpenApiDevice>>;
|
|
11
|
+
export interface IUnbindReturn {
|
|
12
|
+
failed: string[];
|
|
13
|
+
success: string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function unbindDevice({ devices }: {
|
|
16
|
+
devices: IDevice[];
|
|
17
|
+
}): Promise<IServiceResult<IUnbindReturn>>;
|
|
18
|
+
interface ICheckDeviceRegisterParams {
|
|
19
|
+
SSID: string;
|
|
20
|
+
password: string;
|
|
21
|
+
productKeys: string[];
|
|
22
|
+
}
|
|
23
|
+
export declare function checkDeviceRegister({ SSID, password, productKeys, }: ICheckDeviceRegisterParams): Promise<IServiceResult<IRandomCodesResult[]>>;
|
|
24
|
+
interface ISafeRegisterParams {
|
|
25
|
+
productKey: string;
|
|
26
|
+
productSecret: string;
|
|
27
|
+
mac: string;
|
|
28
|
+
passcode: string;
|
|
29
|
+
gwDid?: string;
|
|
30
|
+
isReset: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface ISafeRegisterReturn {
|
|
33
|
+
successDevices: IDevice[];
|
|
34
|
+
failedDevices: IDevice[];
|
|
35
|
+
}
|
|
36
|
+
export declare function safeRegister({ productKey, productSecret, mac, passcode, gwDid, isReset, }: ISafeRegisterParams): Promise<IServiceResult<ISafeRegisterReturn>>;
|
|
37
|
+
interface IRenameProps {
|
|
38
|
+
name?: string;
|
|
39
|
+
did: string;
|
|
40
|
+
remark?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface IRenamePropsReturn {
|
|
43
|
+
remark: string;
|
|
44
|
+
dev_alias: string;
|
|
45
|
+
}
|
|
46
|
+
export declare function editBindInfo({ name, remark, did }: IRenameProps): Promise<IServiceResult<IRenamePropsReturn>>;
|
|
47
|
+
export declare function controlDevice(data: {
|
|
48
|
+
did: string;
|
|
49
|
+
raw: number[];
|
|
50
|
+
attrs: any;
|
|
51
|
+
}): Promise<IServiceResult<unknown>>;
|
|
52
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IDevice } from '../types';
|
|
2
|
+
type EventType = "BleDeviceConnectStart" | "BleDeviceConnectEnd" | "BleDeviceConnectBind" | "BleDeviceConnectLogin" | "BleDeviceConnectFinish";
|
|
3
|
+
type FailureType = Omit<EventType, 'BleDeviceConnectStart' | 'BleDeviceConnectFinish'>;
|
|
4
|
+
interface IProps {
|
|
5
|
+
device: IDevice;
|
|
6
|
+
eventID: string;
|
|
7
|
+
eventType: EventType;
|
|
8
|
+
success: boolean;
|
|
9
|
+
failureType?: FailureType;
|
|
10
|
+
}
|
|
11
|
+
export declare function reportEvent({ device, eventID, eventType, success, failureType }: IProps): Promise<import("../types").IServiceResult<any>>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IDevice } from "../types";
|
|
2
|
+
export interface IUploadRes {
|
|
3
|
+
}
|
|
4
|
+
interface IData {
|
|
5
|
+
raw: string;
|
|
6
|
+
created_at: number;
|
|
7
|
+
}
|
|
8
|
+
interface IProps {
|
|
9
|
+
device: IDevice;
|
|
10
|
+
data: IData[];
|
|
11
|
+
productSecret: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function uploadP0({ device, data, productSecret }: IProps): Promise<import("../types").IServiceResult<IUploadRes>>;
|
|
14
|
+
export {};
|