@bits-innovate/react-native-vstarcam 1.0.36 → 1.0.37
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.
|
@@ -417,7 +417,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
|
|
|
417
417
|
sendEvent("onConnectionStateChanged", params);
|
|
418
418
|
|
|
419
419
|
// Update connected state
|
|
420
|
-
entry.getValue().isConnected = (state ==
|
|
420
|
+
entry.getValue().isConnected = (state == 2); // ONLINE is 2 in native, 3 in JS (now aligned to 2 in index.ts)
|
|
421
421
|
break;
|
|
422
422
|
}
|
|
423
423
|
}
|
|
@@ -601,7 +601,6 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
|
|
|
601
601
|
|
|
602
602
|
// Code >= 0 or other negative values might be a success (Session ID or State)
|
|
603
603
|
Log.d(TAG, "JNIApi.connect successful or handle returned: " + res);
|
|
604
|
-
clientInfo.isConnected = true; // Optimistically set this if we got a handle
|
|
605
604
|
} catch (java.lang.reflect.InvocationTargetException ite) {
|
|
606
605
|
Log.e(TAG, "JNIApi.connect threw exception: " + ite.getCause(), ite.getCause());
|
|
607
606
|
throw ite;
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -95,18 +95,17 @@ const VStarCamModule = NativeModules.VStarCam
|
|
|
95
95
|
|
|
96
96
|
// Connection states
|
|
97
97
|
export enum ConnectionState {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
REMOVE_CLOSE = 11,
|
|
98
|
+
CONNECTING = 0,
|
|
99
|
+
INITIALIZING = 1,
|
|
100
|
+
ONLINE = 2,
|
|
101
|
+
CONNECT_FAILED = 3,
|
|
102
|
+
DISCONNECTED = 4,
|
|
103
|
+
INVALID_ID = 5,
|
|
104
|
+
OFFLINE = 6,
|
|
105
|
+
TIMEOUT = 7,
|
|
106
|
+
WRONG_PWD = 8,
|
|
107
|
+
INVALID_CLIENT = 9,
|
|
108
|
+
MAX_SESSION = 10,
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
// Connection modes
|