commit | f8548eebf92c37de7fefc7ca697241aeb5b7561a | [log] [tgz] |
---|---|---|
author | Patrick Williams <patrick@stwcx.xyz> | Sat Feb 01 08:22:41 2025 -0500 |
committer | Andrew Jeffery <andrew@codeconstruct.com.au> | Mon Feb 03 00:46:28 2025 +0000 |
tree | edaeb380b8bfcdee756c2f15be239dd65df07291 | |
parent | 2f51f1ac0fb9f3cfef6dbedf1e4a885bd22f0008 [diff] |
clang-format: update latest spec and reformat Copy the latest format file from the docs repository and apply. Change-Id: Ia2f87211ca39b4bbc8b1c82c82b041ce7ab80569 Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
This project exposes physical LEDs on dbus.
Say we have 'identify' LED in our system, which may be declared in devicetree.
leds { compatible = "gpio-leds"; identify { gpios = <&gpio ASPEED_GPIO(S, 6) GPIO_ACTIVE_HIGH>; }; };
We can add an LED via the helper program. The main service is then started via dbus-activation.
./add-led-action --path /sys/class/leds/identify
which will expose following dbus objects:
busctl tree xyz.openbmc_project.LED.Controller `- /xyz `- /xyz/openbmc_project `- /xyz/openbmc_project/led `- /xyz/openbmc_project/led/physical `- /xyz/openbmc_project/led/physical/identify busctl introspect xyz.openbmc_project.LED.Controller /xyz/openbmc_project/led/physical/identify NAME TYPE SIGNATURE RESULT/VALUE FLAGS ... xyz.openbmc_project.Led.Physical interface - - - .Color property s "xyz.openbmc_project.Led.Physical.Pal... emits-change writable .DutyOn property y 50 emits-change writable .Period property q 1000 emits-change writable .State property s "xyz.openbmc_project.Led.Physical.Act... emits-change writable
In the above output, the usual org.freedesktop.* interfaces have been removed to keep it readable.
Query the LED State
busctl get-property xyz.openbmc_project.LED.Controller \ /xyz/openbmc_project/led/physical/identify \ xyz.openbmc_project.Led.Physical State \ s "xyz.openbmc_project.Led.Physical.Action.Off"
Set the LED State
busctl set-property xyz.openbmc_project.LED.Controller \ /xyz/openbmc_project/led/physical/identify \ xyz.openbmc_project.Led.Physical State s \ "xyz.openbmc_project.Led.Physical.Action.Off"
meson setup build
cd build
ninja