LED
The LED API enables real-time control of the RGB LEDs located at the back of the displays, providing visual notifications and status indicators within the costume. This API supports priority-based control and color management for both left and right LEDs.
Brightness Configuration
You can change LED brightness by following this guide.
Protocol Buffer Definition
syntax = "proto3";
import "google/protobuf/empty.proto";
service LedService {
// Streams LED color settings with priority control
rpc StreamLedSettings (stream LedSettings) returns (google.protobuf.Empty);
}
// LED color and priority configuration
message LedSettings {
Color left_led = 1; // Left LED color (RGB)
Color right_led = 2; // Right LED color (RGB)
int32 priority_level = 3; // Control priority (0-100)
optional bool is_active = 4; // Active control when true, and release control when false
}
// RGB color definition (0-255)
message Color {
int32 r = 1; // Red component (0-255)
int32 g = 2; // Green component (0-255)
int32 b = 3; // Blue component (0-255)
}
Priority System
The LED API uses a priority-based control system to manage access between multiple features:
| Priority Level | Description |
|---|---|
| 0-20 | Low priority (background effects) |
| 21-50 | Medium priority (notifications) |
| 51-80 | High priority (critical alerts) |
| 81-100 | System priority (reserved) |
Priority Rules:
- Higher priority values override lower ones
- Equal priority: Last received settings apply
- Always release control when done (
is_active = false) - If your feature stops/crash, control will be automatically released