Documentation
¶
Index ¶
Constants ¶
View Source
const ( StartByte uint8 = 0x7E MaxPayloadSize uint8 = 10 OverheadSize uint8 = 4 // start, length, crc16 MaxFrameSize uint8 = MaxPayloadSize + OverheadSize )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppReceiver ¶
type AppReceiver interface {
Receive(payload []uint8)
}
type Crc16 ¶
type Crc16 struct { Polynomial uint16 // Polynomial used in this CRC calculation StartMask uint16 // bit shift register init EndMask uint16 // xor-out, applied before returning result // contains filtered or unexported fields }
REFIN and REFOUT hardcoded
func (*Crc16) ComputeReflect ¶
Compute from init to result in reflect mode (REFIN and REFOUT) This method don't use Crc.Value member.
func (*Crc16) UpdateReflect ¶
type LinkProtocol ¶
type LinkProtocol struct {
// contains filtered or unexported fields
}
func NewDefaultLinkProtocol ¶
func NewDefaultLinkProtocol(lowerLayer ComSender, upperLayer AppReceiver, crc Crc16) LinkProtocol
func (*LinkProtocol) Init ¶
func (lp *LinkProtocol) Init(lowerLayer ComSender, upperLayer AppReceiver, crc Crc16)
func (*LinkProtocol) ReceiveByte ¶
func (lp *LinkProtocol) ReceiveByte(currentByte uint8)
func (*LinkProtocol) Send ¶
func (lp *LinkProtocol) Send(bytes []uint8)
Click to show internal directories.
Click to hide internal directories.