Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 1 | #include "ledlayout.hpp" |
| 2 | |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 3 | #include <set> |
| 4 | #include <string> |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 5 | #include <unordered_map> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 6 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 7 | static const std::unordered_map<std::string, |
| 8 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 9 | singleLedOn = { |
| 10 | {"/xyz/openbmc_project/ledmanager/groups/SingleLed", |
| 11 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 12 | {"One", phosphor::led::Layout::Action::On, 0, 0, |
| 13 | phosphor::led::Layout::Action::Blink}, |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 14 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 15 | }; |
| 16 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 17 | static const std::unordered_map<std::string, |
| 18 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 19 | singleLedBlink = { |
| 20 | {"/xyz/openbmc_project/ledmanager/groups/SingleLed", |
| 21 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 22 | {"One", phosphor::led::Layout::Action::Blink, 0, 0, |
| 23 | phosphor::led::Layout::Action::Blink}, |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 24 | }}, |
Vishwanatha Subbanna | 4b000d8 | 2017-05-03 18:44:16 +0530 | [diff] [blame] | 25 | }; |
| 26 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 27 | static const std::unordered_map<std::string, |
| 28 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 29 | singleLedBlinkOverrideOn = { |
| 30 | {"/xyz/openbmc_project/ledmanager/groups/SingleLed", |
| 31 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 32 | {"One", phosphor::led::Layout::Action::Blink, 0, 0, |
| 33 | phosphor::led::Layout::Action::On}, |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 34 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 35 | }; |
| 36 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 37 | static const std::unordered_map<std::string, |
| 38 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 39 | multipleLedsOn = { |
| 40 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds", |
| 41 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 42 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 48 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 49 | }; |
| 50 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 51 | static const std::unordered_map<std::string, |
| 52 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 53 | multipleLedsBlink = { |
| 54 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds", |
| 55 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 56 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 62 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 63 | }; |
| 64 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 65 | static const std::unordered_map<std::string, |
| 66 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 67 | multipleLedsOnAndBlink = { |
| 68 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix", |
| 69 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 70 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 80 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 81 | }; |
| 82 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 83 | static const std::unordered_map<std::string, |
| 84 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 85 | twoGroupsWithDistinctLEDsOn = { |
| 86 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", |
| 87 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 88 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 94 | }}, |
| 95 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", |
| 96 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 97 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 103 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 104 | }; |
| 105 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 106 | static const std::unordered_map<std::string, |
| 107 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 108 | twoGroupsWithOneComonLEDOn = { |
| 109 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", |
| 110 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 111 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 117 | }}, |
| 118 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", |
| 119 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 120 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 126 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 127 | }; |
| 128 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 129 | static const std::unordered_map<std::string, |
| 130 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 131 | twoGroupsWithOneComonLEDOnOneLEDBlinkPriority = { |
| 132 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", |
| 133 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 134 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 140 | }}, |
| 141 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", |
| 142 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 143 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 149 | }}, |
Vishwanatha Subbanna | 4b000d8 | 2017-05-03 18:44:16 +0530 | [diff] [blame] | 150 | }; |
| 151 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 152 | static const std::unordered_map<std::string, |
| 153 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 154 | twoGroupsWithOneComonLEDOnPriority = { |
| 155 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", |
| 156 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 157 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 163 | }}, |
| 164 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", |
| 165 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 166 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 172 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 173 | }; |
| 174 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 175 | static const std::unordered_map<std::string, |
| 176 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 177 | twoGroupsWithMultiplComonLEDOn = { |
| 178 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", |
| 179 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 180 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 186 | }}, |
| 187 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", |
| 188 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 189 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 197 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 198 | }; |
| 199 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 200 | static const std::unordered_map<std::string, |
| 201 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 202 | twoGroupsWithMultipleComonLEDInDifferentState = { |
| 203 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", |
| 204 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 205 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 213 | }}, |
| 214 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", |
| 215 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 216 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 224 | }}, |
Vishwanatha Subbanna | ed49073 | 2016-12-20 15:59:29 +0530 | [diff] [blame] | 225 | }; |
Vishwanatha Subbanna | cd569d2 | 2017-05-03 12:46:14 +0530 | [diff] [blame] | 226 | |
Patrick Williams | f204403 | 2022-03-17 05:12:30 -0500 | [diff] [blame] | 227 | static const std::unordered_map<std::string, |
| 228 | std::set<phosphor::led::Layout::LedAction>> |
Patrick Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 229 | twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority = { |
| 230 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", |
| 231 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 232 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 242 | }}, |
| 243 | {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", |
| 244 | { |
Patrick Williams | ed80e88 | 2022-03-17 05:03:51 -0500 | [diff] [blame] | 245 | {"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 Venture | 91ac8d3 | 2018-11-01 17:03:22 -0700 | [diff] [blame] | 255 | }}, |
Vishwanatha Subbanna | cd569d2 | 2017-05-03 12:46:14 +0530 | [diff] [blame] | 256 | }; |