Use the lower camel case of the C++ standard
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Ied901f0cc7cc6606e199dad0e31a35f838c32ab9
diff --git a/manager/lamptest/lamptest.cpp b/manager/lamptest/lamptest.cpp
index d90fc8a..a70f89c 100644
--- a/manager/lamptest/lamptest.cpp
+++ b/manager/lamptest/lamptest.cpp
@@ -22,7 +22,7 @@
// Physical LEDs will be updated during lamp test
for (const auto& it : ledsDeAssert)
{
- std::string path = std::string(PHY_LED_PATH) + it.name;
+ std::string path = std::string(phyLedPath) + it.name;
auto iter = std::find_if(
forceUpdateLEDs.begin(), forceUpdateLEDs.end(),
[&path](const auto& name) { return name == path; });
@@ -36,7 +36,7 @@
for (const auto& it : ledsAssert)
{
- std::string path = std::string(PHY_LED_PATH) + it.name;
+ std::string path = std::string(phyLedPath) + it.name;
auto iter = std::find_if(
forceUpdateLEDs.begin(), forceUpdateLEDs.end(),
[&path](const auto& name) { return name == path; });
@@ -137,7 +137,7 @@
uint8_t dutyOn{};
try
{
- auto properties = dBusHandler.getAllProperties(path, PHY_LED_IFACE);
+ auto properties = dBusHandler.getAllProperties(path, phyLedIntf);
state = std::get<std::string>(properties["State"]);
period = std::get<uint16_t>(properties["Period"]);
@@ -174,14 +174,13 @@
// Get paths of all the Physical LED objects
try
{
- physicalLEDPaths = dBusHandler.getSubTreePaths(PHY_LED_PATH,
- PHY_LED_IFACE);
+ physicalLEDPaths = dBusHandler.getSubTreePaths(phyLedPath, phyLedIntf);
}
catch (const sdbusplus::exception_t& e)
{
lg2::error(
"Failed to call the SubTreePaths method: {ERROR}, ledPath: {PATH}, ledInterface: {INTERFACE}",
- "ERROR", e, "PATH", PHY_LED_PATH, "INTERFACE", PHY_LED_IFACE);
+ "ERROR", e, "PATH", phyLedPath, "INTERFACE", phyLedIntf);
return;
}
@@ -292,11 +291,11 @@
const std::vector<std::string> empty{};
auto forceLEDs = json.value("forceLEDs", empty);
std::ranges::transform(forceLEDs, std::back_inserter(forceUpdateLEDs),
- [](const auto& i) { return PHY_LED_PATH + i; });
+ [](const auto& i) { return phyLedPath + i; });
auto skipLEDs = json.value("skipLEDs", empty);
std::ranges::transform(skipLEDs, std::back_inserter(skipUpdateLEDs),
- [](const auto& i) { return PHY_LED_PATH + i; });
+ [](const auto& i) { return phyLedPath + i; });
}
catch (const std::exception& e)
{
diff --git a/manager/manager.cpp b/manager/manager.cpp
index 12f507a..6d8bdb8 100644
--- a/manager/manager.cpp
+++ b/manager/manager.cpp
@@ -123,7 +123,7 @@
{
for (const auto& it : ledsDeAssert)
{
- std::string objPath = std::string(PHY_LED_PATH) + it.name;
+ std::string objPath = std::string(phyLedPath) + it.name;
lg2::debug("De-Asserting LED, NAME = {NAME}", "NAME", it.name);
drivePhysicalLED(objPath, Layout::Action::Off, it.dutyOn,
it.period);
@@ -134,7 +134,7 @@
{
for (const auto& it : ledsAssert)
{
- std::string objPath = std::string(PHY_LED_PATH) + it.name;
+ std::string objPath = std::string(phyLedPath) + it.name;
lg2::debug("Asserting LED, NAME = {NAME}", "NAME", it.name);
drivePhysicalLED(objPath, it.action, it.dutyOn, it.period);
}
@@ -155,14 +155,12 @@
PropertyValue dutyOnValue{dutyOn};
PropertyValue periodValue{period};
- dBusHandler.setProperty(objPath, PHY_LED_IFACE, "DutyOn",
- dutyOnValue);
- dBusHandler.setProperty(objPath, PHY_LED_IFACE, "Period",
- periodValue);
+ dBusHandler.setProperty(objPath, phyLedIntf, "DutyOn", dutyOnValue);
+ dBusHandler.setProperty(objPath, phyLedIntf, "Period", periodValue);
}
PropertyValue actionValue{getPhysicalAction(action)};
- dBusHandler.setProperty(objPath, PHY_LED_IFACE, "State", actionValue);
+ dBusHandler.setProperty(objPath, phyLedIntf, "State", actionValue);
}
catch (const std::exception& e)
{
diff --git a/manager/manager.hpp b/manager/manager.hpp
index ac00d76..d8573b6 100644
--- a/manager/manager.hpp
+++ b/manager/manager.hpp
@@ -13,8 +13,8 @@
{
using namespace phosphor::led::utils;
-static constexpr auto PHY_LED_PATH = "/xyz/openbmc_project/led/physical/";
-static constexpr auto PHY_LED_IFACE = "xyz.openbmc_project.Led.Physical";
+static constexpr auto phyLedPath = "/xyz/openbmc_project/led/physical/";
+static constexpr auto phyLedIntf = "xyz.openbmc_project.Led.Physical";
/** @class Manager
* @brief Manages group of LEDs and applies action on the elements of group