blob: 86b3587dd59d3e0f82a5da6389f0536fa8dd03eb [file] [log] [blame]
Patrick Venture91ac8d32018-11-01 17:03:22 -07001#include "ledlayout.hpp"
2
3#include <map>
4#include <set>
5#include <string>
6
7static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
8 singleLedOn = {
9 {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
10 {
Patrick Williamsed80e882022-03-17 05:03:51 -050011 {"One", phosphor::led::Layout::Action::On, 0, 0,
12 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070013 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053014};
15
Patrick Venture91ac8d32018-11-01 17:03:22 -070016static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
17 singleLedBlink = {
18 {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
19 {
Patrick Williamsed80e882022-03-17 05:03:51 -050020 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
21 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070022 }},
Vishwanatha Subbanna4b000d82017-05-03 18:44:16 +053023};
24
Patrick Venture91ac8d32018-11-01 17:03:22 -070025static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
26 singleLedBlinkOverrideOn = {
27 {"/xyz/openbmc_project/ledmanager/groups/SingleLed",
28 {
Patrick Williamsed80e882022-03-17 05:03:51 -050029 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
30 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -070031 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053032};
33
Patrick Venture91ac8d32018-11-01 17:03:22 -070034static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
35 multipleLedsOn = {
36 {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
37 {
Patrick Williamsed80e882022-03-17 05:03:51 -050038 {"One", phosphor::led::Layout::Action::On, 0, 0,
39 phosphor::led::Layout::Action::On},
40 {"Two", phosphor::led::Layout::Action::On, 0, 0,
41 phosphor::led::Layout::Action::On},
42 {"Three", phosphor::led::Layout::Action::On, 0, 0,
43 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -070044 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053045};
46
Patrick Venture91ac8d32018-11-01 17:03:22 -070047static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
48 multipleLedsBlink = {
49 {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds",
50 {
Patrick Williamsed80e882022-03-17 05:03:51 -050051 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
52 phosphor::led::Layout::Action::Blink},
53 {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
54 phosphor::led::Layout::Action::Blink},
55 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
56 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070057 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053058};
59
Patrick Venture91ac8d32018-11-01 17:03:22 -070060static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
61 multipleLedsOnAndBlink = {
62 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix",
63 {
Patrick Williamsed80e882022-03-17 05:03:51 -050064 {"One", phosphor::led::Layout::Action::Blink, 0, 0,
65 phosphor::led::Layout::Action::Blink},
66 {"Two", phosphor::led::Layout::Action::On, 0, 0,
67 phosphor::led::Layout::Action::Blink},
68 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
69 phosphor::led::Layout::Action::On},
70 {"Four", phosphor::led::Layout::Action::On, 0, 0,
71 phosphor::led::Layout::Action::Blink},
72 {"Five", phosphor::led::Layout::Action::On, 0, 0,
73 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070074 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053075};
76
Patrick Venture91ac8d32018-11-01 17:03:22 -070077static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
78 twoGroupsWithDistinctLEDsOn = {
79 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
80 {
Patrick Williamsed80e882022-03-17 05:03:51 -050081 {"One", phosphor::led::Layout::Action::On, 0, 0,
82 phosphor::led::Layout::Action::Blink},
83 {"Two", phosphor::led::Layout::Action::On, 0, 0,
84 phosphor::led::Layout::Action::On},
85 {"Three", phosphor::led::Layout::Action::On, 0, 0,
86 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -070087 }},
88 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
89 {
Patrick Williamsed80e882022-03-17 05:03:51 -050090 {"Four", phosphor::led::Layout::Action::On, 0, 0,
91 phosphor::led::Layout::Action::Blink},
92 {"Five", phosphor::led::Layout::Action::On, 0, 0,
93 phosphor::led::Layout::Action::Blink},
94 {"Six", phosphor::led::Layout::Action::On, 0, 0,
95 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -070096 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +053097};
98
Patrick Venture91ac8d32018-11-01 17:03:22 -070099static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
100 twoGroupsWithOneComonLEDOn = {
101 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
102 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500103 {"One", phosphor::led::Layout::Action::On, 0, 0,
104 phosphor::led::Layout::Action::On},
105 {"Two", phosphor::led::Layout::Action::On, 0, 0,
106 phosphor::led::Layout::Action::On},
107 {"Three", phosphor::led::Layout::Action::On, 0, 0,
108 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700109 }},
110 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
111 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500112 {"Four", phosphor::led::Layout::Action::On, 0, 0,
113 phosphor::led::Layout::Action::On},
114 {"Three", phosphor::led::Layout::Action::On, 0, 0,
115 phosphor::led::Layout::Action::On},
116 {"Six", phosphor::led::Layout::Action::On, 0, 0,
117 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700118 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530119};
120
Patrick Venture91ac8d32018-11-01 17:03:22 -0700121static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
122 twoGroupsWithOneComonLEDOnOneLEDBlinkPriority = {
123 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
124 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500125 {"One", phosphor::led::Layout::Action::On, 0, 0,
126 phosphor::led::Layout::Action::On},
127 {"Two", phosphor::led::Layout::Action::On, 0, 0,
128 phosphor::led::Layout::Action::On},
129 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
130 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700131 }},
132 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
133 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500134 {"Four", phosphor::led::Layout::Action::On, 0, 0,
135 phosphor::led::Layout::Action::On},
136 {"Three", phosphor::led::Layout::Action::On, 0, 0,
137 phosphor::led::Layout::Action::Blink},
138 {"Six", phosphor::led::Layout::Action::On, 0, 0,
139 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700140 }},
Vishwanatha Subbanna4b000d82017-05-03 18:44:16 +0530141};
142
Patrick Venture91ac8d32018-11-01 17:03:22 -0700143static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
144 twoGroupsWithOneComonLEDOnPriority = {
145 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
146 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500147 {"One", phosphor::led::Layout::Action::On, 0, 0,
148 phosphor::led::Layout::Action::On},
149 {"Two", phosphor::led::Layout::Action::On, 0, 0,
150 phosphor::led::Layout::Action::On},
151 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
152 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700153 }},
154 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
155 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500156 {"Four", phosphor::led::Layout::Action::On, 0, 0,
157 phosphor::led::Layout::Action::On},
158 {"Three", phosphor::led::Layout::Action::On, 0, 0,
159 phosphor::led::Layout::Action::On},
160 {"Six", phosphor::led::Layout::Action::On, 0, 0,
161 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700162 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530163};
164
Patrick Venture91ac8d32018-11-01 17:03:22 -0700165static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
166 twoGroupsWithMultiplComonLEDOn = {
167 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
168 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500169 {"One", phosphor::led::Layout::Action::On, 0, 0,
170 phosphor::led::Layout::Action::On},
171 {"Two", phosphor::led::Layout::Action::On, 0, 0,
172 phosphor::led::Layout::Action::On},
173 {"Three", phosphor::led::Layout::Action::On, 0, 0,
174 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700175 }},
176 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
177 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500178 {"Two", phosphor::led::Layout::Action::On, 0, 0,
179 phosphor::led::Layout::Action::On},
180 {"Six", phosphor::led::Layout::Action::On, 0, 0,
181 phosphor::led::Layout::Action::On},
182 {"Three", phosphor::led::Layout::Action::On, 0, 0,
183 phosphor::led::Layout::Action::On},
184 {"Seven", phosphor::led::Layout::Action::On, 0, 0,
185 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700186 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530187};
188
Patrick Venture91ac8d32018-11-01 17:03:22 -0700189static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
190 twoGroupsWithMultipleComonLEDInDifferentState = {
191 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
192 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500193 {"One", phosphor::led::Layout::Action::On, 0, 0,
194 phosphor::led::Layout::Action::On},
195 {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
196 phosphor::led::Layout::Action::On},
197 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
198 phosphor::led::Layout::Action::On},
199 {"Four", phosphor::led::Layout::Action::On, 0, 0,
200 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700201 }},
202 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
203 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500204 {"Two", phosphor::led::Layout::Action::On, 0, 0,
205 phosphor::led::Layout::Action::On},
206 {"Three", phosphor::led::Layout::Action::Blink, 0, 0,
207 phosphor::led::Layout::Action::On},
208 {"Five", phosphor::led::Layout::Action::On, 0, 0,
209 phosphor::led::Layout::Action::On},
210 {"Six", phosphor::led::Layout::Action::On, 0, 0,
211 phosphor::led::Layout::Action::On},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700212 }},
Vishwanatha Subbannaed490732016-12-20 15:59:29 +0530213};
Vishwanatha Subbannacd569d22017-05-03 12:46:14 +0530214
Patrick Venture91ac8d32018-11-01 17:03:22 -0700215static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>>
216 twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority = {
217 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet",
218 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500219 {"One", phosphor::led::Layout::Action::On, 0, 0,
220 phosphor::led::Layout::Action::On},
221 {"Two", phosphor::led::Layout::Action::Blink, 0, 0,
222 phosphor::led::Layout::Action::On},
223 {"Three", phosphor::led::Layout::Action::On, 0, 0,
224 phosphor::led::Layout::Action::Blink},
225 {"Four", phosphor::led::Layout::Action::On, 0, 0,
226 phosphor::led::Layout::Action::On},
227 {"Ten", phosphor::led::Layout::Action::Blink, 0, 0,
228 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700229 }},
230 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet",
231 {
Patrick Williamsed80e882022-03-17 05:03:51 -0500232 {"Two", phosphor::led::Layout::Action::On, 0, 0,
233 phosphor::led::Layout::Action::On},
234 {"Three", phosphor::led::Layout::Action::On, 0, 0,
235 phosphor::led::Layout::Action::Blink},
236 {"Five", phosphor::led::Layout::Action::On, 0, 0,
237 phosphor::led::Layout::Action::On},
238 {"Six", phosphor::led::Layout::Action::On, 0, 0,
239 phosphor::led::Layout::Action::On},
240 {"Ten", phosphor::led::Layout::Action::On, 0, 0,
241 phosphor::led::Layout::Action::Blink},
Patrick Venture91ac8d32018-11-01 17:03:22 -0700242 }},
Vishwanatha Subbannacd569d22017-05-03 12:46:14 +0530243};