| edition = "2023"; |
| |
| package milotic_tlbmc; |
| |
| import "power_control.proto"; |
| |
| enum LedState { |
| LED_STATE_UNSPECIFIED = 0; |
| LED_STATE_OFF = 1; |
| LED_STATE_BLINK = 2; |
| LED_STATE_ON = 3; |
| } |
| |
| message BlinkConfig { |
| uint32 duty_on_ms = 1 [default = 500]; |
| uint32 duty_off_ms = 2 [default = 500]; |
| } |
| |
| message LedBehavior { |
| LedState state = 1 [default = LED_STATE_OFF]; |
| // Configuration applied ONLY if state == LED_STATE_BLINK. |
| BlinkConfig blink_config = 2; |
| } |
| |
| message LedOutput { |
| oneof target { |
| // Name of the sysfs LED (e.g., "blue:identify"). |
| string sysfs_name = 1; |
| // Name of the GPIO LED line (e.g., "power_led" or "<chip_id>:<gpio_num>"). |
| // TODO: b/541951164 - impl GPIO LEDs. |
| // string gpio_name = 2; |
| } |
| } |
| |
| message LedConfig { |
| // Unique name identifying the LED (e.g., "fault_led", "identify_led"). |
| string name = 1; |
| // Hardware output interface (sysfs or GPIO). |
| LedOutput output = 2; |
| // Default behavior applied on start / no rules matched |
| // set to LED_STATE_UNSPECIFIED to persist the previous state |
| LedBehavior default_behavior = 3; |
| } |
| |
| message LedPresetMember { |
| string name = 1; |
| LedBehavior behavior = 2; |
| } |
| |
| message LedPreset { |
| // Name of the preset (e.g., "system_fault", "chassis_identify", "power_on"). |
| string name = 1; |
| // List of LEDs and their associated state controls. |
| repeated LedPresetMember members = 2; |
| } |
| |
| message LedConditionVariable { |
| string name = 1; |
| oneof value { |
| string source_path = 2; |
| PowerState power_state = 3; |
| OSState os_state = 4; |
| } |
| } |
| |
| message LedCondition { |
| string expression = 1; |
| } |
| |
| enum LedTrigger { |
| LED_TRIGGER_UNSPECIFIED = 0; |
| // TODO: b/546330351 - impl GPIO trigger |
| } |
| |
| message LedPolicy { |
| string name = 1; |
| string preset_name = 2; |
| oneof event { |
| LedCondition condition = 3; |
| LedTrigger trigger = 4; |
| } |
| } |
| |
| message LedConfigs { |
| repeated LedConfig leds = 1; |
| repeated LedPreset presets = 2; |
| repeated LedConditionVariable variables = 3; |
| repeated LedPolicy policies = 4; |
| } |