From 3254d22373ff9762821db65100e0145b80949272 Mon Sep 17 00:00:00 2001 From: ehsan shariati Date: Thu, 25 May 2023 13:32:23 +0330 Subject: [PATCH 1/6] Added wifiRemoveallMethod --- android/build.gradle | 2 +- .../main/java/land/fx/fula/FulaModule.java | 20 ++++++++++++ example/src/App.tsx | 32 +++++++++++++++++++ package.json | 2 +- src/index.tsx | 3 +- src/interfaces/fulaNativeModule.ts | 1 + src/protocols/fxblox.ts | 14 ++++++++ src/types/fxblox.ts | 4 +++ 8 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 src/protocols/fxblox.ts create mode 100644 src/types/fxblox.ts diff --git a/android/build.gradle b/android/build.gradle index 30fa071..2f2b71c 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -62,7 +62,7 @@ repositories { dependencies { //noinspection GradleDynamicVersion implementation "com.facebook.react:react-native:+" // From node_modules - implementation 'com.github.functionland:fula-build-aar:1.2.1' // From jitpack.io + implementation 'com.github.functionland:fula-build-aar:1.7.0' // From jitpack.io implementation 'com.github.functionland:wnfs-build-aar:v1.4.1' // From jitpack.io implementation 'commons-io:commons-io:20030203.000550' // implementation files('mobile.aar') diff --git a/android/src/main/java/land/fx/fula/FulaModule.java b/android/src/main/java/land/fx/fula/FulaModule.java index e26d8e5..59ef4bd 100755 --- a/android/src/main/java/land/fx/fula/FulaModule.java +++ b/android/src/main/java/land/fx/fula/FulaModule.java @@ -1301,6 +1301,10 @@ public void removeStoredReplication(String seedString, String uploader, long poo }); } + //////////////////////////////////////////////////////////////// + ///////////////// Blox Hardware Methods //////////////////////// + //////////////////////////////////////////////////////////////// + @ReactMethod public void bloxFreeSpace(Promise promise) { ThreadUtils.runOnExecutor(() -> { @@ -1317,4 +1321,20 @@ public void bloxFreeSpace(Promise promise) { }); } + @ReactMethod + public void wifiRemoveall(Promise promise) { + ThreadUtils.runOnExecutor(() -> { + Log.d("ReactNative", "wifiRemoveall"); + try { + byte[] result = this.fula.wifiRemoveall(); + String resultString = toString(result); + Log.d("ReactNative", "result string="+resultString); + promise.resolve(resultString); + } catch (Exception e) { + Log.d("ReactNative", e.getMessage()); + promise.reject(e); + } + }); + } + } diff --git a/example/src/App.tsx b/example/src/App.tsx index 6913976..72a2a0e 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -419,6 +419,38 @@ const App = () => { }} color={inprogress ? 'green' : 'blue'} /> + +