Name Date Size #Lines LOC

..Today-

dbus-1/system-services/H19-Jul-2024-65

interfaces/H19-Aug-2024--1-1

subprojects/H05-Aug-2024-4231

systemd/system/H19-Jul-2024-1612

test/H02-Aug-2024-18-43

udev/rules.d/H08-Feb-2023-00

.clang-formatH A D19-Aug-20243.7 KiB137135

.clang-tidyH A D08-Feb-202311.1 KiB319317

.gitignoreH A D02-Jun-202142 43

LICENSEH A D07-Mar-202111.1 KiB202169

OWNERSH A D22-Dec-20231.8 KiB5348

README.mdH A D07-Aug-20242.1 KiB7657

add_led_action.cppH A D19-Jul-20242.2 KiB9056

argument.cppH A D19-Jul-20241.9 KiB7448

argument.hppH A D19-Jul-20241.6 KiB5931

controller.cppH A D19-Jul-20241.2 KiB4114

meson.buildH A D05-Aug-20241.9 KiB7766

meson.optionsH A D17-Aug-202380 11

physical.cppH A D19-Jul-20244.1 KiB155103

physical.hppH A D19-Jul-20243.4 KiB12548

sysfs.cppH A D05-Aug-20245.1 KiB206137

sysfs.hppH A D01-Aug-20242.3 KiB7744

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