1 #include "ledlayout.hpp" 2 3 #include <map> 4 #include <set> 5 #include <string> 6 7 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 8 singleLedOn = { 9 {"/xyz/openbmc_project/ledmanager/groups/SingleLed", 10 { 11 {"One", phosphor::led::Layout::On, 0, 0, 12 phosphor::led::Layout::Blink}, 13 }}, 14 }; 15 16 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 17 singleLedBlink = { 18 {"/xyz/openbmc_project/ledmanager/groups/SingleLed", 19 { 20 {"One", phosphor::led::Layout::Blink, 0, 0, 21 phosphor::led::Layout::Blink}, 22 }}, 23 }; 24 25 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 26 singleLedBlinkOverrideOn = { 27 {"/xyz/openbmc_project/ledmanager/groups/SingleLed", 28 { 29 {"One", phosphor::led::Layout::Blink, 0, 0, 30 phosphor::led::Layout::On}, 31 }}, 32 }; 33 34 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 35 multipleLedsOn = { 36 {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds", 37 { 38 {"One", phosphor::led::Layout::On, 0, 0, 39 phosphor::led::Layout::On}, 40 {"Two", phosphor::led::Layout::On, 0, 0, 41 phosphor::led::Layout::On}, 42 {"Three", phosphor::led::Layout::On, 0, 0, 43 phosphor::led::Layout::On}, 44 }}, 45 }; 46 47 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 48 multipleLedsBlink = { 49 {"/xyz/openbmc_project/ledmanager/groups/MultipleLeds", 50 { 51 {"One", phosphor::led::Layout::Blink, 0, 0, 52 phosphor::led::Layout::Blink}, 53 {"Two", phosphor::led::Layout::Blink, 0, 0, 54 phosphor::led::Layout::Blink}, 55 {"Three", phosphor::led::Layout::Blink, 0, 0, 56 phosphor::led::Layout::Blink}, 57 }}, 58 }; 59 60 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 61 multipleLedsOnAndBlink = { 62 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsMix", 63 { 64 {"One", phosphor::led::Layout::Blink, 0, 0, 65 phosphor::led::Layout::Blink}, 66 {"Two", phosphor::led::Layout::On, 0, 67 phosphor::led::Layout::Blink}, 68 {"Three", phosphor::led::Layout::Blink, 0, 69 phosphor::led::Layout::On}, 70 {"Four", phosphor::led::Layout::On, 0, 71 phosphor::led::Layout::Blink}, 72 {"Five", phosphor::led::Layout::On, 0, 73 phosphor::led::Layout::Blink}, 74 }}, 75 }; 76 77 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 78 twoGroupsWithDistinctLEDsOn = { 79 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", 80 { 81 {"One", phosphor::led::Layout::On, 0, 0, 82 phosphor::led::Layout::Blink}, 83 {"Two", phosphor::led::Layout::On, 0, 0, 84 phosphor::led::Layout::On}, 85 {"Three", phosphor::led::Layout::On, 0, 0, 86 phosphor::led::Layout::Blink}, 87 }}, 88 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", 89 { 90 {"Four", phosphor::led::Layout::On, 0, 0, 91 phosphor::led::Layout::Blink}, 92 {"Five", phosphor::led::Layout::On, 0, 0, 93 phosphor::led::Layout::Blink}, 94 {"Six", phosphor::led::Layout::On, 0, 0, 95 phosphor::led::Layout::On}, 96 }}, 97 }; 98 99 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 100 twoGroupsWithOneComonLEDOn = { 101 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", 102 { 103 {"One", phosphor::led::Layout::On, 0, 0, 104 phosphor::led::Layout::On}, 105 {"Two", phosphor::led::Layout::On, 0, 0, 106 phosphor::led::Layout::On}, 107 {"Three", phosphor::led::Layout::On, 0, 0, 108 phosphor::led::Layout::On}, 109 }}, 110 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", 111 { 112 {"Four", phosphor::led::Layout::On, 0, 0, 113 phosphor::led::Layout::On}, 114 {"Three", phosphor::led::Layout::On, 0, 0, 115 phosphor::led::Layout::On}, 116 {"Six", phosphor::led::Layout::On, 0, 0, 117 phosphor::led::Layout::On}, 118 }}, 119 }; 120 121 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 122 twoGroupsWithOneComonLEDOnOneLEDBlinkPriority = { 123 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", 124 { 125 {"One", phosphor::led::Layout::On, 0, 0, 126 phosphor::led::Layout::On}, 127 {"Two", phosphor::led::Layout::On, 0, 0, 128 phosphor::led::Layout::On}, 129 {"Three", phosphor::led::Layout::Blink, 0, 0, 130 phosphor::led::Layout::Blink}, 131 }}, 132 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", 133 { 134 {"Four", phosphor::led::Layout::On, 0, 0, 135 phosphor::led::Layout::On}, 136 {"Three", phosphor::led::Layout::On, 0, 0, 137 phosphor::led::Layout::Blink}, 138 {"Six", phosphor::led::Layout::On, 0, 0, 139 phosphor::led::Layout::On}, 140 }}, 141 }; 142 143 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 144 twoGroupsWithOneComonLEDOnPriority = { 145 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", 146 { 147 {"One", phosphor::led::Layout::On, 0, 0, 148 phosphor::led::Layout::On}, 149 {"Two", phosphor::led::Layout::On, 0, 0, 150 phosphor::led::Layout::On}, 151 {"Three", phosphor::led::Layout::Blink, 0, 0, 152 phosphor::led::Layout::On}, 153 }}, 154 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", 155 { 156 {"Four", phosphor::led::Layout::On, 0, 0, 157 phosphor::led::Layout::On}, 158 {"Three", phosphor::led::Layout::On, 0, 0, 159 phosphor::led::Layout::On}, 160 {"Six", phosphor::led::Layout::On, 0, 0, 161 phosphor::led::Layout::On}, 162 }}, 163 }; 164 165 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 166 twoGroupsWithMultiplComonLEDOn = { 167 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", 168 { 169 {"One", phosphor::led::Layout::On, 0, 0, 170 phosphor::led::Layout::On}, 171 {"Two", phosphor::led::Layout::On, 0, 0, 172 phosphor::led::Layout::On}, 173 {"Three", phosphor::led::Layout::On, 0, 0, 174 phosphor::led::Layout::On}, 175 }}, 176 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", 177 { 178 {"Two", phosphor::led::Layout::On, 0, 0, 179 phosphor::led::Layout::On}, 180 {"Six", phosphor::led::Layout::On, 0, 0, 181 phosphor::led::Layout::On}, 182 {"Three", phosphor::led::Layout::On, 0, 0, 183 phosphor::led::Layout::On}, 184 {"Seven", phosphor::led::Layout::On, 0, 0, 185 phosphor::led::Layout::On}, 186 }}, 187 }; 188 189 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 190 twoGroupsWithMultipleComonLEDInDifferentState = { 191 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", 192 { 193 {"One", phosphor::led::Layout::On, 0, 0, 194 phosphor::led::Layout::On}, 195 {"Two", phosphor::led::Layout::Blink, 0, 0, 196 phosphor::led::Layout::On}, 197 {"Three", phosphor::led::Layout::Blink, 0, 0, 198 phosphor::led::Layout::On}, 199 {"Four", phosphor::led::Layout::On, 0, 0, 200 phosphor::led::Layout::On}, 201 }}, 202 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", 203 { 204 {"Two", phosphor::led::Layout::On, 0, 0, 205 phosphor::led::Layout::On}, 206 {"Three", phosphor::led::Layout::Blink, 0, 0, 207 phosphor::led::Layout::On}, 208 {"Five", phosphor::led::Layout::On, 0, 0, 209 phosphor::led::Layout::On}, 210 {"Six", phosphor::led::Layout::On, 0, 0, 211 phosphor::led::Layout::On}, 212 }}, 213 }; 214 215 static const std::map<std::string, std::set<phosphor::led::Layout::LedAction>> 216 twoGroupsWithMultipleComonLEDInDifferentStateDiffPriority = { 217 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsASet", 218 { 219 {"One", phosphor::led::Layout::On, 0, 0, 220 phosphor::led::Layout::On}, 221 {"Two", phosphor::led::Layout::Blink, 0, 0, 222 phosphor::led::Layout::On}, 223 {"Three", phosphor::led::Layout::On, 0, 0, 224 phosphor::led::Layout::Blink}, 225 {"Four", phosphor::led::Layout::On, 0, 0, 226 phosphor::led::Layout::On}, 227 {"Ten", phosphor::led::Layout::Blink, 0, 0, 228 phosphor::led::Layout::Blink}, 229 }}, 230 {"/xyz/openbmc_project/ledmanager/groups/MultipleLedsBSet", 231 { 232 {"Two", phosphor::led::Layout::On, 0, 0, 233 phosphor::led::Layout::On}, 234 {"Three", phosphor::led::Layout::On, 0, 0, 235 phosphor::led::Layout::Blink}, 236 {"Five", phosphor::led::Layout::On, 0, 0, 237 phosphor::led::Layout::On}, 238 {"Six", phosphor::led::Layout::On, 0, 0, 239 phosphor::led::Layout::On}, 240 {"Ten", phosphor::led::Layout::On, 0, 0, 241 phosphor::led::Layout::Blink}, 242 }}, 243 }; 244