40 lines
632 B
Go
40 lines
632 B
Go
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 {
|
|
}
|