Enum lifx_core::Message[][src]

pub enum Message {
    GetService,
    StateService {
        port: u32,
        service: Service,
    },
    GetHostInfo,
    StateHostInfo {
        signal: f32,
        tx: u32,
        rx: u32,
        reserved: i16,
    },
    GetHostFirmware,
    StateHostFirmware {
        build: u64,
        reserved: u64,
        version: u32,
    },
    GetWifiInfo,
    StateWifiInfo {
        signal: f32,
        tx: u32,
        rx: u32,
        reserved: i16,
    },
    GetWifiFirmware,
    StateWifiFirmware {
        build: u64,
        reserved: u64,
        version: u32,
    },
    GetPower,
    SetPower {
        level: PowerLevel,
    },
    StatePower {
        level: PowerLevel,
    },
    GetLabel,
    SetLabel {
        label: LifxString,
    },
    StateLabel {
        label: LifxString,
    },
    GetVersion,
    StateVersion {
        vendor: u32,
        product: u32,
        version: u32,
    },
    GetInfo,
    StateInfo {
        time: u64,
        uptime: u64,
        downtime: u64,
    },
    Acknowledgement {
        seq: u8,
    },
    GetLocation,
    SetLocation {
        location: LifxIdent,
        label: LifxString,
        updated_at: u64,
    },
    StateLocation {
        location: LifxIdent,
        label: LifxString,
        updated_at: u64,
    },
    GetGroup,
    SetGroup {
        group: LifxIdent,
        label: LifxString,
        updated_at: u64,
    },
    StateGroup {
        group: LifxIdent,
        label: LifxString,
        updated_at: u64,
    },
    EchoRequest {
        payload: EchoPayload,
    },
    EchoResponse {
        payload: EchoPayload,
    },
    LightGet,
    LightSetColor {
        reserved: u8,
        color: HSBK,
        duration: u32,
    },
    SetWaveform {
        reserved: u8,
        transient: bool,
        color: HSBK,
        period: u32,
        cycles: f32,
        skew_ratio: i16,
        waveform: Waveform,
    },
    LightState {
        color: HSBK,
        reserved: i16,
        power: PowerLevel,
        label: LifxString,
        reserved2: u64,
    },
    LightGetPower,
    LightSetPower {
        level: u16,
        duration: u32,
    },
    LightStatePower {
        level: u16,
    },
    SetWaveformOptional {
        reserved: u8,
        transient: bool,
        color: HSBK,
        period: u32,
        cycles: f32,
        skew_ratio: i16,
        waveform: Waveform,
        set_hue: bool,
        set_saturation: bool,
        set_brightness: bool,
        set_kelvin: bool,
    },
    LightGetInfrared,
    LightStateInfrared {
        brightness: u16,
    },
    LightSetInfrared {
        brightness: u16,
    },
    SetColorZones {
        start_index: u8,
        end_index: u8,
        color: HSBK,
        duration: u32,
        apply: ApplicationRequest,
    },
    GetColorZones {
        start_index: u8,
        end_index: u8,
    },
    StateZone {
        count: u8,
        index: u8,
        color: HSBK,
    },
    StateMultiZone {
        count: u8,
        index: u8,
        color0: HSBK,
        color1: HSBK,
        color2: HSBK,
        color3: HSBK,
        color4: HSBK,
        color5: HSBK,
        color6: HSBK,
        color7: HSBK,
    },
}

Decoded LIFX Messages

This enum lists all of the LIFX message types known to this library.

Note that other message types exist, but are not officially documented (and so are not available here).

Variants

GetService - 2

Sent by a client to acquire responses from all devices on the local network. No payload is required. Causes the devices to transmit a StateService message.

StateService - 3

Response to Message::GetService message.

Fields of StateService

Port number of the light. If the service is temporarily unavailable, then the port value will be 0.

unsigned 8-bit integer, maps to Service

GetHostInfo - 12

Get Host MCU information. No payload is required. Causes the device to transmit a Message::StateHostInfo message.

StateHostInfo - 13

Response to Message::GetHostInfo message.

Provides host MCU information.

Fields of StateHostInfo

radio receive signal strength in miliWatts

Bytes transmitted since power on

Bytes received since power on

GetHostFirmware - 14

Gets Host MCU firmware information. No payload is required. Causes the device to transmit a Message::StateHostFirmware message.

StateHostFirmware - 15

Response to Message::GetHostFirmware message.

Provides host firmware information.

Fields of StateHostFirmware

Firmware build time (absolute time in nanoseconds since epoch)

Firmware version

GetWifiInfo - 16

Get Wifi subsystem information. No payload is required. Causes the device to transmit a Message::StateWifiInfo message.

StateWifiInfo - 17

Response to Message::GetWifiInfo message.

Provides Wifi subsystem information.

Fields of StateWifiInfo

Radio receive signal strength in mw

bytes transmitted since power on

bytes received since power on

GetWifiFirmware - 18

Get Wifi subsystem firmware. No payload is required. Causes the device to transmit a Message::StateWifiFirmware message.

StateWifiFirmware - 19
Response to Message::GetWifiFirmware message.

Provides Wifi subsystem information.

Fields of StateWifiFirmware

firmware build time (absolute time in nanoseconds since epoch)

