Minor change to new message formats. LONG WAY TO GO

This commit is contained in:
Niklas Jensen
2025-12-31 00:52:14 +01:00
committed by nikguin04
parent 9cddbf8a9b
commit 73aa38951d
6 changed files with 41 additions and 43 deletions
+19 -1
View File
@@ -1,6 +1,11 @@
<script lang="ts">
import { onMount } from 'svelte'
import { socket } from '$lib/stores'
//import { IMUReport, IMUType } from '$lib/platform_shared/example';
import { AnglesData, WebsocketMessage } from '$lib/platform_shared/websocket_message'
import { AnglesData, WebsocketMessage, IMUData } from '$lib/platform_shared/websocket_message'
// const imu_report: IMUReport = {type: IMUType.IMU_ACCEL, xVal: 4}
// const writer = IMUReport.encode(imu_report);
@@ -40,8 +45,21 @@
// console.log("True2!")
// }
const handleData = (data: IMUData) => {
console.log(data);
}
onMount(() => {
socket.on(IMUData, handleData)
return () => socket.off(IMUData, handleData)
})
</script>
<h1>Hexadecimal Output</h1>
<p><strong>Hex output:</strong> {hex}</p>