blob: b5f90cad368b1a2a9e52b396df266751d4a39c7b [file] [log] [blame]
Patrick Venture91ac8d32018-11-01 17:03:22 -07001#include "ledlayout.hpp"
2
Patrick Venture91ac8d32018-11-01 17:03:22 -07003#include <set>
4#include <string>
Patrick Williamsf2044032022-03-17 05:12:30 -05005#include <unordered_map>
Patrick Venture91ac8d32018-11-01 17:03:22 -07006
Patrick Williamsf2044032022-03-17 05:12:30 -05007static const std::unordered_map<std::string,
8 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -07009 singleLedOn = {
10 {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
11 {
Patrick Williamsed80e882022-03-17 05:03:51 -050012 {"One", phosphor::led::Layout::Action::On, 0, 0,
13 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070014 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053015};
16
Patrick Williamsf2044032022-03-17 05:12:30 -050017static const std::unordered_map<std::string,
18 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -070019 singleLedBlink = {
20 {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
21 {
Patrick Williamsed80e882022-03-17 05:03:51 -050022 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
23 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070024 }},
Vishwanatha Subbanna4b000d82017-05-03 18:44:16 +053025};
26
Patrick Williamsf2044032022-03-17 05:12:30 -050027static const std::unordered_map<std::string,
28 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -070029 singleLedBlinkOverrideOn = {
30 {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
31 {
Patrick Williamsed80e882022-03-17 05:03:51 -050032 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
33 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -070034 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053035};
36
Patrick Williamsf2044032022-03-17 05:12:30 -050037static const std::unordered_map<std::string,
38 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -070039 multipleLedsOn = {
40 {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
41 {
Patrick Williamsed80e882022-03-17 05:03:51 -050042 {"One", phosphor::led::Layout::Action::On, 0, 0,
43 phosphor::led::Layout::Action::On},
44 {"Two", phosphor::led::Layout::Action::On, 0, 0,
45 phosphor::led::Layout::Action::On},
46 {"Three", phosphor::led::Layout::Action::On, 0, 0,
47 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -070048 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053049};
50
Patrick Williamsf2044032022-03-17 05:12:30 -050051static const std::unordered_map<std::string,
52 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -070053 multipleLedsBlink = {
54 {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
55 {
Patrick Williamsed80e882022-03-17 05:03:51 -050056 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
57 phosphor::led::Layout::Action::Blink},
58 {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
59 phosphor::led::Layout::Action::Blink},
60 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
61 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070062 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053063};
64
Patrick Williamsf2044032022-03-17 05:12:30 -050065static const std::unordered_map<std::string,
66 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -070067 multipleLedsOnAndBlink = {
68 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix",
69 {
Patrick Williamsed80e882022-03-17 05:03:51 -050070 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
71 phosphor::led::Layout::Action::Blink},
72 {"Two", phosphor::led::Layout::Action::On, 0, 0,
73 phosphor::led::Layout::Action::Blink},
74 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
75 phosphor::led::Layout::Action::On},
76 {"Four", phosphor::led::Layout::Action::On, 0, 0,
77 phosphor::led::Layout::Action::Blink},
78 {"Five", phosphor::led::Layout::Action::On, 0, 0,
79 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070080 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053081};
82
Patrick Williamsf2044032022-03-17 05:12:30 -050083static const std::unordered_map<std::string,
84 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -070085 twoGroupsWithDistinctLEDsOn = {
86 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
87 {
Patrick Williamsed80e882022-03-17 05:03:51 -050088 {"One", phosphor::led::Layout::Action::On, 0, 0,
89 phosphor::led::Layout::Action::Blink},
90 {"Two", phosphor::led::Layout::Action::On, 0, 0,
91 phosphor::led::Layout::Action::On},
92 {"Three", phosphor::led::Layout::Action::On, 0, 0,
93 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070094 }},
95 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
96 {
Patrick Williamsed80e882022-03-17 05:03:51 -050097 {"Four", phosphor::led::Layout::Action::On, 0, 0,
98 phosphor::led::Layout::Action::Blink},
99 {"Five", phosphor::led::Layout::Action::On, 0, 0,
100 phosphor::led::Layout::Action::Blink},
101 {"Six", phosphor::led::Layout::Action::On, 0, 0,
102 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700103 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530104};
105
Patrick Williamsf2044032022-03-17 05:12:30 -0500106static const std::unordered_map<std::string,
107 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -0700108 twoGroupsWithOneComonLEDOn = {
109 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
110 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500111 {"One", phosphor::led::Layout::Action::On, 0, 0,
112 phosphor::led::Layout::Action::On},
113 {"Two", phosphor::led::Layout::Action::On, 0, 0,
114 phosphor::led::Layout::Action::On},
115 {"Three", phosphor::led::Layout::Action::On, 0, 0,
116 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700117 }},
118 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
119 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500120 {"Four", phosphor::led::Layout::Action::On, 0, 0,
121 phosphor::led::Layout::Action::On},
122 {"Three", phosphor::led::Layout::Action::On, 0, 0,
123 phosphor::led::Layout::Action::On},
124 {"Six", phosphor::led::Layout::Action::On, 0, 0,
125 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700126 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530127};
128
Patrick Williamsf2044032022-03-17 05:12:30 -0500129static const std::unordered_map<std::string,
130 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -0700131 twoGroupsWithOneComonLEDOnOneLEDBlinkPriority = {
132 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
133 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500134 {"One", phosphor::led::Layout::Action::On, 0, 0,
135 phosphor::led::Layout::Action::On},
136 {"Two", phosphor::led::Layout::Action::On, 0, 0,
137 phosphor::led::Layout::Action::On},
138 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
139 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700140 }},
141 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
142 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500143 {"Four", phosphor::led::Layout::Action::On, 0, 0,
144 phosphor::led::Layout::Action::On},
145 {"Three", phosphor::led::Layout::Action::On, 0, 0,
146 phosphor::led::Layout::Action::Blink},
147 {"Six", phosphor::led::Layout::Action::On, 0, 0,
148 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700149 }},
Vishwanatha Subbanna4b000d82017-05-03 18:44:16 +0530150};
151
Patrick Williamsf2044032022-03-17 05:12:30 -0500152static const std::unordered_map<std::string,
153 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -0700154 twoGroupsWithOneComonLEDOnPriority = {
155 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
156 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500157 {"One", phosphor::led::Layout::Action::On, 0, 0,
158 phosphor::led::Layout::Action::On},
159 {"Two", phosphor::led::Layout::Action::On, 0, 0,
160 phosphor::led::Layout::Action::On},
161 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
162 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700163 }},
164 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
165 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500166 {"Four", phosphor::led::Layout::Action::On, 0, 0,
167 phosphor::led::Layout::Action::On},
168 {"Three", phosphor::led::Layout::Action::On, 0, 0,
169 phosphor::led::Layout::Action::On},
170 {"Six", phosphor::led::Layout::Action::On, 0, 0,
171 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700172 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530173};
174
Patrick Williamsf2044032022-03-17 05:12:30 -0500175static const std::unordered_map<std::string,
176 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -0700177 twoGroupsWithMultiplComonLEDOn = {
178 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
179 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500180 {"One", phosphor::led::Layout::Action::On, 0, 0,
181 phosphor::led::Layout::Action::On},
182 {"Two", phosphor::led::Layout::Action::On, 0, 0,
183 phosphor::led::Layout::Action::On},
184 {"Three", phosphor::led::Layout::Action::On, 0, 0,
185 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700186 }},
187 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
188 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500189 {"Two", phosphor::led::Layout::Action::On, 0, 0,
190 phosphor::led::Layout::Action::On},
191 {"Six", phosphor::led::Layout::Action::On, 0, 0,
192 phosphor::led::Layout::Action::On},
193 {"Three", phosphor::led::Layout::Action::On, 0, 0,
194 phosphor::led::Layout::Action::On},
195 {"Seven", phosphor::led::Layout::Action::On, 0, 0,
196 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700197 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530198};
199
Patrick Williamsf2044032022-03-17 05:12:30 -0500200static const std::unordered_map<std::string,
201 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -0700202 twoGroupsWithMultipleComonLEDInDifferentState = {
203 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
204 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500205 {"One", phosphor::led::Layout::Action::On, 0, 0,
206 phosphor::led::Layout::Action::On},
207 {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
208 phosphor::led::Layout::Action::On},
209 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
210 phosphor::led::Layout::Action::On},
211 {"Four", phosphor::led::Layout::Action::On, 0, 0,
212 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700213 }},
214 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
215 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500216 {"Two", phosphor::led::Layout::Action::On, 0, 0,
217 phosphor::led::Layout::Action::On},
218 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
219 phosphor::led::Layout::Action::On},
220 {"Five", phosphor::led::Layout::Action::On, 0, 0,
221 phosphor::led::Layout::Action::On},
222 {"Six", phosphor::led::Layout::Action::On, 0, 0,
223 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700224 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530225};
Vishwanatha Subbannacd569d22017-05-03 12:46:14 +0530226
Patrick Williamsf2044032022-03-17 05:12:30 -0500227static const std::unordered_map<std::string,
228 std::set<phosphor::led::Layout::LedAction>>
Patrick Venture91ac8d32018-11-01 17:03:22 -0700229 twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority = {
230 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
231 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500232 {"One", phosphor::led::Layout::Action::On, 0, 0,
233 phosphor::led::Layout::Action::On},
234 {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
235 phosphor::led::Layout::Action::On},
236 {"Three", phosphor::led::Layout::Action::On, 0, 0,
237 phosphor::led::Layout::Action::Blink},
238 {"Four", phosphor::led::Layout::Action::On, 0, 0,
239 phosphor::led::Layout::Action::On},
240 {"Ten", phosphor::led::Layout::Action::Blink, 0, 0,
241 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700242 }},
243 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
244 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500245 {"Two", phosphor::led::Layout::Action::On, 0, 0,
246 phosphor::led::Layout::Action::On},
247 {"Three", phosphor::led::Layout::Action::On, 0, 0,
248 phosphor::led::Layout::Action::Blink},
249 {"Five", phosphor::led::Layout::Action::On, 0, 0,
250 phosphor::led::Layout::Action::On},
251 {"Six", phosphor::led::Layout::Action::On, 0, 0,
252 phosphor::led::Layout::Action::On},
253 {"Ten", phosphor::led::Layout::Action::On, 0, 0,
254 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700255 }},
Vishwanatha Subbannacd569d22017-05-03 12:46:14 +0530256};