Move the communication stuff to its own package

This commit is contained in:
2025-12-14 15:24:51 +00:00
parent c23441908f
commit 3ffad42922
4 changed files with 45 additions and 36 deletions
+33
View File
@@ -0,0 +1,33 @@
// Package communication will handle the data transmission with the peripheral
// device
package communication
import (
"github.com/tarm/serial"
)
const (
StartOfText = 0x02
EndOfText = 0x03
)
type CommState uint8
const (
CommIdle CommState = iota
CommOff
)
type Command uint8
const (
CmdRequestID Command = iota
CmdAckID
CmdCreateScreen
CmdCreateWindow
)
type DataReceiver interface {
Read(dev *serial.Port) error
Validate(data []byte) bool
}