Messages

Asset Tracker Template

tags
Asset Tracker Template

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 (0-255)
    • green: Green component (0-255)
    • blue: Blue component (0-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 (-1 for 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;
};