Big Gotool Refactoring
- Added Event Bus - Reworked Package Parsing - Rewokred Frame Parsing
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
@@ -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 {
|
||||
}
|
||||
Reference in New Issue
Block a user