@bits-innovate/react-native-vstarcam 1.0.11 → 1.0.13
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.
|
@@ -126,6 +126,20 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
|
|
|
126
126
|
releaseListenerClass = Class.forName("com.vstarcam.app_p2p_api.ClientReleaseListener");
|
|
127
127
|
Log.d(TAG, "Listener interfaces loaded");
|
|
128
128
|
|
|
129
|
+
// Log all methods on each listener for debugging
|
|
130
|
+
Log.d(TAG, "ClientStateListener methods:");
|
|
131
|
+
for (Method m : stateListenerClass.getDeclaredMethods()) {
|
|
132
|
+
Log.d(TAG, " -> " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
|
|
133
|
+
}
|
|
134
|
+
Log.d(TAG, "ClientCommandListener methods:");
|
|
135
|
+
for (Method m : commandListenerClass.getDeclaredMethods()) {
|
|
136
|
+
Log.d(TAG, " -> " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
|
|
137
|
+
}
|
|
138
|
+
Log.d(TAG, "ClientReleaseListener methods:");
|
|
139
|
+
for (Method m : releaseListenerClass.getDeclaredMethods()) {
|
|
140
|
+
Log.d(TAG, " -> " + m.getName() + "(" + java.util.Arrays.toString(m.getParameterTypes()) + ")");
|
|
141
|
+
}
|
|
142
|
+
|
|
129
143
|
// Initialize P2P system with listeners
|
|
130
144
|
initializeP2P();
|
|
131
145
|
} catch (ClassNotFoundException e) {
|
|
@@ -151,11 +165,12 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
|
|
|
151
165
|
new InvocationHandler() {
|
|
152
166
|
@Override
|
|
153
167
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
|
154
|
-
Log.d(TAG, "ClientStateListener." + method.getName() + " called");
|
|
155
|
-
if (method.getName().equals("
|
|
168
|
+
Log.d(TAG, "ClientStateListener." + method.getName() + " called with " + (args != null ? args.length : 0) + " args");
|
|
169
|
+
if (method.getName().equals("stateListener")) {
|
|
156
170
|
// args: long clientPtr, int state
|
|
157
171
|
long clientPtr = (Long) args[0];
|
|
158
172
|
int state = (Integer) args[1];
|
|
173
|
+
Log.d(TAG, "State callback: clientPtr=" + clientPtr + ", state=" + state);
|
|
159
174
|
handleStateChange(clientPtr, state);
|
|
160
175
|
}
|
|
161
176
|
return null;
|
|
@@ -170,13 +185,14 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
|
|
|
170
185
|
new InvocationHandler() {
|
|
171
186
|
@Override
|
|
172
187
|
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
|
173
|
-
Log.d(TAG, "ClientCommandListener." + method.getName() + " called");
|
|
174
|
-
if (method.getName().equals("
|
|
175
|
-
// args: long clientPtr,
|
|
188
|
+
Log.d(TAG, "ClientCommandListener." + method.getName() + " called with " + (args != null ? args.length : 0) + " args");
|
|
189
|
+
if (method.getName().equals("commandListener")) {
|
|
190
|
+
// args: long clientPtr, byte[] data, int length (from interface)
|
|
176
191
|
long clientPtr = (Long) args[0];
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
192
|
+
byte[] data = (byte[]) args[1];
|
|
193
|
+
int length = (Integer) args[2];
|
|
194
|
+
Log.d(TAG, "Command callback: clientPtr=" + clientPtr + ", dataLen=" + (data != null ? data.length : 0));
|
|
195
|
+
handleCommandReceive(clientPtr, 0, data);
|
|
180
196
|
}
|
|
181
197
|
return null;
|
|
182
198
|
}
|
|
@@ -585,7 +601,7 @@ public class VStarCamModule extends ReactContextBaseJavaModule {
|
|
|
585
601
|
@ReactMethod
|
|
586
602
|
public void getSdkVersion(Promise promise) {
|
|
587
603
|
WritableMap result = Arguments.createMap();
|
|
588
|
-
result.putString("version", "1.0.
|
|
604
|
+
result.putString("version", "1.0.13");
|
|
589
605
|
result.putBoolean("nativeLoaded", isNativeLibraryLoaded);
|
|
590
606
|
result.putString("nativeLib", "OKSMARTPPCS");
|
|
591
607
|
result.putBoolean("p2pInitialized", isP2PInitialized);
|