refactor serial connection to base class and web serial class

This commit is contained in:
liamcottle 2025-04-08 11:52:32 +12:00
parent c18496f788
commit de4e1d713b
3 changed files with 156 additions and 130 deletions

View file

@ -190,7 +190,7 @@
<script type="module">
import Constants from "./src/constants.js";
import SerialConnection from "./src/connection/serial_connection.js";
import WebSerialConnection from "./src/connection/web_serial_connection.js";
import BleConnection from "./src/connection/ble_connection.js";
import BufferUtils from "./src/buffer_utils.js";
Vue.createApp({
@ -209,7 +209,7 @@
},
methods: {
async askForSerialPort() {
this.connection = await SerialConnection.open();
this.connection = await WebSerialConnection.open();
this.connection.on("connected", () => this.onConnected());
this.connection.on("disconnected", () => this.onDisconnected());
// this.connection.on("tx", (data) => console.log("tx", data));