toos-halloween/toos-dashboard/src/composables/useSerial.js

10 lines
362 B
JavaScript
Raw Normal View History

2023-10-13 09:43:42 +02:00
import { invoke } from "@tauri-apps/api/tauri"
import { useLocalStorage } from '@vueuse/core'
const serialConfig = useLocalStorage('serialConfig', { port: '', baud: 9600 })
export function useSerial(input) {
console.log(serialConfig.value)
invoke('write_serial', { input: input + ";", portName: serialConfig.value.port, baud: serialConfig.value.baud });
}