File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
android/app/src/main/java/betaflight/configurator/plugin
capacitor-plugin-socket/src Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,14 @@ public void disconnect(final PluginCall call) {
203
203
});
204
204
}
205
205
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
+
206
214
@ Override
207
215
protected void handleOnDestroy () {
208
216
socketLock .lock ();
Original file line number Diff line number Diff line change @@ -3,4 +3,5 @@ export interface SocketPlugin {
3
3
send ( options : { data : string } ) : Promise < { success : boolean } > ;
4
4
receive ( ) : Promise < { data : string } > ;
5
5
disconnect ( ) : Promise < { success : boolean } > ;
6
+ getStatus ( ) : Promise < { connected : boolean , state : string } > ;
6
7
}
You can’t perform that action at this time.
0 commit comments