Documentation ¶
Overview ¶
Package lan implements the LIFX LAN Protocol documented on the LIFX dev site:
https://lan.developer.lifx.com/
This is a minimal package meant only to create message packets and to send them over the network. It is meant to be used by another library to create a more developer friendly API.
The bulk of the code to support this package is generated automatically from a machine readable representation of the API as described here:
https://github.com/LIFX/public-protocol
To regenerate these files, `go generate` will use the `genlifx` command to pull the YAML file and process it. Because the documentation is not included, you will need to use the API documentation to determine what messages do, which fields are required, and what the values mean.
Code generated by "genlifx"; DO NOT EDIT.
Code generated by "genlifx"; DO NOT EDIT.
Code generated by "genlifx"; DO NOT EDIT.
Code generated by "genlifx"; DO NOT EDIT.
Code generated by "genlifx"; DO NOT EDIT.
Code generated by "genlifx"; DO NOT EDIT.
Code generated by "genlifx"; DO NOT EDIT.
Example (CompleteExample) ¶
This example shows a complete workflow for
package main import ( "fmt" "log" "strings" "time" "github.com/greygore/lifx/lan" ) func main() { // Let's broadcast a DeviceGetService message, which will order // all the LIFX devices to respond with a DeviceStateService message msg := lan.Message{} msg.Header.ProtocolHeader.Type = lan.DeviceGetServiceType msg.Payload = &lan.DeviceGetService{} // Our payload is empty, so the size of the entire packet is // the same size as the entire header msg.Header.Frame.Size = lan.HeaderSize // DeviceGetService requires us to set Tagged to true msg.Header.Frame.Tagged = true // Broadcast the message to the entire network if err := lan.Broadcast(msg); err != nil { panic(fmt.Sprintf("Error sending DeviceGetService %s", err)) } // Reads will by default block, so let's set a timeout lan.ReadTimeout = 200 * time.Millisecond // We need to store some basic info about each device that reports in... type Device struct { Host string // Host is the IP address for the bulb Port uint32 // Port used to connect to the device MAC [8]uint8 // The MAC address, used in the Target field } var devices []Device for { // Pull a message off the network host, msg, err := lan.Receive(lan.DefaultPort) if err != nil { panic(fmt.Sprintf("Error receiving DeviceStateService: %s", err)) } // If message is nil, we timed out, so stop looking for messages if msg == nil { break } // Skip non-DeviceStateService messages if msg.Header.ProtocolHeader.Type != lan.DeviceStateServiceType { continue } // Assert our payload to the appropriate type to access its fields payload := msg.Payload.(*lan.DeviceStateService) // Skip non-UDP service messages if payload.Service != lan.DeviceServiceUDP { continue } // Add our device to the list devices = append(devices, Device{Host: host, Port: payload.Port, MAC: msg.Header.FrameAddress.Target}) } // Now let's get a label for each device using DeviceGetLabel for _, device := range devices { msg := lan.Message{} msg.Header.ProtocolHeader.Type = lan.DeviceGetLabelType msg.Payload = &lan.DeviceGetLabel{} // DeviceGetLabel is also an empty payload... msg.Header.Frame.Size = lan.HeaderSize // Because we are contacting a specific device, we need to include // the MAC address in the Target msg.Header.FrameAddress.Target = device.MAC // Now we can send our message to the device using its stored address & port if err := lan.Send(device.Host, device.Port, msg); err != nil { log.Fatalf("Error sending Device GetLabel %s", err) } // Because we might receive other messages while looking for // DeviceStateService, we loop until we find one for { // We need to listen on the port that the device requested we use _, m, err := lan.Receive(device.Port) if err != nil { log.Fatalf("Error receiving Device StateLabel: %s", err) } // If the read timed out, the bulb may not have replied yet if m == nil { continue } // Skip any non DeviceState messages if m.Header.ProtocolHeader.Type != lan.DeviceStateLabelType { continue } payload := m.Payload.(*lan.DeviceStateLabel) // Our label is in a fixed array of bytes, so trim a slice to get // a string of the right length label := strings.TrimRight(string(payload.Label[:]), " ") // Print our label and break out of the loop fmt.Printf("Device: %s\n", label) break } } }
Output:
Index ¶
- Constants
- Variables
- func Broadcast(msg Message) error
- func Conn(port uint32) (net.PacketConn, error)
- func Send(addr string, port uint32, msg Message) error
- type DeviceAcknowledgement
- type DeviceEchoRequest
- type DeviceEchoResponse
- type DeviceGetGroup
- type DeviceGetHostFirmware
- type DeviceGetHostInfo
- type DeviceGetInfo
- type DeviceGetLabel
- type DeviceGetLocation
- type DeviceGetPower
- type DeviceGetService
- type DeviceGetVersion
- type DeviceGetWifiFirmware
- type DeviceGetWifiInfo
- type DeviceService
- type DeviceSetGroup
- type DeviceSetLabel
- type DeviceSetLocation
- type DeviceSetPower
- type DeviceStateGroup
- type DeviceStateHostFirmware
- type DeviceStateHostInfo
- type DeviceStateInfo
- type DeviceStateLabel
- type DeviceStateLocation
- type DeviceStatePower
- type DeviceStateService
- type DeviceStateVersion
- type DeviceStateWifiFirmware
- type DeviceStateWifiInfo
- type Frame
- type FrameAddress
- type Header
- type LightGet
- type LightGetInfrared
- type LightGetPower
- type LightHsbk
- type LightSetColor
- type LightSetInfrared
- type LightSetPower
- type LightSetWaveform
- type LightSetWaveformOptional
- type LightState
- type LightStateInfrared
- type LightStatePower
- type LightWaveform
- type Message
- type MultiZoneApplicationRequest
- type MultiZoneEffectParameter
- type MultiZoneEffectSettings
- type MultiZoneEffectType
- type MultiZoneExtendedApplicationRequest
- type MultiZoneExtendedGetColorZones
- func (m MultiZoneExtendedGetColorZones) MarshalBinary() ([]byte, error)
- func (m MultiZoneExtendedGetColorZones) Size() uint16
- func (m MultiZoneExtendedGetColorZones) String() string
- func (m MultiZoneExtendedGetColorZones) Type() uint16
- func (m *MultiZoneExtendedGetColorZones) UnmarshalBinary(data []byte) error
- type MultiZoneExtendedSetColorZones
- func (m MultiZoneExtendedSetColorZones) MarshalBinary() ([]byte, error)
- func (m MultiZoneExtendedSetColorZones) Size() uint16
- func (m MultiZoneExtendedSetColorZones) String() string
- func (m MultiZoneExtendedSetColorZones) Type() uint16
- func (m *MultiZoneExtendedSetColorZones) UnmarshalBinary(data []byte) error
- type MultiZoneExtendedStateMultiZone
- func (m MultiZoneExtendedStateMultiZone) MarshalBinary() ([]byte, error)
- func (m MultiZoneExtendedStateMultiZone) Size() uint16
- func (m MultiZoneExtendedStateMultiZone) String() string
- func (m MultiZoneExtendedStateMultiZone) Type() uint16
- func (m *MultiZoneExtendedStateMultiZone) UnmarshalBinary(data []byte) error
- type MultiZoneGetColorZones
- type MultiZoneGetEffect
- type MultiZoneSetColorZones
- type MultiZoneSetEffect
- type MultiZoneStateEffect
- type MultiZoneStateMultiZone
- type MultiZoneStateZone
- type Payloader
- type ProtocolHeader
- type TileAccelMeas
- type TileBufferRect
- type TileEffectParameter
- type TileEffectSettings
- type TileEffectType
- type TileGet64
- type TileGetDeviceChain
- type TileGetEffect
- type TileSet64
- type TileSetEffect
- type TileSetUserPosition
- type TileState64
- type TileStateDevice
- type TileStateDeviceChain
- type TileStateEffect
Examples ¶
Constants ¶
const ( LightWaveformSaw = 0 LightWaveformSine = 1 LightWaveformHalfSine = 2 LightWaveformTriangle = 3 LightWaveformPulse = 4 )
LightWaveform values
const ( MultiZoneApplicationRequestNoApply = 0 MultiZoneApplicationRequestApply = 1 MultiZoneApplicationRequestApplyOnly = 2 )
MultiZoneApplicationRequest values
const ( MultiZoneEffectTypeOff = 0 MultiZoneEffectTypeMove = 1 )
MultiZoneEffectType values
const ( MultiZoneExtendedApplicationRequestNoApply = 0 MultiZoneExtendedApplicationRequestApply = 1 MultiZoneExtendedApplicationRequestApplyOnly = 2 )
MultiZoneExtendedApplicationRequest values
const ( TileEffectTypeOff = 0 TileEffectTypeMorph = 2 TileEffectTypeFlame = 3 )
TileEffectType values
const ( DeviceAcknowledgementType = 45 DeviceEchoRequestType = 58 DeviceEchoResponseType = 59 DeviceGetGroupType = 51 DeviceGetHostFirmwareType = 14 DeviceGetHostInfoType = 12 DeviceGetInfoType = 34 DeviceGetLabelType = 23 DeviceGetLocationType = 48 DeviceGetPowerType = 20 DeviceGetServiceType = 2 DeviceGetVersionType = 32 DeviceGetWifiFirmwareType = 18 DeviceGetWifiInfoType = 16 DeviceSetGroupType = 52 DeviceSetLabelType = 24 DeviceSetLocationType = 49 DeviceSetPowerType = 21 DeviceStateGroupType = 53 DeviceStateHostFirmwareType = 15 DeviceStateHostInfoType = 13 DeviceStateInfoType = 35 DeviceStateLabelType = 25 DeviceStateLocationType = 50 DeviceStatePowerType = 22 DeviceStateServiceType = 3 DeviceStateVersionType = 33 DeviceStateWifiFirmwareType = 19 DeviceStateWifiInfoType = 17 )
message types
const ( LightGetType = 101 LightGetInfraredType = 120 LightGetPowerType = 116 LightSetColorType = 102 LightSetInfraredType = 122 LightSetPowerType = 117 LightSetWaveformType = 103 LightSetWaveformOptionalType = 119 LightStateType = 107 LightStateInfraredType = 121 LightStatePowerType = 118 )
message types
const ( MultiZoneExtendedGetColorZonesType = 511 MultiZoneExtendedSetColorZonesType = 510 MultiZoneExtendedStateMultiZoneType = 512 MultiZoneGetColorZonesType = 502 MultiZoneGetEffectType = 507 MultiZoneSetColorZonesType = 501 MultiZoneSetEffectType = 508 MultiZoneStateEffectType = 509 MultiZoneStateMultiZoneType = 506 MultiZoneStateZoneType = 503 )
message types
const ( TileGet64Type = 707 TileGetDeviceChainType = 701 TileGetEffectType = 718 TileSet64Type = 715 TileSetEffectType = 719 TileSetUserPositionType = 703 TileState64Type = 711 TileStateDeviceChainType = 702 TileStateEffectType = 720 )
message types
const DefaultPort = uint32(56700)
DefaultPort is the default port used by LIFX
const (
DeviceServiceUDP = 1
)
DeviceService values
const HeaderSize = 36
HeaderSize is the fixed size of the message header
Variables ¶
var ( // BroadcastIP is used to send messages to the entire network // Defaults to "255.255.255.255" which should work for most networks BroadcastIP = "255.255.255.255" // ReadTimeout sets a limit to how long to wait in milliseconds // By default (0), reads will block forever ReadTimeout time.Duration )
Functions ¶
Types ¶
type DeviceAcknowledgement ¶
type DeviceAcknowledgement struct{}
func (DeviceAcknowledgement) MarshalBinary ¶
func (m DeviceAcknowledgement) MarshalBinary() ([]byte, error)
func (DeviceAcknowledgement) Size ¶
func (m DeviceAcknowledgement) Size() uint16
func (DeviceAcknowledgement) String ¶
func (m DeviceAcknowledgement) String() string
func (DeviceAcknowledgement) Type ¶
func (m DeviceAcknowledgement) Type() uint16
func (*DeviceAcknowledgement) UnmarshalBinary ¶
func (m *DeviceAcknowledgement) UnmarshalBinary(data []byte) error
type DeviceEchoRequest ¶
type DeviceEchoRequest struct {
Payload [64]byte
}
func (DeviceEchoRequest) MarshalBinary ¶
func (m DeviceEchoRequest) MarshalBinary() ([]byte, error)
func (DeviceEchoRequest) Size ¶
func (m DeviceEchoRequest) Size() uint16
func (DeviceEchoRequest) String ¶
func (m DeviceEchoRequest) String() string
func (DeviceEchoRequest) Type ¶
func (m DeviceEchoRequest) Type() uint16
func (*DeviceEchoRequest) UnmarshalBinary ¶
func (m *DeviceEchoRequest) UnmarshalBinary(data []byte) error
type DeviceEchoResponse ¶
type DeviceEchoResponse struct {
Payload [64]byte
}
func (DeviceEchoResponse) MarshalBinary ¶
func (m DeviceEchoResponse) MarshalBinary() ([]byte, error)
func (DeviceEchoResponse) Size ¶
func (m DeviceEchoResponse) Size() uint16
func (DeviceEchoResponse) String ¶
func (m DeviceEchoResponse) String() string
func (DeviceEchoResponse) Type ¶
func (m DeviceEchoResponse) Type() uint16
func (*DeviceEchoResponse) UnmarshalBinary ¶
func (m *DeviceEchoResponse) UnmarshalBinary(data []byte) error
type DeviceGetGroup ¶
type DeviceGetGroup struct{}
func (DeviceGetGroup) MarshalBinary ¶
func (m DeviceGetGroup) MarshalBinary() ([]byte, error)
func (DeviceGetGroup) Size ¶
func (m DeviceGetGroup) Size() uint16
func (DeviceGetGroup) String ¶
func (m DeviceGetGroup) String() string
func (DeviceGetGroup) Type ¶
func (m DeviceGetGroup) Type() uint16
func (*DeviceGetGroup) UnmarshalBinary ¶
func (m *DeviceGetGroup) UnmarshalBinary(data []byte) error
type DeviceGetHostFirmware ¶
type DeviceGetHostFirmware struct{}
func (DeviceGetHostFirmware) MarshalBinary ¶
func (m DeviceGetHostFirmware) MarshalBinary() ([]byte, error)
func (DeviceGetHostFirmware) Size ¶
func (m DeviceGetHostFirmware) Size() uint16
func (DeviceGetHostFirmware) String ¶
func (m DeviceGetHostFirmware) String() string
func (DeviceGetHostFirmware) Type ¶
func (m DeviceGetHostFirmware) Type() uint16
func (*DeviceGetHostFirmware) UnmarshalBinary ¶
func (m *DeviceGetHostFirmware) UnmarshalBinary(data []byte) error
type DeviceGetHostInfo ¶
type DeviceGetHostInfo struct{}
func (DeviceGetHostInfo) MarshalBinary ¶
func (m DeviceGetHostInfo) MarshalBinary() ([]byte, error)
func (DeviceGetHostInfo) Size ¶
func (m DeviceGetHostInfo) Size() uint16
func (DeviceGetHostInfo) String ¶
func (m DeviceGetHostInfo) String() string
func (DeviceGetHostInfo) Type ¶
func (m DeviceGetHostInfo) Type() uint16
func (*DeviceGetHostInfo) UnmarshalBinary ¶
func (m *DeviceGetHostInfo) UnmarshalBinary(data []byte) error
type DeviceGetInfo ¶
type DeviceGetInfo struct{}
func (DeviceGetInfo) MarshalBinary ¶
func (m DeviceGetInfo) MarshalBinary() ([]byte, error)
func (DeviceGetInfo) Size ¶
func (m DeviceGetInfo) Size() uint16
func (DeviceGetInfo) String ¶
func (m DeviceGetInfo) String() string
func (DeviceGetInfo) Type ¶
func (m DeviceGetInfo) Type() uint16
func (*DeviceGetInfo) UnmarshalBinary ¶
func (m *DeviceGetInfo) UnmarshalBinary(data []byte) error
type DeviceGetLabel ¶
type DeviceGetLabel struct{}
func (DeviceGetLabel) MarshalBinary ¶
func (m DeviceGetLabel) MarshalBinary() ([]byte, error)
func (DeviceGetLabel) Size ¶
func (m DeviceGetLabel) Size() uint16
func (DeviceGetLabel) String ¶
func (m DeviceGetLabel) String() string
func (DeviceGetLabel) Type ¶
func (m DeviceGetLabel) Type() uint16
func (*DeviceGetLabel) UnmarshalBinary ¶
func (m *DeviceGetLabel) UnmarshalBinary(data []byte) error
type DeviceGetLocation ¶
type DeviceGetLocation struct{}
func (DeviceGetLocation) MarshalBinary ¶
func (m DeviceGetLocation) MarshalBinary() ([]byte, error)
func (DeviceGetLocation) Size ¶
func (m DeviceGetLocation) Size() uint16
func (DeviceGetLocation) String ¶
func (m DeviceGetLocation) String() string
func (DeviceGetLocation) Type ¶
func (m DeviceGetLocation) Type() uint16
func (*DeviceGetLocation) UnmarshalBinary ¶
func (m *DeviceGetLocation) UnmarshalBinary(data []byte) error
type DeviceGetPower ¶
type DeviceGetPower struct{}
func (DeviceGetPower) MarshalBinary ¶
func (m DeviceGetPower) MarshalBinary() ([]byte, error)
func (DeviceGetPower) Size ¶
func (m DeviceGetPower) Size() uint16
func (DeviceGetPower) String ¶
func (m DeviceGetPower) String() string
func (DeviceGetPower) Type ¶
func (m DeviceGetPower) Type() uint16
func (*DeviceGetPower) UnmarshalBinary ¶
func (m *DeviceGetPower) UnmarshalBinary(data []byte) error
type DeviceGetService ¶
type DeviceGetService struct{}
func (DeviceGetService) MarshalBinary ¶
func (m DeviceGetService) MarshalBinary() ([]byte, error)
func (DeviceGetService) Size ¶
func (m DeviceGetService) Size() uint16
func (DeviceGetService) String ¶
func (m DeviceGetService) String() string
func (DeviceGetService) Type ¶
func (m DeviceGetService) Type() uint16
func (*DeviceGetService) UnmarshalBinary ¶
func (m *DeviceGetService) UnmarshalBinary(data []byte) error
type DeviceGetVersion ¶
type DeviceGetVersion struct{}
func (DeviceGetVersion) MarshalBinary ¶
func (m DeviceGetVersion) MarshalBinary() ([]byte, error)
func (DeviceGetVersion) Size ¶
func (m DeviceGetVersion) Size() uint16
func (DeviceGetVersion) String ¶
func (m DeviceGetVersion) String() string
func (DeviceGetVersion) Type ¶
func (m DeviceGetVersion) Type() uint16
func (*DeviceGetVersion) UnmarshalBinary ¶
func (m *DeviceGetVersion) UnmarshalBinary(data []byte) error
type DeviceGetWifiFirmware ¶
type DeviceGetWifiFirmware struct{}
func (DeviceGetWifiFirmware) MarshalBinary ¶
func (m DeviceGetWifiFirmware) MarshalBinary() ([]byte, error)
func (DeviceGetWifiFirmware) Size ¶
func (m DeviceGetWifiFirmware) Size() uint16
func (DeviceGetWifiFirmware) String ¶
func (m DeviceGetWifiFirmware) String() string
func (DeviceGetWifiFirmware) Type ¶
func (m DeviceGetWifiFirmware) Type() uint16
func (*DeviceGetWifiFirmware) UnmarshalBinary ¶
func (m *DeviceGetWifiFirmware) UnmarshalBinary(data []byte) error
type DeviceGetWifiInfo ¶
type DeviceGetWifiInfo struct{}
func (DeviceGetWifiInfo) MarshalBinary ¶
func (m DeviceGetWifiInfo) MarshalBinary() ([]byte, error)
func (DeviceGetWifiInfo) Size ¶
func (m DeviceGetWifiInfo) Size() uint16
func (DeviceGetWifiInfo) String ¶
func (m DeviceGetWifiInfo) String() string
func (DeviceGetWifiInfo) Type ¶
func (m DeviceGetWifiInfo) Type() uint16
func (*DeviceGetWifiInfo) UnmarshalBinary ¶
func (m *DeviceGetWifiInfo) UnmarshalBinary(data []byte) error
type DeviceService ¶
type DeviceService uint8
DeviceService is generated from protocol enums
func (DeviceService) String ¶
func (e DeviceService) String() string
type DeviceSetGroup ¶
func (DeviceSetGroup) MarshalBinary ¶
func (m DeviceSetGroup) MarshalBinary() ([]byte, error)
func (DeviceSetGroup) Size ¶
func (m DeviceSetGroup) Size() uint16
func (DeviceSetGroup) String ¶
func (m DeviceSetGroup) String() string
func (DeviceSetGroup) Type ¶
func (m DeviceSetGroup) Type() uint16
func (*DeviceSetGroup) UnmarshalBinary ¶
func (m *DeviceSetGroup) UnmarshalBinary(data []byte) error
type DeviceSetLabel ¶
type DeviceSetLabel struct {
Label [32]byte
}
func (DeviceSetLabel) MarshalBinary ¶
func (m DeviceSetLabel) MarshalBinary() ([]byte, error)
func (DeviceSetLabel) Size ¶
func (m DeviceSetLabel) Size() uint16
func (DeviceSetLabel) String ¶
func (m DeviceSetLabel) String() string
func (DeviceSetLabel) Type ¶
func (m DeviceSetLabel) Type() uint16
func (*DeviceSetLabel) UnmarshalBinary ¶
func (m *DeviceSetLabel) UnmarshalBinary(data []byte) error
type DeviceSetLocation ¶
func (DeviceSetLocation) MarshalBinary ¶
func (m DeviceSetLocation) MarshalBinary() ([]byte, error)
func (DeviceSetLocation) Size ¶
func (m DeviceSetLocation) Size() uint16
func (DeviceSetLocation) String ¶
func (m DeviceSetLocation) String() string
func (DeviceSetLocation) Type ¶
func (m DeviceSetLocation) Type() uint16
func (*DeviceSetLocation) UnmarshalBinary ¶
func (m *DeviceSetLocation) UnmarshalBinary(data []byte) error
type DeviceSetPower ¶
type DeviceSetPower struct {
Level uint16
}
func (DeviceSetPower) MarshalBinary ¶
func (m DeviceSetPower) MarshalBinary() ([]byte, error)
func (DeviceSetPower) Size ¶
func (m DeviceSetPower) Size() uint16
func (DeviceSetPower) String ¶
func (m DeviceSetPower) String() string
func (DeviceSetPower) Type ¶
func (m DeviceSetPower) Type() uint16
func (*DeviceSetPower) UnmarshalBinary ¶
func (m *DeviceSetPower) UnmarshalBinary(data []byte) error
type DeviceStateGroup ¶
func (DeviceStateGroup) MarshalBinary ¶
func (m DeviceStateGroup) MarshalBinary() ([]byte, error)
func (DeviceStateGroup) Size ¶
func (m DeviceStateGroup) Size() uint16
func (DeviceStateGroup) String ¶
func (m DeviceStateGroup) String() string
func (DeviceStateGroup) Type ¶
func (m DeviceStateGroup) Type() uint16
func (*DeviceStateGroup) UnmarshalBinary ¶
func (m *DeviceStateGroup) UnmarshalBinary(data []byte) error
type DeviceStateHostFirmware ¶
type DeviceStateHostFirmware struct { Build uint64 Reserved1 [8]byte VersionMinor uint16 VersionMajor uint16 }
func (DeviceStateHostFirmware) MarshalBinary ¶
func (m DeviceStateHostFirmware) MarshalBinary() ([]byte, error)
func (DeviceStateHostFirmware) Size ¶
func (m DeviceStateHostFirmware) Size() uint16
func (DeviceStateHostFirmware) String ¶
func (m DeviceStateHostFirmware) String() string
func (DeviceStateHostFirmware) Type ¶
func (m DeviceStateHostFirmware) Type() uint16
func (*DeviceStateHostFirmware) UnmarshalBinary ¶
func (m *DeviceStateHostFirmware) UnmarshalBinary(data []byte) error
type DeviceStateHostInfo ¶
func (DeviceStateHostInfo) MarshalBinary ¶
func (m DeviceStateHostInfo) MarshalBinary() ([]byte, error)
func (DeviceStateHostInfo) Size ¶
func (m DeviceStateHostInfo) Size() uint16
func (DeviceStateHostInfo) String ¶
func (m DeviceStateHostInfo) String() string
func (DeviceStateHostInfo) Type ¶
func (m DeviceStateHostInfo) Type() uint16
func (*DeviceStateHostInfo) UnmarshalBinary ¶
func (m *DeviceStateHostInfo) UnmarshalBinary(data []byte) error
type DeviceStateInfo ¶
func (DeviceStateInfo) MarshalBinary ¶
func (m DeviceStateInfo) MarshalBinary() ([]byte, error)
func (DeviceStateInfo) Size ¶
func (m DeviceStateInfo) Size() uint16
func (DeviceStateInfo) String ¶
func (m DeviceStateInfo) String() string
func (DeviceStateInfo) Type ¶
func (m DeviceStateInfo) Type() uint16
func (*DeviceStateInfo) UnmarshalBinary ¶
func (m *DeviceStateInfo) UnmarshalBinary(data []byte) error
type DeviceStateLabel ¶
type DeviceStateLabel struct {
Label [32]byte
}
func (DeviceStateLabel) MarshalBinary ¶
func (m DeviceStateLabel) MarshalBinary() ([]byte, error)
func (DeviceStateLabel) Size ¶
func (m DeviceStateLabel) Size() uint16
func (DeviceStateLabel) String ¶
func (m DeviceStateLabel) String() string
func (DeviceStateLabel) Type ¶
func (m DeviceStateLabel) Type() uint16
func (*DeviceStateLabel) UnmarshalBinary ¶
func (m *DeviceStateLabel) UnmarshalBinary(data []byte) error
type DeviceStateLocation ¶
func (DeviceStateLocation) MarshalBinary ¶
func (m DeviceStateLocation) MarshalBinary() ([]byte, error)
func (DeviceStateLocation) Size ¶
func (m DeviceStateLocation) Size() uint16
func (DeviceStateLocation) String ¶
func (m DeviceStateLocation) String() string
func (DeviceStateLocation) Type ¶
func (m DeviceStateLocation) Type() uint16
func (*DeviceStateLocation) UnmarshalBinary ¶
func (m *DeviceStateLocation) UnmarshalBinary(data []byte) error
type DeviceStatePower ¶
type DeviceStatePower struct {
Level uint16
}
func (DeviceStatePower) MarshalBinary ¶
func (m DeviceStatePower) MarshalBinary() ([]byte, error)
func (DeviceStatePower) Size ¶
func (m DeviceStatePower) Size() uint16
func (DeviceStatePower) String ¶
func (m DeviceStatePower) String() string
func (DeviceStatePower) Type ¶
func (m DeviceStatePower) Type() uint16
func (*DeviceStatePower) UnmarshalBinary ¶
func (m *DeviceStatePower) UnmarshalBinary(data []byte) error
type DeviceStateService ¶
type DeviceStateService struct { Service DeviceService Port uint32 }
func (DeviceStateService) MarshalBinary ¶
func (m DeviceStateService) MarshalBinary() ([]byte, error)
func (DeviceStateService) Size ¶
func (m DeviceStateService) Size() uint16
func (DeviceStateService) String ¶
func (m DeviceStateService) String() string
func (DeviceStateService) Type ¶
func (m DeviceStateService) Type() uint16
func (*DeviceStateService) UnmarshalBinary ¶
func (m *DeviceStateService) UnmarshalBinary(data []byte) error
type DeviceStateVersion ¶
func (DeviceStateVersion) MarshalBinary ¶
func (m DeviceStateVersion) MarshalBinary() ([]byte, error)
func (DeviceStateVersion) Size ¶
func (m DeviceStateVersion) Size() uint16
func (DeviceStateVersion) String ¶
func (m DeviceStateVersion) String() string
func (DeviceStateVersion) Type ¶
func (m DeviceStateVersion) Type() uint16
func (*DeviceStateVersion) UnmarshalBinary ¶
func (m *DeviceStateVersion) UnmarshalBinary(data []byte) error
type DeviceStateWifiFirmware ¶
type DeviceStateWifiFirmware struct { Build uint64 Reserved1 [8]byte VersionMinor uint16 VersionMajor uint16 }
func (DeviceStateWifiFirmware) MarshalBinary ¶
func (m DeviceStateWifiFirmware) MarshalBinary() ([]byte, error)
func (DeviceStateWifiFirmware) Size ¶
func (m DeviceStateWifiFirmware) Size() uint16
func (DeviceStateWifiFirmware) String ¶
func (m DeviceStateWifiFirmware) String() string
func (DeviceStateWifiFirmware) Type ¶
func (m DeviceStateWifiFirmware) Type() uint16
func (*DeviceStateWifiFirmware) UnmarshalBinary ¶
func (m *DeviceStateWifiFirmware) UnmarshalBinary(data []byte) error
type DeviceStateWifiInfo ¶
func (DeviceStateWifiInfo) MarshalBinary ¶
func (m DeviceStateWifiInfo) MarshalBinary() ([]byte, error)
func (DeviceStateWifiInfo) Size ¶
func (m DeviceStateWifiInfo) Size() uint16
func (DeviceStateWifiInfo) String ¶
func (m DeviceStateWifiInfo) String() string
func (DeviceStateWifiInfo) Type ¶
func (m DeviceStateWifiInfo) Type() uint16
func (*DeviceStateWifiInfo) UnmarshalBinary ¶
func (m *DeviceStateWifiInfo) UnmarshalBinary(data []byte) error
type Frame ¶
type Frame struct { Size uint16 // 16 - Size of entire message in bytes including this field Origin uint8 // 2 - Message origin indicator: must be zero (0) Tagged bool // 1 - Determines usage of the Frame Address target field Addressable bool // 1 - Must be 1 Protocol uint16 // 12 - Must be 1024 (decimal) Source uint32 // 32 - Source identifier: unique value set by the client, used by responses }
Frame contains the size of the message, LIFX protocol, the usage of the target field (in the FrameAddress), and source identifier
type FrameAddress ¶
type FrameAddress struct { Target [8]uint8 // 64 - 6 byte device address (MAC address) or zero (0) means all devices. The last two bytes should be 0 bytes. AcknowledgementRequired bool // 1 - Acknowledgement message required ResponseRequired bool // 1 - Response message required Sequence uint8 // 8 - Wrap around message sequence number // contains filtered or unexported fields }
FrameAddress contains routing information
type Header ¶
type Header struct { Frame Frame FrameAddress FrameAddress ProtocolHeader ProtocolHeader }
Header is the non payload portion of the LIFX LAN Protocol packet https://lan.developer.lifx.com/v2.0/docs/header-description
func (Header) MarshalBinary ¶
MarshalBinary will convert the header into a proper binary format Note that the size is not set and must be done before marshaling
func (*Header) UnmarshalBinary ¶
UnmarshalBinary will convert data read from the network back into a header
type LightGet ¶
type LightGet struct{}
func (LightGet) MarshalBinary ¶
func (*LightGet) UnmarshalBinary ¶
type LightGetInfrared ¶
type LightGetInfrared struct{}
func (LightGetInfrared) MarshalBinary ¶
func (m LightGetInfrared) MarshalBinary() ([]byte, error)
func (LightGetInfrared) Size ¶
func (m LightGetInfrared) Size() uint16
func (LightGetInfrared) String ¶
func (m LightGetInfrared) String() string
func (LightGetInfrared) Type ¶
func (m LightGetInfrared) Type() uint16
func (*LightGetInfrared) UnmarshalBinary ¶
func (m *LightGetInfrared) UnmarshalBinary(data []byte) error
type LightGetPower ¶
type LightGetPower struct{}
func (LightGetPower) MarshalBinary ¶
func (m LightGetPower) MarshalBinary() ([]byte, error)
func (LightGetPower) Size ¶
func (m LightGetPower) Size() uint16
func (LightGetPower) String ¶
func (m LightGetPower) String() string
func (LightGetPower) Type ¶
func (m LightGetPower) Type() uint16
func (*LightGetPower) UnmarshalBinary ¶
func (m *LightGetPower) UnmarshalBinary(data []byte) error
type LightSetColor ¶
func (LightSetColor) MarshalBinary ¶
func (m LightSetColor) MarshalBinary() ([]byte, error)
func (LightSetColor) Size ¶
func (m LightSetColor) Size() uint16
func (LightSetColor) String ¶
func (m LightSetColor) String() string
func (LightSetColor) Type ¶
func (m LightSetColor) Type() uint16
func (*LightSetColor) UnmarshalBinary ¶
func (m *LightSetColor) UnmarshalBinary(data []byte) error
type LightSetInfrared ¶
type LightSetInfrared struct {
Brightness uint16
}
func (LightSetInfrared) MarshalBinary ¶
func (m LightSetInfrared) MarshalBinary() ([]byte, error)
func (LightSetInfrared) Size ¶
func (m LightSetInfrared) Size() uint16
func (LightSetInfrared) String ¶
func (m LightSetInfrared) String() string
func (LightSetInfrared) Type ¶
func (m LightSetInfrared) Type() uint16
func (*LightSetInfrared) UnmarshalBinary ¶
func (m *LightSetInfrared) UnmarshalBinary(data []byte) error
type LightSetPower ¶
func (LightSetPower) MarshalBinary ¶
func (m LightSetPower) MarshalBinary() ([]byte, error)
func (LightSetPower) Size ¶
func (m LightSetPower) Size() uint16
func (LightSetPower) String ¶
func (m LightSetPower) String() string
func (LightSetPower) Type ¶
func (m LightSetPower) Type() uint16
func (*LightSetPower) UnmarshalBinary ¶
func (m *LightSetPower) UnmarshalBinary(data []byte) error
type LightSetWaveform ¶
type LightSetWaveform struct { Reserved0 [1]byte Transient bool Color LightHsbk Period uint32 Cycles float32 SkewRatio int16 Waveform LightWaveform }
func (LightSetWaveform) MarshalBinary ¶
func (m LightSetWaveform) MarshalBinary() ([]byte, error)
func (LightSetWaveform) Size ¶
func (m LightSetWaveform) Size() uint16
func (LightSetWaveform) String ¶
func (m LightSetWaveform) String() string
func (LightSetWaveform) Type ¶
func (m LightSetWaveform) Type() uint16
func (*LightSetWaveform) UnmarshalBinary ¶
func (m *LightSetWaveform) UnmarshalBinary(data []byte) error
type LightSetWaveformOptional ¶
type LightSetWaveformOptional struct { Reserved0 [1]byte Transient bool Color LightHsbk Period uint32 Cycles float32 SkewRatio int16 Waveform LightWaveform SetHue bool SetSaturation bool SetBrightness bool SetKelvin bool }
func (LightSetWaveformOptional) MarshalBinary ¶
func (m LightSetWaveformOptional) MarshalBinary() ([]byte, error)
func (LightSetWaveformOptional) Size ¶
func (m LightSetWaveformOptional) Size() uint16
func (LightSetWaveformOptional) String ¶
func (m LightSetWaveformOptional) String() string
func (LightSetWaveformOptional) Type ¶
func (m LightSetWaveformOptional) Type() uint16
func (*LightSetWaveformOptional) UnmarshalBinary ¶
func (m *LightSetWaveformOptional) UnmarshalBinary(data []byte) error
type LightState ¶
type LightState struct { Color LightHsbk Reserved1 [2]byte Power uint16 Label [32]byte Reserved4 [8]byte }
func (LightState) MarshalBinary ¶
func (m LightState) MarshalBinary() ([]byte, error)
func (LightState) Size ¶
func (m LightState) Size() uint16
func (LightState) String ¶
func (m LightState) String() string
func (LightState) Type ¶
func (m LightState) Type() uint16
func (*LightState) UnmarshalBinary ¶
func (m *LightState) UnmarshalBinary(data []byte) error
type LightStateInfrared ¶
type LightStateInfrared struct {
Brightness uint16
}
func (LightStateInfrared) MarshalBinary ¶
func (m LightStateInfrared) MarshalBinary() ([]byte, error)
func (LightStateInfrared) Size ¶
func (m LightStateInfrared) Size() uint16
func (LightStateInfrared) String ¶
func (m LightStateInfrared) String() string
func (LightStateInfrared) Type ¶
func (m LightStateInfrared) Type() uint16
func (*LightStateInfrared) UnmarshalBinary ¶
func (m *LightStateInfrared) UnmarshalBinary(data []byte) error
type LightStatePower ¶
type LightStatePower struct {
Level uint16
}
func (LightStatePower) MarshalBinary ¶
func (m LightStatePower) MarshalBinary() ([]byte, error)
func (LightStatePower) Size ¶
func (m LightStatePower) Size() uint16
func (LightStatePower) String ¶
func (m LightStatePower) String() string
func (LightStatePower) Type ¶
func (m LightStatePower) Type() uint16
func (*LightStatePower) UnmarshalBinary ¶
func (m *LightStatePower) UnmarshalBinary(data []byte) error
type LightWaveform ¶
type LightWaveform uint8
LightWaveform is generated from protocol enums
func (LightWaveform) String ¶
func (e LightWaveform) String() string
type Message ¶
Message is a LIFX LAN Protocol packet
func Receive ¶
Receive attempts to get a single message from the specified port If timed out, returns no message and no error
func (Message) MarshalBinary ¶
MarshalBinary encodes the message into binary
type MultiZoneApplicationRequest ¶
type MultiZoneApplicationRequest uint8
MultiZoneApplicationRequest is generated from protocol enums
func (MultiZoneApplicationRequest) String ¶
func (e MultiZoneApplicationRequest) String() string
type MultiZoneEffectParameter ¶
type MultiZoneEffectParameter struct { Parameter0 uint32 Parameter1 uint32 Parameter2 uint32 Parameter3 uint32 Parameter4 uint32 Parameter5 uint32 Parameter6 uint32 Parameter7 uint32 }
func (MultiZoneEffectParameter) String ¶
func (f MultiZoneEffectParameter) String() string
type MultiZoneEffectSettings ¶
type MultiZoneEffectSettings struct { Instanceid uint32 Type MultiZoneEffectType Speed uint32 Duration uint64 Parameter MultiZoneEffectParameter }
func (MultiZoneEffectSettings) String ¶
func (f MultiZoneEffectSettings) String() string
type MultiZoneEffectType ¶
type MultiZoneEffectType uint8
MultiZoneEffectType is generated from protocol enums
func (MultiZoneEffectType) String ¶
func (e MultiZoneEffectType) String() string
type MultiZoneExtendedApplicationRequest ¶
type MultiZoneExtendedApplicationRequest uint8
MultiZoneExtendedApplicationRequest is generated from protocol enums
func (MultiZoneExtendedApplicationRequest) String ¶
func (e MultiZoneExtendedApplicationRequest) String() string
type MultiZoneExtendedGetColorZones ¶
type MultiZoneExtendedGetColorZones struct{}
func (MultiZoneExtendedGetColorZones) MarshalBinary ¶
func (m MultiZoneExtendedGetColorZones) MarshalBinary() ([]byte, error)
func (MultiZoneExtendedGetColorZones) Size ¶
func (m MultiZoneExtendedGetColorZones) Size() uint16
func (MultiZoneExtendedGetColorZones) String ¶
func (m MultiZoneExtendedGetColorZones) String() string
func (MultiZoneExtendedGetColorZones) Type ¶
func (m MultiZoneExtendedGetColorZones) Type() uint16
func (*MultiZoneExtendedGetColorZones) UnmarshalBinary ¶
func (m *MultiZoneExtendedGetColorZones) UnmarshalBinary(data []byte) error
type MultiZoneExtendedSetColorZones ¶
type MultiZoneExtendedSetColorZones struct { Duration uint32 Apply MultiZoneExtendedApplicationRequest Index uint16 ColorsCount uint8 Colors [82]LightHsbk }
func (MultiZoneExtendedSetColorZones) MarshalBinary ¶
func (m MultiZoneExtendedSetColorZones) MarshalBinary() ([]byte, error)
func (MultiZoneExtendedSetColorZones) Size ¶
func (m MultiZoneExtendedSetColorZones) Size() uint16
func (MultiZoneExtendedSetColorZones) String ¶
func (m MultiZoneExtendedSetColorZones) String() string
func (MultiZoneExtendedSetColorZones) Type ¶
func (m MultiZoneExtendedSetColorZones) Type() uint16
func (*MultiZoneExtendedSetColorZones) UnmarshalBinary ¶
func (m *MultiZoneExtendedSetColorZones) UnmarshalBinary(data []byte) error
type MultiZoneExtendedStateMultiZone ¶
type MultiZoneExtendedStateMultiZone struct { Count uint16 Index uint16 ColorsCount uint8 Colors [82]LightHsbk }
func (MultiZoneExtendedStateMultiZone) MarshalBinary ¶
func (m MultiZoneExtendedStateMultiZone) MarshalBinary() ([]byte, error)
func (MultiZoneExtendedStateMultiZone) Size ¶
func (m MultiZoneExtendedStateMultiZone) Size() uint16
func (MultiZoneExtendedStateMultiZone) String ¶
func (m MultiZoneExtendedStateMultiZone) String() string
func (MultiZoneExtendedStateMultiZone) Type ¶
func (m MultiZoneExtendedStateMultiZone) Type() uint16
func (*MultiZoneExtendedStateMultiZone) UnmarshalBinary ¶
func (m *MultiZoneExtendedStateMultiZone) UnmarshalBinary(data []byte) error
type MultiZoneGetColorZones ¶
func (MultiZoneGetColorZones) MarshalBinary ¶
func (m MultiZoneGetColorZones) MarshalBinary() ([]byte, error)
func (MultiZoneGetColorZones) Size ¶
func (m MultiZoneGetColorZones) Size() uint16
func (MultiZoneGetColorZones) String ¶
func (m MultiZoneGetColorZones) String() string
func (MultiZoneGetColorZones) Type ¶
func (m MultiZoneGetColorZones) Type() uint16
func (*MultiZoneGetColorZones) UnmarshalBinary ¶
func (m *MultiZoneGetColorZones) UnmarshalBinary(data []byte) error
type MultiZoneGetEffect ¶
type MultiZoneGetEffect struct{}
func (MultiZoneGetEffect) MarshalBinary ¶
func (m MultiZoneGetEffect) MarshalBinary() ([]byte, error)
func (MultiZoneGetEffect) Size ¶
func (m MultiZoneGetEffect) Size() uint16
func (MultiZoneGetEffect) String ¶
func (m MultiZoneGetEffect) String() string
func (MultiZoneGetEffect) Type ¶
func (m MultiZoneGetEffect) Type() uint16
func (*MultiZoneGetEffect) UnmarshalBinary ¶
func (m *MultiZoneGetEffect) UnmarshalBinary(data []byte) error
type MultiZoneSetColorZones ¶
type MultiZoneSetColorZones struct { StartIndex uint8 EndIndex uint8 Color LightHsbk Duration uint32 Apply MultiZoneApplicationRequest }
func (MultiZoneSetColorZones) MarshalBinary ¶
func (m MultiZoneSetColorZones) MarshalBinary() ([]byte, error)
func (MultiZoneSetColorZones) Size ¶
func (m MultiZoneSetColorZones) Size() uint16
func (MultiZoneSetColorZones) String ¶
func (m MultiZoneSetColorZones) String() string
func (MultiZoneSetColorZones) Type ¶
func (m MultiZoneSetColorZones) Type() uint16
func (*MultiZoneSetColorZones) UnmarshalBinary ¶
func (m *MultiZoneSetColorZones) UnmarshalBinary(data []byte) error
type MultiZoneSetEffect ¶
type MultiZoneSetEffect struct {
Settings MultiZoneEffectSettings
}
func (MultiZoneSetEffect) MarshalBinary ¶
func (m MultiZoneSetEffect) MarshalBinary() ([]byte, error)
func (MultiZoneSetEffect) Size ¶
func (m MultiZoneSetEffect) Size() uint16
func (MultiZoneSetEffect) String ¶
func (m MultiZoneSetEffect) String() string
func (MultiZoneSetEffect) Type ¶
func (m MultiZoneSetEffect) Type() uint16
func (*MultiZoneSetEffect) UnmarshalBinary ¶
func (m *MultiZoneSetEffect) UnmarshalBinary(data []byte) error
type MultiZoneStateEffect ¶
type MultiZoneStateEffect struct {
Settings MultiZoneEffectSettings
}
func (MultiZoneStateEffect) MarshalBinary ¶
func (m MultiZoneStateEffect) MarshalBinary() ([]byte, error)
func (MultiZoneStateEffect) Size ¶
func (m MultiZoneStateEffect) Size() uint16
func (MultiZoneStateEffect) String ¶
func (m MultiZoneStateEffect) String() string
func (MultiZoneStateEffect) Type ¶
func (m MultiZoneStateEffect) Type() uint16
func (*MultiZoneStateEffect) UnmarshalBinary ¶
func (m *MultiZoneStateEffect) UnmarshalBinary(data []byte) error
type MultiZoneStateMultiZone ¶
func (MultiZoneStateMultiZone) MarshalBinary ¶
func (m MultiZoneStateMultiZone) MarshalBinary() ([]byte, error)
func (MultiZoneStateMultiZone) Size ¶
func (m MultiZoneStateMultiZone) Size() uint16
func (MultiZoneStateMultiZone) String ¶
func (m MultiZoneStateMultiZone) String() string
func (MultiZoneStateMultiZone) Type ¶
func (m MultiZoneStateMultiZone) Type() uint16
func (*MultiZoneStateMultiZone) UnmarshalBinary ¶
func (m *MultiZoneStateMultiZone) UnmarshalBinary(data []byte) error
type MultiZoneStateZone ¶
func (MultiZoneStateZone) MarshalBinary ¶
func (m MultiZoneStateZone) MarshalBinary() ([]byte, error)
func (MultiZoneStateZone) Size ¶
func (m MultiZoneStateZone) Size() uint16
func (MultiZoneStateZone) String ¶
func (m MultiZoneStateZone) String() string
func (MultiZoneStateZone) Type ¶
func (m MultiZoneStateZone) Type() uint16
func (*MultiZoneStateZone) UnmarshalBinary ¶
func (m *MultiZoneStateZone) UnmarshalBinary(data []byte) error
type Payloader ¶
type Payloader interface { Size() uint16 Type() uint16 MarshalBinary() ([]byte, error) UnmarshalBinary([]byte) error String() string }
Payloader defines how a payload can be handled by the Message
func PayloadByType ¶
type ProtocolHeader ¶
type ProtocolHeader struct { Type uint16 // 16 - Message type determines the payload being used // contains filtered or unexported fields }
ProtocolHeader contains a message type
type TileAccelMeas ¶
func (TileAccelMeas) String ¶
func (f TileAccelMeas) String() string
type TileBufferRect ¶
func (TileBufferRect) String ¶
func (f TileBufferRect) String() string
type TileEffectParameter ¶
type TileEffectParameter struct { Parameter0 uint32 Parameter1 uint32 Parameter2 uint32 Parameter3 uint32 Parameter4 uint32 Parameter5 uint32 Parameter6 uint32 Parameter7 uint32 }
func (TileEffectParameter) String ¶
func (f TileEffectParameter) String() string
type TileEffectSettings ¶
type TileEffectSettings struct { Instanceid uint32 Type TileEffectType Speed uint32 Duration uint64 Reserved0 uint32 Reserved1 uint32 Parameter TileEffectParameter PaletteCount uint8 Palette [16]LightHsbk }
func (TileEffectSettings) String ¶
func (f TileEffectSettings) String() string
type TileEffectType ¶
type TileEffectType uint8
TileEffectType is generated from protocol enums
func (TileEffectType) String ¶
func (e TileEffectType) String() string
type TileGet64 ¶
type TileGet64 struct { TileIndex uint8 Length uint8 Rect TileBufferRect }
func (TileGet64) MarshalBinary ¶
func (*TileGet64) UnmarshalBinary ¶
type TileGetDeviceChain ¶
type TileGetDeviceChain struct{}
func (TileGetDeviceChain) MarshalBinary ¶
func (m TileGetDeviceChain) MarshalBinary() ([]byte, error)
func (TileGetDeviceChain) Size ¶
func (m TileGetDeviceChain) Size() uint16
func (TileGetDeviceChain) String ¶
func (m TileGetDeviceChain) String() string
func (TileGetDeviceChain) Type ¶
func (m TileGetDeviceChain) Type() uint16
func (*TileGetDeviceChain) UnmarshalBinary ¶
func (m *TileGetDeviceChain) UnmarshalBinary(data []byte) error
type TileGetEffect ¶
func (TileGetEffect) MarshalBinary ¶
func (m TileGetEffect) MarshalBinary() ([]byte, error)
func (TileGetEffect) Size ¶
func (m TileGetEffect) Size() uint16
func (TileGetEffect) String ¶
func (m TileGetEffect) String() string
func (TileGetEffect) Type ¶
func (m TileGetEffect) Type() uint16
func (*TileGetEffect) UnmarshalBinary ¶
func (m *TileGetEffect) UnmarshalBinary(data []byte) error
type TileSet64 ¶
type TileSet64 struct { TileIndex uint8 Length uint8 Rect TileBufferRect Duration uint32 Colors [64]LightHsbk }
func (TileSet64) MarshalBinary ¶
func (*TileSet64) UnmarshalBinary ¶
type TileSetEffect ¶
type TileSetEffect struct { Reserved0 uint8 Reserved1 uint8 Settings TileEffectSettings }
func (TileSetEffect) MarshalBinary ¶
func (m TileSetEffect) MarshalBinary() ([]byte, error)
func (TileSetEffect) Size ¶
func (m TileSetEffect) Size() uint16
func (TileSetEffect) String ¶
func (m TileSetEffect) String() string
func (TileSetEffect) Type ¶
func (m TileSetEffect) Type() uint16
func (*TileSetEffect) UnmarshalBinary ¶
func (m *TileSetEffect) UnmarshalBinary(data []byte) error
type TileSetUserPosition ¶
func (TileSetUserPosition) MarshalBinary ¶
func (m TileSetUserPosition) MarshalBinary() ([]byte, error)
func (TileSetUserPosition) Size ¶
func (m TileSetUserPosition) Size() uint16
func (TileSetUserPosition) String ¶
func (m TileSetUserPosition) String() string
func (TileSetUserPosition) Type ¶
func (m TileSetUserPosition) Type() uint16
func (*TileSetUserPosition) UnmarshalBinary ¶
func (m *TileSetUserPosition) UnmarshalBinary(data []byte) error
type TileState64 ¶
type TileState64 struct { TileIndex uint8 Rect TileBufferRect Colors [64]LightHsbk }
func (TileState64) MarshalBinary ¶
func (m TileState64) MarshalBinary() ([]byte, error)
func (TileState64) Size ¶
func (m TileState64) Size() uint16
func (TileState64) String ¶
func (m TileState64) String() string
func (TileState64) Type ¶
func (m TileState64) Type() uint16
func (*TileState64) UnmarshalBinary ¶
func (m *TileState64) UnmarshalBinary(data []byte) error
type TileStateDevice ¶
type TileStateDevice struct { AccelMeas TileAccelMeas UserX float32 UserY float32 Width uint8 Height uint8 DeviceVersion DeviceStateVersion Firmware DeviceStateHostFirmware }
func (TileStateDevice) String ¶
func (f TileStateDevice) String() string
type TileStateDeviceChain ¶
type TileStateDeviceChain struct { StartIndex uint8 TileDevices [16]TileStateDevice TileDevicesCount uint8 }
func (TileStateDeviceChain) MarshalBinary ¶
func (m TileStateDeviceChain) MarshalBinary() ([]byte, error)
func (TileStateDeviceChain) Size ¶
func (m TileStateDeviceChain) Size() uint16
func (TileStateDeviceChain) String ¶
func (m TileStateDeviceChain) String() string
func (TileStateDeviceChain) Type ¶
func (m TileStateDeviceChain) Type() uint16
func (*TileStateDeviceChain) UnmarshalBinary ¶
func (m *TileStateDeviceChain) UnmarshalBinary(data []byte) error
type TileStateEffect ¶
type TileStateEffect struct { Reserved0 uint8 Settings TileEffectSettings }
func (TileStateEffect) MarshalBinary ¶
func (m TileStateEffect) MarshalBinary() ([]byte, error)
func (TileStateEffect) Size ¶
func (m TileStateEffect) Size() uint16
func (TileStateEffect) String ¶
func (m TileStateEffect) String() string
func (TileStateEffect) Type ¶
func (m TileStateEffect) Type() uint16
func (*TileStateEffect) UnmarshalBinary ¶
func (m *TileStateEffect) UnmarshalBinary(data []byte) error