react-native-gizwits-sdk-v5 1.1.1 → 1.1.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/ios/GizwitsiOSSDK.framework/GizwitsiOSSDK +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/RNGizSDKManagerModule.swift +4 -4
- package/lib/types.d.ts +13 -3
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftdoc
CHANGED
|
Binary file
|
package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftmodule
CHANGED
|
Binary file
|
|
@@ -33,18 +33,18 @@ class RNGizSDKManagerModule: RCTEventEmitter, GizSdkEventHandlerDelegate {
|
|
|
33
33
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
func onDeviceData(device: GizwitsiOSSDK.
|
|
36
|
+
func onDeviceData(device: GizwitsiOSSDK.GizDevice, result: GizwitsiOSSDK.GizJSON, type: GizwitsiOSSDK.GizCapability) {
|
|
37
37
|
let data = [
|
|
38
38
|
"device": GizRNCallbackManager.convertToDictionary(object: device) ?? [:],
|
|
39
|
-
"data": result,
|
|
39
|
+
"data": GizRNCallbackManager.convertToDictionary(object: result) ?? [:],
|
|
40
40
|
"type": type.rawValue
|
|
41
41
|
] as [String : Any]
|
|
42
42
|
sendEvent(withName: "DeviceDataListener", body: data)
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
func onDeviceState(device: GizwitsiOSSDK.
|
|
45
|
+
func onDeviceState(device: GizwitsiOSSDK.GizDevice, state: GizwitsiOSSDK.GizWifiDeviceNetStatus, type: GizwitsiOSSDK.GizCapability) {
|
|
46
46
|
let data = [
|
|
47
|
-
"device": GizRNCallbackManager.convertToDictionary(object: device),
|
|
47
|
+
"device": GizRNCallbackManager.convertToDictionary(object: device) ?? [:],
|
|
48
48
|
"state": state.rawValue,
|
|
49
49
|
"type": type.rawValue
|
|
50
50
|
] as [String : Any]
|
package/lib/types.d.ts
CHANGED
|
@@ -85,15 +85,25 @@ export interface GizConfigStruct {
|
|
|
85
85
|
export declare type GizWifiDeviceNetStatus = 0 | 1 | 2 | 3;
|
|
86
86
|
export declare type GizCapability = 'BLE' | 'LAN' | 'MQTT';
|
|
87
87
|
export interface DeviceDataRes {
|
|
88
|
-
device:
|
|
89
|
-
data:
|
|
88
|
+
device: IDevice;
|
|
89
|
+
data: GizDeviceData;
|
|
90
90
|
type: GizCapability;
|
|
91
91
|
}
|
|
92
92
|
export interface DeviceStateRes {
|
|
93
|
-
device:
|
|
93
|
+
device: IDevice;
|
|
94
94
|
state: GizWifiDeviceNetStatus;
|
|
95
95
|
type: GizCapability;
|
|
96
96
|
}
|
|
97
97
|
export declare type DeviceDataCallback = (data: DeviceDataRes) => void;
|
|
98
98
|
export declare type DeviceStateCallback = (data: DeviceStateRes) => void;
|
|
99
99
|
export declare type DeviceListCallback = (data: IDevice[]) => void;
|
|
100
|
+
export interface GizDeviceDataItem {
|
|
101
|
+
[keyof: string]: number | Array<number> | boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface GizDeviceData {
|
|
104
|
+
sn: number;
|
|
105
|
+
cmd: number;
|
|
106
|
+
data: GizDeviceDataItem;
|
|
107
|
+
alerts: GizDeviceDataItem;
|
|
108
|
+
faults: GizDeviceDataItem;
|
|
109
|
+
}
|