firmware version

GetPower - 20

Get device power level. No payload is required. Causes the device to transmit a Message::StatePower message

SetPower - 21

Set device power level.

Fields of SetPower

normally a u16, but only 0 and 65535 are supported.

Zero implies standby and non-zero sets a corresponding power draw level.

StatePower - 22

Response to Message::GetPower message.

Provides device power level.

Fields of StatePower

GetLabel - 23

Get device label. No payload is required. Causes the device to transmit a Message::StateLabel message.

SetLabel - 24

Set the device label text.

Fields of SetLabel

StateLabel - 25

Response to Message::GetLabel message.

Provides device label.

Fields of StateLabel

GetVersion - 32

Get the hardware version. No payload is required. Causes the device to transmit a Message::StateVersion message.

StateVersion - 33

Response to Message::GetVersion message.

Provides the hardware version of the device.

Fields of StateVersion

vendor ID

product ID

hardware version

GetInfo - 34

Get run-time information. No payload is required. Causes the device to transmit a Message::StateInfo message.

StateInfo - 35

Response to Message::GetInfo message.

Provides run-time information of device.

Fields of StateInfo

current time (absolute time in nanoseconds since epoch)

time since last power on (relative time in nanoseconds)

last power off period (5 second accuracy, in nanoseconds)

Acknowledgement - 45

Response to any message sent with ack_required set to 1. See message header frame address.

(Note that technically this message has no payload, but the frame sequence number is stored here for convenience).

Fields of Acknowledgement

GetLocation - 48

Ask the bulb to return its location information. No payload is required. Causes the device to transmit a Message::StateLocation message.

SetLocation -- 49

Set the device location

Fields of SetLocation

GUID byte array

text label for location

UTC timestamp of last label update in nanoseconds

StateLocation - 50

Device location.

Fields of StateLocation

GetGroup - 51

Ask the bulb to return its group membership information. No payload is required. Causes the device to transmit a Message::StateGroup message.

SetGroup - 52

Set the device group

Fields of SetGroup

StateGroup - 53

Device group.

Fields of StateGroup

EchoRequest - 58

Request an arbitrary payload be echoed back. Causes the device to transmit an Message::EchoResponse message.

Fields of EchoRequest

EchoResponse - 59

Response to Message::EchoRequest message.

Echo response with payload sent in the EchoRequest.

Fields of EchoResponse

Get - 101

Sent by a client to obtain the light state. No payload required. Causes the device to transmit a Message::LightState message.

SetColor - 102

Sent by a client to change the light state.

If the Frame Address res_required field is set to one (1) then the device will transmit a State message.

Fields of LightSetColor

Color in HSBK

Color transition time in milliseconds

SetWaveform - 103

Apply an effect to the bulb.

Fields of SetWaveform

Duration of a cycle in milliseconds

Number of cycles

Waveform Skew, [-32768, 32767] scaled to [0, 1].

Waveform to use for transition.

State - 107

Sent by a device to provide the current light state.

Fields of LightState

GetPower - 116

Sent by a client to obtain the power level. No payload required. Causes the device to transmit a StatePower message.

SetPower - 117

Sent by a client to change the light power level.

Field Type level unsigned 16-bit integer duration unsigned 32-bit integer The power level must be either 0 or 65535.

The duration is the power level transition time in milliseconds.

If the Frame Address res_required field is set to one (1) then the device will transmit a StatePower message.

Fields of LightSetPower

StatePower - 118

Sent by a device to provide the current power level.

Field Type level unsigned 16-bit integer

Fields of LightStatePower

SetWaveformOptional - 119

Apply an effect to the bulb.

Fields of SetWaveformOptional

Duration of a cycle in milliseconds

Number of cycles

GetInfrared - 120

Gets the current maximum power level of the Infraed channel

StateInfrared - 121

Indicates the current maximum setting for the infrared channel.

Fields of LightStateInfrared

SetInfrared -- 122

Set the current maximum brightness for the infrared channel.

Fields of LightSetInfrared

SetColorZones - 501

This message is used for changing the color of either a single or multiple zones. The changes are stored in a buffer and are only applied once a message with either ApplicationRequest::Apply or ApplicationRequest::ApplyOnly set.

Fields of SetColorZones

GetColorZones - 502

GetColorZones is used to request the zone colors for a range of zones. The bulb will respond with either Message::StateZone or Message::StateMultiZone messages as required to cover the requested range. The bulb may send state messages that cover more than the requested zones. Any zones outside the requested indexes will still contain valid values at the time the message was sent.

Fields of GetColorZones

StateZone - 503 The StateZone message represents the state of a single zone with the index field indicating which zone is represented. The count field contains the count of the total number of zones available on the device.

Fields of StateZone

StateMultiZone - 506

The StateMultiZone message represents the state of eight consecutive zones in a single message. As in the StateZone message the count field represents the count of the total number of zones available on the device. In this message the index field represents the index of color0 and the rest of the colors are the consecutive zones thus the index of the color_n zone will be index + n.

Fields of StateMultiZone

Methods

impl Message
[src]

Tries to parse the payload in a RawMessage, based on its message type.

Trait Implementations

impl Clone for Message
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Message
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Message

impl Sync for Message