Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | Today | - | ||||
dbus-1/system-services/ | H | 19-Jul-2024 | - | 6 | 5 | |
interfaces/ | H | 19-Aug-2024 | - | -1 | -1 | |
subprojects/ | H | 05-Aug-2024 | - | 42 | 31 | |
systemd/system/ | H | 19-Jul-2024 | - | 16 | 12 | |
test/ | H | 02-Aug-2024 | - | 18 | -43 | |
udev/rules.d/ | H | 08-Feb-2023 | - | 0 | 0 | |
.clang-format | H A D | 19-Dec-2024 | 3.7 KiB | 137 | 135 | |
.clang-tidy | H A D | 08-Feb-2023 | 11.1 KiB | 319 | 317 | |
.gitignore | H A D | 02-Jun-2021 | 42 | 4 | 3 | |
LICENSE | H A D | 07-Mar-2021 | 11.1 KiB | 202 | 169 | |
OWNERS | H A D | 22-Dec-2023 | 1.8 KiB | 53 | 48 | |
README.md | H A D | 07-Aug-2024 | 2.1 KiB | 76 | 57 | |
add_led_action.cpp | H A D | 19-Jul-2024 | 2.2 KiB | 90 | 56 | |
argument.cpp | H A D | 19-Jul-2024 | 1.9 KiB | 74 | 48 | |
argument.hpp | H A D | 19-Jul-2024 | 1.6 KiB | 59 | 31 | |
controller.cpp | H A D | 19-Jul-2024 | 1.2 KiB | 41 | 14 | |
meson.build | H A D | 05-Aug-2024 | 1.9 KiB | 77 | 66 | |
meson.options | H A D | 17-Aug-2023 | 80 | 1 | 1 | |
physical.cpp | H A D | 19-Jul-2024 | 4.1 KiB | 155 | 103 | |
physical.hpp | H A D | 19-Jul-2024 | 3.4 KiB | 125 | 48 | |
sysfs.cpp | H A D | 05-Aug-2024 | 5.1 KiB | 206 | 137 | |
sysfs.hpp | H A D | 01-Aug-2024 | 2.3 KiB | 77 | 44 |
README.md
1# phosphor-led-sysfs 2 3This project exposes physical LEDs on dbus. 4 5## Example 6 7Say we have 'identify' LED in our system, which may be declared in devicetree. 8 9```text 10leds { 11 compatible = "gpio-leds"; 12 13 identify { 14 gpios = <&gpio ASPEED_GPIO(S, 6) GPIO_ACTIVE_HIGH>; 15 }; 16}; 17``` 18 19We can add an LED via the helper program. The main service is then started via 20dbus-activation. 21 22```sh 23./add-led-action --path /sys/class/leds/identify 24``` 25 26which will expose following dbus objects: 27 28```text 29busctl tree xyz.openbmc_project.LED.Controller 30`- /xyz 31 `- /xyz/openbmc_project 32 `- /xyz/openbmc_project/led 33 `- /xyz/openbmc_project/led/physical 34 `- /xyz/openbmc_project/led/physical/identify 35 36busctl introspect xyz.openbmc_project.LED.Controller /xyz/openbmc_project/led/physical/identify 37NAME TYPE SIGNATURE RESULT/VALUE FLAGS 38... 39xyz.openbmc_project.Led.Physical interface - - - 40.Color property s "xyz.openbmc_project.Led.Physical.Pal... emits-change writable 41.DutyOn property y 50 emits-change writable 42.Period property q 1000 emits-change writable 43.State property s "xyz.openbmc_project.Led.Physical.Act... emits-change writable 44``` 45 46In the above output, the usual org.freedesktop.\* interfaces have been removed 47to keep it readable. 48 49## Example: using the dbus interface 50 51Query the LED State 52 53```text 54busctl get-property xyz.openbmc_project.LED.Controller \ 55/xyz/openbmc_project/led/physical/identify \ 56xyz.openbmc_project.Led.Physical State \ 57s "xyz.openbmc_project.Led.Physical.Action.Off" 58``` 59 60Set the LED State 61 62```text 63busctl set-property xyz.openbmc_project.LED.Controller \ 64/xyz/openbmc_project/led/physical/identify \ 65xyz.openbmc_project.Led.Physical State s \ 66"xyz.openbmc_project.Led.Physical.Action.Off" 67``` 68 69## How to Build 70 71```sh 72meson setup build 73cd build 74ninja 75``` 76