diff --git a/src/components/ScanCard.vue b/src/components/ScanCard.vue
index 194723f..7f53532 100644
--- a/src/components/ScanCard.vue
+++ b/src/components/ScanCard.vue
@@ -18,6 +18,7 @@ const connect = (device: BLECentralPlugin.PeripheralData) => {
(data: BLECentralPlugin.PeripheralDataExtended) => {
console.log(`Connected: ${data}`);
updater.obj.setDeviceId(device.id);
+ updater.device = device.id;
emit("connect");
},
(error: string | BLECentralPlugin.BLEError) => {
diff --git a/src/utils/updater.ts b/src/utils/updater.ts
index 425e544..d985a53 100644
--- a/src/utils/updater.ts
+++ b/src/utils/updater.ts
@@ -1,5 +1,5 @@
import Updater from "updaterweblibrary";
-const updater = {obj: new Updater()}
+const updater = {obj: new Updater(), device: ""}
export default updater;
\ No newline at end of file
diff --git a/src/views/HomePage.vue b/src/views/HomePage.vue
index 44d4ec2..b55a8c7 100644
--- a/src/views/HomePage.vue
+++ b/src/views/HomePage.vue
@@ -13,12 +13,12 @@
-
+
-
-
+
+
-
+
@@ -32,6 +32,7 @@ import ArchiveCard from "@/components/ArchiveCard.vue";
import FlashCard from "@/components/FlashCard.vue";
import {ref} from "vue";
import SettingsCard from "@/components/SettingsCard.vue";
+import updater from '@/utils/updater';
let prevCard = 0;
const shownCard = ref(0);
@@ -70,6 +71,20 @@ const showSettings = () => {
prevCard = shownCard.value;
shownCard.value = 5;
}
+
+function disconnect() {
+ ble.disconnect(
+ updater.device,
+ () => {
+ console.log("Disconnected.");
+ showScan();
+ },
+ (failure) => {
+ console.error(failure);
+ }
+ );
+
+}