Documentation
¶
Index ¶
Constants ¶
View Source
const ( SetPowerConst uint16 = 21 GetColorConst uint16 = 102 )
View Source
const (
HeaderLength = 36
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
func DefaultHeader ¶
func DefaultHeader() *Header
type HeaderRaw ¶
type HeaderRaw struct {
Size uint16
// 2 bits origin
// 1 bit tagged
// 1 bit addressable
// 12 bits protocol
Bitfield1 uint16
Source uint32
Target [8]byte
Reserved1 [6]byte
// 6 bits reserved
// 1 bit ack_required
// 1 bit res_required
Bitfield2 uint8
Sequence uint8
Reserved2 uint64
Type uint16
Reserved3 uint16
}
type Message ¶
func DecodeBinary ¶
DecodeBinary Decodes Lifx native packets and auto detects payload interface required.
func DecodeBinaryExplicit ¶
DecodeBinaryExplicit Decodes Lifx native packets and requires passing of explicit payload interface to decode binary light messages.
func SendPacket ¶
SendPacket Sends packet to light/broadcast
func (Message) EncodeBinary ¶
type Response ¶
type Response struct {
// contains filtered or unexported fields
}
Response Response received back
type SetPower ¶
type SetPower struct {
// contains filtered or unexported fields
}
SetPower https://lan.developer.lifx.com/docs/light-messages#section-setpower-117 If the Frame Address res_required field is set to one (1) then the device will transmit a StatePower message.
type StateLabel ¶
type StateLabel struct {
Label label // string
}
type StatePower ¶
type StatePower struct {
Level uint32
}
type StateService ¶
type StateService struct {
Service uint8 // Maps to Service. 1 is UDP. Ignore others
Port uint32 // Usually devices listen on 56700
}
StateService https://lan.developer.lifx.com/docs/device-messages#section-stateservice-3
Click to show internal directories.
Click to hide internal directories.