From 59644c4b9f7b242099fea64c56bbda0850c58573 Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sat, 8 Aug 2015 00:57:19 -0700 Subject: [PATCH 1/2] document SetWaveform, mostly based on Ruby SDK --- Protocol.md | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/Protocol.md b/Protocol.md index eb57250..ba34adf 100644 --- a/Protocol.md +++ b/Protocol.md @@ -300,7 +300,7 @@ payload float signal; // LE int tx; // LE int rx; // LE - short mcu_temperature; + short mcu_temperature; // LE; in hundredths of a degree } ``` @@ -759,25 +759,46 @@ beyond that seems to be very blue. ### 0x67 - Set waveform -Sent to a bulb to configure its [waveform?]. [Advanced topic, needs expansion.] +Sent to a bulb to configure its "waveform"; i. e. a pattern of +alternation between two colors. One color is the original color, and +the other color is specified in this message. #### Payload (21 bytes) ```c payload { - byte stream; + byte stream; // Unusued; set to 0 byte transient; uint16 hue; // LE uint16 saturation; // LE uint16 brightness; // LE uint16 kelvin; // LE - uint32 period; // LE? - float cycles; // LE? - uint16 duty_cycles; - byte waveform; + uint32 period; // LE; length of one cycle in milliseconds + float cycles; // LE; number of times to cycle through pattern before stopping + int16 duty_cycle; // LE + WAVEFORM waveform; +} + +enum WAVEFORM : byte +{ + SAW = 0, + SINE = 1, + HALF_SINE = 2, + TRIANGLE = 3, + PULSE = 4 } ``` +If _transient_ is 1, the color returns to the original color of the +light, after the specified number of _cycles_. If _transient_ is +0, the light is left set to _color_ after the specified number of +_cycles_. + +If _duty_cycle_ is 0, an equal amount of time is spent on the original +color and the new _color_. If _duty_cycle_ is positive, more time is +spent on the original color. If _duty_cycle_ is negative, more time +is spent on the new color. + ### 0x68 - Set dim (absolute) Sent to a bulb to set its dim level. From b6daf846965f5017758e99864a41eb2b939da68d Mon Sep 17 00:00:00 2001 From: Patrick Pelletier Date: Sat, 8 Aug 2015 16:30:41 -0700 Subject: [PATCH 2/2] clarify mcu_temperature --- Protocol.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Protocol.md b/Protocol.md index ba34adf..100831f 100644 --- a/Protocol.md +++ b/Protocol.md @@ -300,7 +300,7 @@ payload float signal; // LE int tx; // LE int rx; // LE - short mcu_temperature; // LE; in hundredths of a degree + short mcu_temperature; // LE; in hundredths of a degree Celsius } ```