Skip to content

Commit 2d9ff82

Browse files
committed
Add back getStatus
1 parent 1758893 commit 2d9ff82

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

android/app/src/main/java/betaflight/configurator/plugin/SocketPlugin.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,14 @@ public void disconnect(final PluginCall call) {
203203
});
204204
}
205205

206+
@PluginMethod
207+
public void getStatus(final PluginCall call) {
208+
JSObject result = new JSObject();
209+
result.put("connected", state.get() == ConnectionState.CONNECTED);
210+
result.put("state", state.get().toString());
211+
call.resolve(result);
212+
}
213+
206214
@Override
207215
protected void handleOnDestroy() {
208216
socketLock.lock();

0 commit comments

Comments
 (0)