Files
picomap/lib/client/types.go

63 lines
1.2 KiB
Go
Raw Normal View History

package client
import "github.com/theater/picomap/lib/msgpack"
type RequestPICOBOOT struct{}
type ResponsePICOBOOT struct{}
type RequestInfo struct{}
type ResponseInfo struct {
2026-04-06 20:09:30 +09:00
BoardID [8]byte
MAC [6]byte
IP [4]byte
2026-04-06 20:09:30 +09:00
FirmwareName string
}
type RequestLog struct{}
type LogEntry struct {
TimestampUS uint32
Message string
}
type ResponseLog struct {
Entries []LogEntry
}
type RequestTest struct {
Name string
}
type ResponseTest struct {
Pass bool
Messages []string
}
type DeviceError struct {
Code uint32
Message string
}
func (e *DeviceError) Error() string {
return e.Message
}
type Envelope struct {
MessageID uint32
Checksum uint32
Payload []byte
}
func init() {
msgpack.RegisterExt(0, (*Envelope)(nil))
msgpack.RegisterExt(1, (*DeviceError)(nil))
msgpack.RegisterExt(2, (*RequestPICOBOOT)(nil))
msgpack.RegisterExt(3, (*ResponsePICOBOOT)(nil))
msgpack.RegisterExt(4, (*RequestInfo)(nil))
msgpack.RegisterExt(5, (*ResponseInfo)(nil))
msgpack.RegisterExt(6, (*RequestLog)(nil))
msgpack.RegisterExt(7, (*ResponseLog)(nil))
msgpack.RegisterExt(127, (*RequestTest)(nil))
msgpack.RegisterExt(126, (*ResponseTest)(nil))
}