Documentation ¶
Overview ¶
Package packet implements a LIFX LAN protocol version 2 packet.
This package is not designed to be accessed by end users, all interaction should occur via the Client in the golifx package.
Index ¶
- Variables
- type Chan
- type Frame
- func (f *Frame) GetAddressable() bool
- func (f *Frame) GetProtocol() uint16
- func (f *Frame) GetSource() uint32
- func (f *Frame) GetTagged() bool
- func (f *Frame) SetAddressable(addressable bool)
- func (f *Frame) SetProtocol(protocol uint16)
- func (f *Frame) SetSize(size uint16)
- func (f *Frame) SetSource(source uint32)
- func (f *Frame) SetTagged(tagged bool)
- type FrameAddress
- func (f *FrameAddress) GetAckRequired() bool
- func (f *FrameAddress) GetResRequired() bool
- func (f *FrameAddress) GetSequence() uint8
- func (f *FrameAddress) GetTarget() uint64
- func (f *FrameAddress) SetAckRequired(ackRequired bool)
- func (f *FrameAddress) SetResRequired(resRequired bool)
- func (f *FrameAddress) SetSequence(sequence uint8)
- func (f *FrameAddress) SetTarget(target uint64)
- type Packet
- type ProtocolHeader
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ClientID uint32
)
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct { Size uint16 `struc:"little"` // Size of entire message in bytes including this field // Origin (2-bit): Message origin indicator: must be zero (0) // Tagged (1-bit): Determines usage of Frame Address *target* field // Addressable (1-bit): Message includes a target address: must be one (1) // Protocol (12-bit): Protocol number: must be 1024 (decimal) OriginTaggedAddressableProtocol uint16 `struct:"little"` Source uint32 `struc:"little"` // Source identifier: unique value set by the client, used by responses }
func (*Frame) GetAddressable ¶
func (*Frame) GetProtocol ¶
func (*Frame) SetAddressable ¶
func (*Frame) SetProtocol ¶
type FrameAddress ¶
type FrameAddress struct { Target uint64 `struc:"little"` // Device address (MAC address) or zero (0) means all devices Reserved [6]uint8 `struc:"little"` // Reserved(6-bit) // AckRequired(1-bit): Acknowledgement message required // ResRequired(1-bit): Response message required ReservedAckRequiredResRequired uint8 `struc:"little"` Sequence uint8 `struc:"little"` }
func (*FrameAddress) GetAckRequired ¶
func (f *FrameAddress) GetAckRequired() bool
func (*FrameAddress) GetResRequired ¶
func (f *FrameAddress) GetResRequired() bool
func (*FrameAddress) GetSequence ¶
func (f *FrameAddress) GetSequence() uint8
func (*FrameAddress) GetTarget ¶
func (f *FrameAddress) GetTarget() uint64
func (*FrameAddress) SetAckRequired ¶
func (f *FrameAddress) SetAckRequired(ackRequired bool)
func (*FrameAddress) SetResRequired ¶
func (f *FrameAddress) SetResRequired(resRequired bool)
func (*FrameAddress) SetSequence ¶
func (f *FrameAddress) SetSequence(sequence uint8)
func (*FrameAddress) SetTarget ¶
func (f *FrameAddress) SetTarget(target uint64)
type Packet ¶
type Packet struct { Frame FrameAddress ProtocolHeader // contains filtered or unexported fields }
func (*Packet) DecodePayload ¶
func (*Packet) GetPayload ¶
func (*Packet) SetPayload ¶
type ProtocolHeader ¶
type ProtocolHeader struct { Reserved0 uint64 `struc:"little"` // Reserved Type uint16 `struc:"little"` // Message type determines the payload being used Reserved1 uint16 `struc:"little"` // Reserved }
func (*ProtocolHeader) GetType ¶
func (h *ProtocolHeader) GetType() shared.Message
func (*ProtocolHeader) SetType ¶
func (h *ProtocolHeader) SetType(msgType shared.Message)
Click to show internal directories.
Click to hide internal directories.