2026-04-03 17:41:44 +09:00
|
|
|
package client
|
|
|
|
|
|
|
|
|
|
import "github.com/theater/picomap/lib/msgpack"
|
|
|
|
|
|
2026-04-03 17:44:32 +09:00
|
|
|
type RequestPICOBOOT struct{}
|
2026-04-04 15:09:16 +09:00
|
|
|
type ResponsePICOBOOT struct{}
|
2026-04-03 17:41:44 +09:00
|
|
|
|
2026-04-04 15:00:16 +09:00
|
|
|
type RequestInfo struct{}
|
|
|
|
|
type ResponseInfo struct {
|
2026-04-06 17:20:13 +09:00
|
|
|
BoardID [8]byte
|
|
|
|
|
MAC [6]byte
|
|
|
|
|
LinkLocal [16]byte
|
2026-04-04 15:00:16 +09:00
|
|
|
}
|
|
|
|
|
|
2026-04-03 17:41:44 +09:00
|
|
|
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))
|
2026-04-04 15:09:16 +09:00
|
|
|
msgpack.RegisterExt(1, (*DeviceError)(nil))
|
2026-04-03 17:44:32 +09:00
|
|
|
msgpack.RegisterExt(2, (*RequestPICOBOOT)(nil))
|
2026-04-04 15:09:16 +09:00
|
|
|
msgpack.RegisterExt(3, (*ResponsePICOBOOT)(nil))
|
2026-04-04 15:00:16 +09:00
|
|
|
msgpack.RegisterExt(4, (*RequestInfo)(nil))
|
|
|
|
|
msgpack.RegisterExt(5, (*ResponseInfo)(nil))
|
2026-04-03 17:41:44 +09:00
|
|
|
}
|