Documentation ¶
Index ¶
Constants ¶
View Source
const MaxUint24 = 0x00FFFFFF
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Packet ¶
type Packet interface { Encode() ([]byte, error) // VerifyData makes sure that the data checksum matches, if relevant VerifyData() bool IsValid() bool PathBytes() (routing []uint8, npath int) MergePath(path Path) (Packet, error) }
func DecodePacket ¶
type ReadPacket ¶
type ReadPacket struct { DestinationPath Path DestinationLogicalAddress uint8 // should default to 254 OptIncrement bool DestinationKey uint8 SourcePath Path SourceLogicalAddress uint8 // should default to 254 TransactionIdentifier uint16 ExtendedReadAddress uint8 ReadAddress uint32 DataLength uint32 }
func (ReadPacket) Encode ¶
func (rp ReadPacket) Encode() ([]byte, error)
func (ReadPacket) IsValid ¶
func (rp ReadPacket) IsValid() bool
func (ReadPacket) PathBytes ¶
func (rp ReadPacket) PathBytes() (routing []uint8, npath int)
func (ReadPacket) VerifyData ¶
func (rp ReadPacket) VerifyData() bool
type ReadReply ¶
type ReadReply struct { SourcePath Path SourceLogicalAddress uint8 // should default to 254 OptIncrement bool Status uint8 // 0 for successful execution DestinationLogicalAddress uint8 // should default to 254 TransactionIdentifier uint16 DataBytes []byte }
func (ReadReply) VerifyData ¶
type WritePacket ¶
type WritePacket struct { DestinationPath Path DestinationLogicalAddress uint8 // should default to 254 OptVerifyData bool OptAcknowledge bool OptIncrement bool DestinationKey uint8 SourcePath Path SourceLogicalAddress uint8 // should default to 254 TransactionIdentifier uint16 ExtendedWriteAddress uint8 WriteAddress uint32 DataBytes []byte DataCRC uint8 }
func (WritePacket) Encode ¶
func (wp WritePacket) Encode() ([]byte, error)
func (WritePacket) IsValid ¶
func (wp WritePacket) IsValid() bool
func (WritePacket) PathBytes ¶
func (wp WritePacket) PathBytes() (routing []uint8, npath int)
func (WritePacket) VerifyData ¶
func (wp WritePacket) VerifyData() bool
type WriteReply ¶
type WriteReply struct { SourcePath Path SourceLogicalAddress uint8 // should default to 254 OptVerifyData bool OptIncrement bool Status uint8 // 0 for successful execution DestinationLogicalAddress uint8 // should default to 254 TransactionIdentifier uint16 }
func (WriteReply) Encode ¶
func (wr WriteReply) Encode() ([]byte, error)
func (WriteReply) IsValid ¶
func (wr WriteReply) IsValid() bool
func (WriteReply) PathBytes ¶
func (wr WriteReply) PathBytes() (routing []uint8, npath int)
func (WriteReply) VerifyData ¶
func (wr WriteReply) VerifyData() bool
Click to show internal directories.
Click to hide internal directories.