Big Gotool Refactoring

- Added Event Bus
- Reworked Package Parsing
- Rewokred Frame Parsing
This commit is contained in:
2026-01-27 16:23:51 +01:00
parent 9efef034f0
commit 0767ddac38
12 changed files with 657 additions and 930 deletions
+11
View File
@@ -0,0 +1,11 @@
package api
const (
TopicFrontendCmd = "front:cmd"
)
type FrontendCmd struct {
Action string `json:"action"`
ID byte `json:"id"`
Data []byte `json:"data"`
}
+39
View File
@@ -0,0 +1,39 @@
package api
// Topics
const (
TopicUARTRx = "uart:rx"
TopicUARTTx = "uart:tx"
TopicUARTError = "uart:error"
)
type Frame struct {
Time uint64
ID byte
Data []byte
}
const (
CmdEcho byte = 0x01
CmdVersion byte = 0x02
CmdClientInfo byte = 0x03
CmdClientInput byte = 0x04
)
type PayloadVersion struct {
Version uint16
Buildhash [7]uint8
}
type PayloadClientInfo struct {
ClientID uint8
IsAvailable uint8
SlotIsUsed uint8
MACAddr [6]uint8
LastPing uint32
LastSuccessfulPing uint32
Version uint16
}
type PayloadClientInput struct {
}