relay packets

This commit is contained in:
2026-07-21 22:21:34 +02:00
parent 7ca7089476
commit 0a968b3910
3 changed files with 75 additions and 39 deletions

View File

@@ -9,14 +9,9 @@ const (
REQ_REGISTER
RESP_REGISTER
REQ_DATA
RESP_DATA
)
func Uint16(v uint16) []byte {
out := make([]byte, 2)
binary.LittleEndian.PutUint16(out, v)
return out
}
func BuildPkt(pktType uint16, data []byte) []byte {
out := make([]byte, 4+len(data))
binary.LittleEndian.PutUint16(out[0:], PROTO_VERSION)