The LED module uses the zbus channel led_chan to receive control commands. Other modules can publish messages to this channel to control the LED behavior.
The module accepts messages with the following parameters:
-
Color values:
red: Red component, from 0 to 255.green: Green component, from 0 to 255.blue: Blue component, from 0 to 255.
-
Timing parameters:
duration_on_msec: How long the LED stays on in milliseconds.duration_off_msec: How long the LED stays off in milliseconds.repetitions: Number of blink cycles, where-1means infinite blinking.
The message structure is defined in led.h:
struct led_msg {
enum led_msg_type type;
/** RGB values (0 to 255) */
uint8_t red;
uint8_t green;
uint8_t blue;
/** Duration of the RGB on/off cycle */
uint32_t duration_on_msec;
uint32_t duration_off_msec;
/** Number of on/off cycles (-1 indicates forever) */
int repetitions;
};