sdbusplus: use shorter type aliases
The sdbusplus headers provide shortened aliases for many types.
Switch to using them to provide better code clarity and shorter
lines. Possible replacements are for:
* bus_t
* exception_t
* manager_t
* match_t
* message_t
* object_t
* slot_t
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ief05bd757cffb1453e058a719ee4b060861752e7
diff --git a/cold-redundancy/cold_redundancy.cpp b/cold-redundancy/cold_redundancy.cpp
index 2409e0a..08ed491 100644
--- a/cold-redundancy/cold_redundancy.cpp
+++ b/cold-redundancy/cold_redundancy.cpp
@@ -50,9 +50,8 @@
{
post(io,
[this, &io, &objectServer, &systemBus]() { createPSU(systemBus); });
- std::function<void(sdbusplus::message::message&)> eventHandler =
- [this, &io, &objectServer,
- &systemBus](sdbusplus::message::message& message) {
+ std::function<void(sdbusplus::message_t&)> eventHandler =
+ [this, &io, &objectServer, &systemBus](sdbusplus::message_t& message) {
if (message.is_method_error())
{
std::cerr << "callback method error\n";
@@ -73,8 +72,8 @@
});
};
- std::function<void(sdbusplus::message::message&)> eventCollect =
- [&](sdbusplus::message::message& message) {
+ std::function<void(sdbusplus::message_t&)> eventCollect =
+ [&](sdbusplus::message_t& message) {
std::string objectName;
boost::container::flat_map<std::string, std::variant<bool>> values;
std::string path = message.get_path();
@@ -99,7 +98,7 @@
{
message.read(objectName, values);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
std::cerr << "Failed to read message from PSU Event\n";
return;
@@ -137,8 +136,8 @@
using namespace sdbusplus::bus::match::rules;
for (const char* type : psuInterfaceTypes)
{
- auto match = std::make_unique<sdbusplus::bus::match::match>(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ auto match = std::make_unique<sdbusplus::bus::match_t>(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
type::signal() + member("PropertiesChanged") +
path_namespace(inventoryPath) + arg0namespace(type),
eventHandler);
@@ -147,8 +146,8 @@
for (const char* eventType : psuEventInterface)
{
- auto eventMatch = std::make_unique<sdbusplus::bus::match::match>(
- static_cast<sdbusplus::bus::bus&>(*systemBus),
+ auto eventMatch = std::make_unique<sdbusplus::bus::match_t>(
+ static_cast<sdbusplus::bus_t&>(*systemBus),
type::signal() + member("PropertiesChanged") +
path_namespace(eventPath) + arg0namespace(eventType),
eventCollect);
diff --git a/cold-redundancy/cold_redundancy.hpp b/cold-redundancy/cold_redundancy.hpp
index b72c642..a66705a 100644
--- a/cold-redundancy/cold_redundancy.hpp
+++ b/cold-redundancy/cold_redundancy.hpp
@@ -76,7 +76,7 @@
* D-Bus properties change will trigger callback function
* by these matches
*/
- std::vector<std::unique_ptr<sdbusplus::bus::match::match>> matches;
+ std::vector<std::unique_ptr<sdbusplus::bus::match_t>> matches;
};
/**
diff --git a/cold-redundancy/util.cpp b/cold-redundancy/util.cpp
index fea972e..8946d30 100644
--- a/cold-redundancy/util.cpp
+++ b/cold-redundancy/util.cpp
@@ -35,7 +35,7 @@
phosphor::power::util::getProperty<bool>(
"xyz.openbmc_project.State.Decorator.OperationalStatus", "functional",
pathStr, "xyz.openbmc_project.PSUSensor",
- static_cast<sdbusplus::bus::bus&>(*conn), result);
+ static_cast<sdbusplus::bus_t&>(*conn), result);
if (!result)
{
diff --git a/phosphor-power-sequencer/src/power_control.cpp b/phosphor-power-sequencer/src/power_control.cpp
index 91021a4..e120532 100644
--- a/phosphor-power-sequencer/src/power_control.cpp
+++ b/phosphor-power-sequencer/src/power_control.cpp
@@ -40,7 +40,7 @@
const std::string busPropertyName = "Bus";
const std::string namePropertyName = "Name";
-PowerControl::PowerControl(sdbusplus::bus::bus& bus,
+PowerControl::PowerControl(sdbusplus::bus_t& bus,
const sdeventplus::Event& event) :
PowerObject{bus, POWER_OBJ_PATH, PowerObject::action::defer_emit},
bus{bus}, device{std::make_unique<PowerSequencerMonitor>(bus)},
@@ -116,7 +116,7 @@
return state;
}
-void PowerControl::interfacesAddedHandler(sdbusplus::message::message& msg)
+void PowerControl::interfacesAddedHandler(sdbusplus::message_t& msg)
{
// Only continue if message is valid and device has not already been found
if (!msg || deviceFound)
diff --git a/phosphor-power-sequencer/src/power_control.hpp b/phosphor-power-sequencer/src/power_control.hpp
index f659744..0e37f7e 100644
--- a/phosphor-power-sequencer/src/power_control.hpp
+++ b/phosphor-power-sequencer/src/power_control.hpp
@@ -18,7 +18,7 @@
namespace phosphor::power::sequencer
{
-using PowerObject = sdbusplus::server::object::object<PowerInterface>;
+using PowerObject = sdbusplus::server::object_t<PowerInterface>;
/**
* @class PowerControl
@@ -40,7 +40,7 @@
* @param bus D-Bus bus object
* @param event event object
*/
- PowerControl(sdbusplus::bus::bus& bus, const sdeventplus::Event& event);
+ PowerControl(sdbusplus::bus_t& bus, const sdeventplus::Event& event);
/** @copydoc PowerInterface::getPgood() */
int getPgood() const override;
@@ -55,7 +55,7 @@
* Callback function to handle interfacesAdded D-Bus signals
* @param msg Expanded sdbusplus message data
*/
- void interfacesAddedHandler(sdbusplus::message::message& msg);
+ void interfacesAddedHandler(sdbusplus::message_t& msg);
/** @copydoc PowerInterface::setPgoodTimeout() */
void setPgoodTimeout(int timeout) override;
@@ -70,7 +70,7 @@
/**
* The D-Bus bus object
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* The power sequencer device to monitor.
diff --git a/phosphor-power-sequencer/src/power_interface.cpp b/phosphor-power-sequencer/src/power_interface.cpp
index 06e17da..d3def79 100644
--- a/phosphor-power-sequencer/src/power_interface.cpp
+++ b/phosphor-power-sequencer/src/power_interface.cpp
@@ -33,7 +33,7 @@
namespace phosphor::power::sequencer
{
-PowerInterface::PowerInterface(sdbusplus::bus::bus& bus, const char* path) :
+PowerInterface::PowerInterface(sdbusplus::bus_t& bus, const char* path) :
serverInterface(bus, path, POWER_IFACE, vtable, this)
{}
@@ -52,7 +52,7 @@
log<level::INFO>(
fmt::format("callbackGetPgood: {}", pgood).c_str());
- sdbusplus::message::message(msg).append(pgood);
+ sdbusplus::message_t(msg).append(pgood);
}
catch (const sdbusplus::exception_t& e)
{
@@ -85,7 +85,7 @@
log<level::INFO>(
fmt::format("callbackGetPgoodTimeout: {}", timeout).c_str());
- sdbusplus::message::message(msg).append(timeout);
+ sdbusplus::message_t(msg).append(timeout);
}
catch (const sdbusplus::exception_t& e)
{
@@ -117,7 +117,7 @@
log<level::INFO>(
fmt::format("callbackGetPowerState: {}", pgood).c_str());
- auto reply = sdbusplus::message::message(msg).new_method_return();
+ auto reply = sdbusplus::message_t(msg).new_method_return();
reply.append(pgood);
reply.method_return();
}
@@ -147,7 +147,7 @@
{
try
{
- auto m = sdbusplus::message::message(msg);
+ auto m = sdbusplus::message_t(msg);
int timeout{};
m.read(timeout);
@@ -188,7 +188,7 @@
log<level::INFO>(
fmt::format("callbackGetState: {}", state).c_str());
- sdbusplus::message::message(msg).append(state);
+ sdbusplus::message_t(msg).append(state);
}
catch (const sdbusplus::exception_t& e)
{
@@ -212,7 +212,7 @@
{
try
{
- auto m = sdbusplus::message::message(msg);
+ auto m = sdbusplus::message_t(msg);
int state{};
m.read(state);
@@ -254,7 +254,7 @@
{
try
{
- auto m = sdbusplus::message::message(msg);
+ auto m = sdbusplus::message_t(msg);
std::string psError{};
m.read(psError);
diff --git a/phosphor-power-sequencer/src/power_interface.hpp b/phosphor-power-sequencer/src/power_interface.hpp
index e4bf8cd..6b07d41 100644
--- a/phosphor-power-sequencer/src/power_interface.hpp
+++ b/phosphor-power-sequencer/src/power_interface.hpp
@@ -30,7 +30,7 @@
* @param bus D-Bus bus object
* @param path D-Bus object path
*/
- PowerInterface(sdbusplus::bus::bus& bus, const char* path);
+ PowerInterface(sdbusplus::bus_t& bus, const char* path);
/**
* Emit the power good signal
diff --git a/phosphor-power-sequencer/src/power_sequencer_monitor.cpp b/phosphor-power-sequencer/src/power_sequencer_monitor.cpp
index e11fb3f..603dae1 100644
--- a/phosphor-power-sequencer/src/power_sequencer_monitor.cpp
+++ b/phosphor-power-sequencer/src/power_sequencer_monitor.cpp
@@ -29,8 +29,7 @@
using namespace phosphor::logging;
-PowerSequencerMonitor::PowerSequencerMonitor(sdbusplus::bus::bus& bus) :
- bus(bus)
+PowerSequencerMonitor::PowerSequencerMonitor(sdbusplus::bus_t& bus) : bus(bus)
{}
void PowerSequencerMonitor::createBmcDump()
diff --git a/phosphor-power-sequencer/src/power_sequencer_monitor.hpp b/phosphor-power-sequencer/src/power_sequencer_monitor.hpp
index eb151ce..ed095bb 100644
--- a/phosphor-power-sequencer/src/power_sequencer_monitor.hpp
+++ b/phosphor-power-sequencer/src/power_sequencer_monitor.hpp
@@ -26,7 +26,7 @@
* Create a base device object for power sequence monitoring.
* @param bus D-Bus bus object
*/
- explicit PowerSequencerMonitor(sdbusplus::bus::bus& bus);
+ explicit PowerSequencerMonitor(sdbusplus::bus_t& bus);
/**
* Logs an error using the D-Bus Create method.
@@ -50,7 +50,7 @@
/**
* The D-Bus bus object
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/*
* Create a BMC Dump
diff --git a/phosphor-power-sequencer/src/ucd90320_monitor.cpp b/phosphor-power-sequencer/src/ucd90320_monitor.cpp
index 050fcdc..297d20b 100644
--- a/phosphor-power-sequencer/src/ucd90320_monitor.cpp
+++ b/phosphor-power-sequencer/src/ucd90320_monitor.cpp
@@ -47,7 +47,7 @@
namespace device_error = sdbusplus::xyz::openbmc_project::Common::Device::Error;
-UCD90320Monitor::UCD90320Monitor(sdbusplus::bus::bus& bus, std::uint8_t i2cBus,
+UCD90320Monitor::UCD90320Monitor(sdbusplus::bus_t& bus, std::uint8_t i2cBus,
std::uint16_t i2cAddress) :
PowerSequencerMonitor(bus),
match{bus,
@@ -132,7 +132,7 @@
}
}
-void UCD90320Monitor::interfacesAddedHandler(sdbusplus::message::message& msg)
+void UCD90320Monitor::interfacesAddedHandler(sdbusplus::message_t& msg)
{
// Only continue if message is valid and rails / pins have not already been
// found
diff --git a/phosphor-power-sequencer/src/ucd90320_monitor.hpp b/phosphor-power-sequencer/src/ucd90320_monitor.hpp
index 59e784c..9bcbf77 100644
--- a/phosphor-power-sequencer/src/ucd90320_monitor.hpp
+++ b/phosphor-power-sequencer/src/ucd90320_monitor.hpp
@@ -47,14 +47,14 @@
* @param i2cBus The bus number of the power sequencer device
* @param i2cAddress The I2C address of the power sequencer device
*/
- UCD90320Monitor(sdbusplus::bus::bus& bus, std::uint8_t i2cBus,
+ UCD90320Monitor(sdbusplus::bus_t& bus, std::uint8_t i2cBus,
std::uint16_t i2cAddress);
/**
* Callback function to handle interfacesAdded D-Bus signals
* @param msg Expanded sdbusplus message data
*/
- void interfacesAddedHandler(sdbusplus::message::message& msg);
+ void interfacesAddedHandler(sdbusplus::message_t& msg);
/** @copydoc PowerSequencerMonitor::onFailure() */
void onFailure(bool timeout, const std::string& powerSupplyError) override;
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 8321a8a..6823622 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -30,7 +30,7 @@
using namespace phosphor::logging;
using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error;
-PowerSupply::PowerSupply(sdbusplus::bus::bus& bus, const std::string& invpath,
+PowerSupply::PowerSupply(sdbusplus::bus_t& bus, const std::string& invpath,
std::uint8_t i2cbus, std::uint16_t i2caddr,
const std::string& driver,
const std::string& gpioLineName) :
@@ -143,7 +143,7 @@
{
present = getPresence(bus, inventoryPath);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// Relying on property change or interface added to retry.
// Log an informational trace to the journal.
@@ -739,7 +739,7 @@
}
}
-void PowerSupply::inventoryChanged(sdbusplus::message::message& msg)
+void PowerSupply::inventoryChanged(sdbusplus::message_t& msg)
{
std::string msgSensor;
std::map<std::string, std::variant<uint32_t, bool>> msgData;
@@ -772,7 +772,7 @@
}
}
-void PowerSupply::inventoryAdded(sdbusplus::message::message& msg)
+void PowerSupply::inventoryAdded(sdbusplus::message_t& msg)
{
sdbusplus::message::object_path path;
msg.read(path);
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 218e2d5..a4888ec 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -63,7 +63,7 @@
* @param[in] gpioLineName - The gpio-line-name to read for presence. See
* https://github.com/openbmc/docs/blob/master/designs/device-tree-gpio-naming.md
*/
- PowerSupply(sdbusplus::bus::bus& bus, const std::string& invpath,
+ PowerSupply(sdbusplus::bus_t& bus, const std::string& invpath,
std::uint8_t i2cbus, const std::uint16_t i2caddr,
const std::string& driver, const std::string& gpioLineName);
@@ -513,7 +513,7 @@
private:
/** @brief systemd bus member */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Will be updated to the latest/lastvalue read from STATUS_WORD.*/
uint64_t statusWord = 0;
@@ -844,7 +844,7 @@
*
* @param[in] msg - Data associated with Present change signal
**/
- void inventoryChanged(sdbusplus::message::message& msg);
+ void inventoryChanged(sdbusplus::message_t& msg);
/**
* @brief Callback for inventory property added.
@@ -856,7 +856,7 @@
*
* @param[in] msg - Data associated with Present add signal
**/
- void inventoryAdded(sdbusplus::message::message& msg);
+ void inventoryAdded(sdbusplus::message_t& msg);
/**
* @brief Reads the pmbus MFR_POUT_MAX value.
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index cb83a2a..ebc953f 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -34,7 +34,7 @@
constexpr auto INPUT_HISTORY_SYNC_DELAY = 5;
-PSUManager::PSUManager(sdbusplus::bus::bus& bus, const sdeventplus::Event& e) :
+PSUManager::PSUManager(sdbusplus::bus_t& bus, const sdeventplus::Event& e) :
bus(bus), powerSystemInputs(bus, powerSystemsInputsObjPath),
objectManager(bus, objectManagerObjPath),
historyManager(bus, "/org/open_power/sensors")
@@ -365,7 +365,7 @@
}
}
-void PSUManager::entityManagerIfaceAdded(sdbusplus::message::message& msg)
+void PSUManager::entityManagerIfaceAdded(sdbusplus::message_t& msg)
{
try
{
@@ -405,7 +405,7 @@
}
}
-void PSUManager::powerStateChanged(sdbusplus::message::message& msg)
+void PSUManager::powerStateChanged(sdbusplus::message_t& msg)
{
std::string msgSensor;
std::map<std::string, std::variant<int>> msgData;
@@ -457,7 +457,7 @@
.c_str());
}
-void PSUManager::presenceChanged(sdbusplus::message::message& msg)
+void PSUManager::presenceChanged(sdbusplus::message_t& msg)
{
std::string msgSensor;
std::map<std::string, std::variant<uint32_t, bool>> msgData;
@@ -836,7 +836,7 @@
presProperty = getPresence(bus, psuInventoryPath);
propReadFail = false;
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
propReadFail = true;
// Relying on property change or interface added to retry.
diff --git a/phosphor-power-supply/psu_manager.hpp b/phosphor-power-supply/psu_manager.hpp
index 6f58eec..4b4171a 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -41,7 +41,7 @@
class PowerSystemInputs : public PowerSystemInputsObject
{
public:
- PowerSystemInputs(sdbusplus::bus::bus& bus, const std::string& path) :
+ PowerSystemInputs(sdbusplus::bus_t& bus, const std::string& path) :
PowerSystemInputsObject(bus, path.c_str())
{}
};
@@ -68,7 +68,7 @@
* @param[in] bus - D-Bus bus object
* @param[in] e - event object
*/
- PSUManager(sdbusplus::bus::bus& bus, const sdeventplus::Event& e);
+ PSUManager(sdbusplus::bus_t& bus, const sdeventplus::Event& e);
/**
* Get PSU properties from D-Bus, use that to build a power supply
@@ -138,7 +138,7 @@
/**
* The D-Bus object
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* The timer that runs to periodically check the power supplies.
@@ -207,7 +207,7 @@
*
* @param[in] msg - Data associated with the power state signal
*/
- void powerStateChanged(sdbusplus::message::message& msg);
+ void powerStateChanged(sdbusplus::message_t& msg);
/**
* @brief Callback for inventory property changes
@@ -216,7 +216,7 @@
*
* @param[in] msg - Data associated with the Present change signal
**/
- void presenceChanged(sdbusplus::message::message& msg);
+ void presenceChanged(sdbusplus::message_t& msg);
/**
* @brief Callback for entity-manager interface added
@@ -226,7 +226,7 @@
*
* @param[in] msg - Data associated with the interfaces added signal
*/
- void entityManagerIfaceAdded(sdbusplus::message::message& msg);
+ void entityManagerIfaceAdded(sdbusplus::message_t& msg);
/**
* @brief Adds properties to the inventory.
diff --git a/phosphor-power-supply/test/mock.hpp b/phosphor-power-supply/test/mock.hpp
index 13d22e6..d964964 100644
--- a/phosphor-power-supply/test/mock.hpp
+++ b/phosphor-power-supply/test/mock.hpp
@@ -48,18 +48,18 @@
virtual ~MockedUtil() = default;
MOCK_METHOD(bool, getPresence,
- (sdbusplus::bus::bus & bus, const std::string& invpath),
+ (sdbusplus::bus_t & bus, const std::string& invpath),
(const, override));
MOCK_METHOD(void, setPresence,
- (sdbusplus::bus::bus & bus, const std::string& invpath,
+ (sdbusplus::bus_t & bus, const std::string& invpath,
bool present, const std::string& name),
(const, override));
MOCK_METHOD(void, setAvailable,
- (sdbusplus::bus::bus & bus, const std::string& invpath,
+ (sdbusplus::bus_t & bus, const std::string& invpath,
bool available),
(const, override));
MOCK_METHOD(void, handleChassisHealthRollup,
- (sdbusplus::bus::bus & bus, const std::string& invpath,
+ (sdbusplus::bus_t & bus, const std::string& invpath,
bool addRollup),
(const, override));
};
diff --git a/phosphor-power-supply/util.hpp b/phosphor-power-supply/util.hpp
index caa5bac..01f5b0b 100644
--- a/phosphor-power-supply/util.hpp
+++ b/phosphor-power-supply/util.hpp
@@ -27,7 +27,7 @@
class Util : public UtilBase
{
public:
- bool getPresence(sdbusplus::bus::bus& bus,
+ bool getPresence(sdbusplus::bus_t& bus,
const std::string& invpath) const override
{
bool present = false;
@@ -39,7 +39,7 @@
return present;
}
- void setPresence(sdbusplus::bus::bus& bus, const std::string& invpath,
+ void setPresence(sdbusplus::bus_t& bus, const std::string& invpath,
bool present, const std::string& name) const override
{
using InternalFailure =
@@ -89,7 +89,7 @@
}
}
- void setAvailable(sdbusplus::bus::bus& bus, const std::string& invpath,
+ void setAvailable(sdbusplus::bus_t& bus, const std::string& invpath,
bool available) const override
{
PropertyMap invProp;
@@ -113,7 +113,7 @@
invMsg.append(std::move(invObj));
auto invMgrResponseMsg = bus.call(invMsg);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
using namespace phosphor::logging;
log<level::ERR>(
@@ -125,7 +125,7 @@
}
}
- void handleChassisHealthRollup(sdbusplus::bus::bus& bus,
+ void handleChassisHealthRollup(sdbusplus::bus_t& bus,
const std::string& invpath,
bool addRollup) const override
{
@@ -186,7 +186,7 @@
invpath, service, bus,
associations);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
using namespace phosphor::logging;
log<level::INFO>(fmt::format("Error trying to handle health rollup "
@@ -196,7 +196,7 @@
}
}
- std::string getChassis(sdbusplus::bus::bus& bus,
+ std::string getChassis(sdbusplus::bus_t& bus,
const std::string& invpath) const
{
// Use the 'chassis' association to find the parent chassis.
diff --git a/phosphor-power-supply/util_base.hpp b/phosphor-power-supply/util_base.hpp
index 684abdf..5d38a51 100644
--- a/phosphor-power-supply/util_base.hpp
+++ b/phosphor-power-supply/util_base.hpp
@@ -19,42 +19,40 @@
public:
virtual ~UtilBase() = default;
- virtual bool getPresence(sdbusplus::bus::bus& bus,
+ virtual bool getPresence(sdbusplus::bus_t& bus,
const std::string& invpath) const = 0;
- virtual void setPresence(sdbusplus::bus::bus& bus,
- const std::string& invpath, bool present,
- const std::string& name) const = 0;
+ virtual void setPresence(sdbusplus::bus_t& bus, const std::string& invpath,
+ bool present, const std::string& name) const = 0;
- virtual void setAvailable(sdbusplus::bus::bus& bus,
- const std::string& invpath,
+ virtual void setAvailable(sdbusplus::bus_t& bus, const std::string& invpath,
bool available) const = 0;
- virtual void handleChassisHealthRollup(sdbusplus::bus::bus& bus,
+ virtual void handleChassisHealthRollup(sdbusplus::bus_t& bus,
const std::string& invpath,
bool addRollup) const = 0;
};
const UtilBase& getUtils();
-inline bool getPresence(sdbusplus::bus::bus& bus, const std::string& invpath)
+inline bool getPresence(sdbusplus::bus_t& bus, const std::string& invpath)
{
return getUtils().getPresence(bus, invpath);
}
-inline void setPresence(sdbusplus::bus::bus& bus, const std::string& invpath,
+inline void setPresence(sdbusplus::bus_t& bus, const std::string& invpath,
bool present, const std::string& name)
{
return getUtils().setPresence(bus, invpath, present, name);
}
-inline void setAvailable(sdbusplus::bus::bus& bus, const std::string& invpath,
+inline void setAvailable(sdbusplus::bus_t& bus, const std::string& invpath,
bool available)
{
getUtils().setAvailable(bus, invpath, available);
}
-inline void handleChassisHealthRollup(sdbusplus::bus::bus& bus,
+inline void handleChassisHealthRollup(sdbusplus::bus_t& bus,
const std::string& invpath,
bool addRollup)
{
diff --git a/phosphor-regulators/src/dbus_sensor.cpp b/phosphor-regulators/src/dbus_sensor.cpp
index 1dfd172..31932b2 100644
--- a/phosphor-regulators/src/dbus_sensor.cpp
+++ b/phosphor-regulators/src/dbus_sensor.cpp
@@ -66,7 +66,7 @@
constexpr double voltageHysteresis = 0.001;
constexpr const char* voltageNamespace = "voltage";
-DBusSensor::DBusSensor(sdbusplus::bus::bus& bus, const std::string& name,
+DBusSensor::DBusSensor(sdbusplus::bus_t& bus, const std::string& name,
SensorType type, double value, const std::string& rail,
const std::string& deviceInventoryPath,
const std::string& chassisInventoryPath) :
diff --git a/phosphor-regulators/src/dbus_sensor.hpp b/phosphor-regulators/src/dbus_sensor.hpp
index 1ac9b61..1a4bfe0 100644
--- a/phosphor-regulators/src/dbus_sensor.hpp
+++ b/phosphor-regulators/src/dbus_sensor.hpp
@@ -120,7 +120,7 @@
* @param chassisInventoryPath D-Bus inventory path of the chassis that
* contains the voltage regulator device
*/
- explicit DBusSensor(sdbusplus::bus::bus& bus, const std::string& name,
+ explicit DBusSensor(sdbusplus::bus_t& bus, const std::string& name,
SensorType type, double value, const std::string& rail,
const std::string& deviceInventoryPath,
const std::string& chassisInventoryPath);
@@ -314,7 +314,7 @@
/**
* D-Bus bus object.
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Sensor name.
diff --git a/phosphor-regulators/src/dbus_sensors.hpp b/phosphor-regulators/src/dbus_sensors.hpp
index 590c960..7a4d6ca 100644
--- a/phosphor-regulators/src/dbus_sensors.hpp
+++ b/phosphor-regulators/src/dbus_sensors.hpp
@@ -50,7 +50,7 @@
*
* @param bus D-Bus bus object
*/
- explicit DBusSensors(sdbusplus::bus::bus& bus) :
+ explicit DBusSensors(sdbusplus::bus_t& bus) :
bus{bus}, manager{bus, sensorsObjectPath}
{}
@@ -81,7 +81,7 @@
/**
* D-Bus bus object.
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* D-Bus object manager.
diff --git a/phosphor-regulators/src/error_logging.hpp b/phosphor-regulators/src/error_logging.hpp
index 1468604..ae26dab 100644
--- a/phosphor-regulators/src/error_logging.hpp
+++ b/phosphor-regulators/src/error_logging.hpp
@@ -166,7 +166,7 @@
*
* @param bus D-Bus bus object
*/
- explicit DBusErrorLogging(sdbusplus::bus::bus& bus) : bus{bus}
+ explicit DBusErrorLogging(sdbusplus::bus_t& bus) : bus{bus}
{}
/** @copydoc ErrorLogging::logConfigFileError() */
@@ -264,7 +264,7 @@
/**
* D-Bus bus object.
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
};
} // namespace phosphor::power::regulators
diff --git a/phosphor-regulators/src/interfaces/manager_interface.cpp b/phosphor-regulators/src/interfaces/manager_interface.cpp
index 9e1cb34..81196c1 100644
--- a/phosphor-regulators/src/interfaces/manager_interface.cpp
+++ b/phosphor-regulators/src/interfaces/manager_interface.cpp
@@ -33,7 +33,7 @@
namespace interface
{
-ManagerInterface::ManagerInterface(sdbusplus::bus::bus& bus, const char* path) :
+ManagerInterface::ManagerInterface(sdbusplus::bus_t& bus, const char* path) :
_serverInterface(bus, path, interface, _vtable, this)
{}
@@ -44,7 +44,7 @@
{
try
{
- auto m = sdbusplus::message::message(msg);
+ auto m = sdbusplus::message_t(msg);
auto mgrObj = static_cast<ManagerInterface*>(context);
mgrObj->configure();
@@ -77,7 +77,7 @@
try
{
bool enable{};
- auto m = sdbusplus::message::message(msg);
+ auto m = sdbusplus::message_t(msg);
m.read(enable);
diff --git a/phosphor-regulators/src/interfaces/manager_interface.hpp b/phosphor-regulators/src/interfaces/manager_interface.hpp
index 3f262d3..6f4abe0 100644
--- a/phosphor-regulators/src/interfaces/manager_interface.hpp
+++ b/phosphor-regulators/src/interfaces/manager_interface.hpp
@@ -41,7 +41,7 @@
* @param[in] bus - Bus to attach to.
* @param[in] path - Path to attach at.
*/
- ManagerInterface(sdbusplus::bus::bus& bus, const char* path);
+ ManagerInterface(sdbusplus::bus_t& bus, const char* path);
/**
* @brief Implementation for the configure method
diff --git a/phosphor-regulators/src/manager.cpp b/phosphor-regulators/src/manager.cpp
index a99ec11..4bb9a23 100644
--- a/phosphor-regulators/src/manager.cpp
+++ b/phosphor-regulators/src/manager.cpp
@@ -71,7 +71,7 @@
*/
const fs::path testConfigFileDir{"/etc/phosphor-regulators"};
-Manager::Manager(sdbusplus::bus::bus& bus, const sdeventplus::Event& event) :
+Manager::Manager(sdbusplus::bus_t& bus, const sdeventplus::Event& event) :
ManagerObject{bus, managerObjPath}, bus{bus}, eventLoop{event},
services{bus}, phaseFaultTimer{event,
std::bind(&Manager::phaseFaultTimerExpired,
@@ -138,7 +138,7 @@
}
}
-void Manager::interfacesAddedHandler(sdbusplus::message::message& msg)
+void Manager::interfacesAddedHandler(sdbusplus::message_t& msg)
{
// Verify message is valid
if (!msg)
diff --git a/phosphor-regulators/src/manager.hpp b/phosphor-regulators/src/manager.hpp
index c056b27..fdb8461 100644
--- a/phosphor-regulators/src/manager.hpp
+++ b/phosphor-regulators/src/manager.hpp
@@ -36,7 +36,7 @@
using Timer = sdeventplus::utility::Timer<sdeventplus::ClockId::Monotonic>;
-using ManagerObject = sdbusplus::server::object::object<
+using ManagerObject = sdbusplus::server::object_t<
phosphor::power::regulators::interface::ManagerInterface>;
class Manager : public ManagerObject
@@ -56,7 +56,7 @@
* @param bus the D-Bus bus
* @param event the sdevent event
*/
- Manager(sdbusplus::bus::bus& bus, const sdeventplus::Event& event);
+ Manager(sdbusplus::bus_t& bus, const sdeventplus::Event& event);
/**
* Implements the D-Bus "configure" method.
@@ -73,7 +73,7 @@
*
* @param msg Expanded sdbusplus message data
*/
- void interfacesAddedHandler(sdbusplus::message::message& msg);
+ void interfacesAddedHandler(sdbusplus::message_t& msg);
/**
* Implements the D-Bus "monitor" method.
@@ -203,7 +203,7 @@
/**
* The D-Bus bus
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Event to loop on
@@ -228,7 +228,7 @@
/**
* List of D-Bus signal matches
*/
- std::vector<std::unique_ptr<sdbusplus::bus::match::match>> signals{};
+ std::vector<std::unique_ptr<sdbusplus::bus::match_t>> signals{};
/**
* Indicates whether regulator monitoring is enabled.
diff --git a/phosphor-regulators/src/presence_service.cpp b/phosphor-regulators/src/presence_service.cpp
index 61d8aec..017bc7a 100644
--- a/phosphor-regulators/src/presence_service.cpp
+++ b/phosphor-regulators/src/presence_service.cpp
@@ -41,7 +41,7 @@
util::getProperty(INVENTORY_IFACE, PRESENT_PROP, inventoryPath,
INVENTORY_MGR_IFACE, bus, present);
}
- catch (const sdbusplus::exception::exception& e)
+ catch (const sdbusplus::exception_t& e)
{
// If exception type is expected and indicates hardware not present
if (isExpectedException(e))
@@ -62,8 +62,7 @@
return present;
}
-bool DBusPresenceService::isExpectedException(
- const sdbusplus::exception::exception& e)
+bool DBusPresenceService::isExpectedException(const sdbusplus::exception_t& e)
{
// Initially assume exception is not one of the expected types
bool isExpected{false};
diff --git a/phosphor-regulators/src/presence_service.hpp b/phosphor-regulators/src/presence_service.hpp
index 83b73c1..9520dbd 100644
--- a/phosphor-regulators/src/presence_service.hpp
+++ b/phosphor-regulators/src/presence_service.hpp
@@ -83,7 +83,7 @@
*
* @param bus D-Bus bus object
*/
- explicit DBusPresenceService(sdbusplus::bus::bus& bus) : bus{bus}
+ explicit DBusPresenceService(sdbusplus::bus_t& bus) : bus{bus}
{}
/** @copydoc PresenceService::clearCache() */
@@ -102,12 +102,12 @@
*
* @return true if exception type is expected, false otherwise
*/
- bool isExpectedException(const sdbusplus::exception::exception& e);
+ bool isExpectedException(const sdbusplus::exception_t& e);
/**
* D-Bus bus object.
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Cached presence data.
diff --git a/phosphor-regulators/src/services.hpp b/phosphor-regulators/src/services.hpp
index 07e3d5f..3c2e3ff 100644
--- a/phosphor-regulators/src/services.hpp
+++ b/phosphor-regulators/src/services.hpp
@@ -52,7 +52,7 @@
*
* @return D-Bus bus
*/
- virtual sdbusplus::bus::bus& getBus() = 0;
+ virtual sdbusplus::bus_t& getBus() = 0;
/**
* Returns the error logging interface.
@@ -111,13 +111,13 @@
*
* @param bus D-Bus bus object
*/
- explicit BMCServices(sdbusplus::bus::bus& bus) :
+ explicit BMCServices(sdbusplus::bus_t& bus) :
bus{bus}, errorLogging{bus},
presenceService{bus}, sensors{bus}, vpd{bus}
{}
/** @copydoc Services::getBus() */
- virtual sdbusplus::bus::bus& getBus() override
+ virtual sdbusplus::bus_t& getBus() override
{
return bus;
}
@@ -156,7 +156,7 @@
/**
* D-Bus bus object.
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Implementation of the ErrorLogging interface using D-Bus method calls.
diff --git a/phosphor-regulators/src/vpd.hpp b/phosphor-regulators/src/vpd.hpp
index f2741d1..514172c 100644
--- a/phosphor-regulators/src/vpd.hpp
+++ b/phosphor-regulators/src/vpd.hpp
@@ -88,7 +88,7 @@
*
* @param bus D-Bus bus object
*/
- explicit DBusVPD(sdbusplus::bus::bus& bus) : bus{bus}
+ explicit DBusVPD(sdbusplus::bus_t& bus) : bus{bus}
{}
/** @copydoc VPD::clearCache() */
@@ -136,7 +136,7 @@
/**
* D-Bus bus object.
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Cached VPD keyword values.
diff --git a/phosphor-regulators/test/mock_services.hpp b/phosphor-regulators/test/mock_services.hpp
index 8e3a100..72e981e 100644
--- a/phosphor-regulators/test/mock_services.hpp
+++ b/phosphor-regulators/test/mock_services.hpp
@@ -49,7 +49,7 @@
virtual ~MockServices() = default;
/** @copydoc Services::getBus() */
- virtual sdbusplus::bus::bus& getBus() override
+ virtual sdbusplus::bus_t& getBus() override
{
return bus;
}
@@ -150,7 +150,7 @@
/**
* D-Bus bus object.
*/
- sdbusplus::bus::bus bus{sdbusplus::bus::new_default()};
+ sdbusplus::bus_t bus{sdbusplus::bus::new_default()};
/**
* Mock implementation of the ErrorLogging interface.
diff --git a/power-sequencer/mihawk-cpld.cpp b/power-sequencer/mihawk-cpld.cpp
index 4a7735d..5a6f09b 100644
--- a/power-sequencer/mihawk-cpld.cpp
+++ b/power-sequencer/mihawk-cpld.cpp
@@ -51,7 +51,7 @@
using namespace sdbusplus::org::open_power::Witherspoon::Fault::Error;
-MihawkCPLD::MihawkCPLD(size_t instance, sdbusplus::bus::bus& bus) :
+MihawkCPLD::MihawkCPLD(size_t instance, sdbusplus::bus_t& bus) :
Device(DEVICE_NAME, instance), bus(bus)
{}
diff --git a/power-sequencer/mihawk-cpld.hpp b/power-sequencer/mihawk-cpld.hpp
index f0af75a..7adf09e 100644
--- a/power-sequencer/mihawk-cpld.hpp
+++ b/power-sequencer/mihawk-cpld.hpp
@@ -37,7 +37,7 @@
* @param[in] instance - the device instance number
* @param[in] bus - D-Bus bus object
*/
- MihawkCPLD(size_t instance, sdbusplus::bus::bus& bus);
+ MihawkCPLD(size_t instance, sdbusplus::bus_t& bus);
/**
* Analyzes the device for errors when the device is
@@ -107,7 +107,7 @@
/**
* The D-Bus bus object
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Open CPLD_register via i2c.
diff --git a/power-sequencer/pgood_monitor.hpp b/power-sequencer/pgood_monitor.hpp
index bc1ffd5..85c20bf 100644
--- a/power-sequencer/pgood_monitor.hpp
+++ b/power-sequencer/pgood_monitor.hpp
@@ -43,7 +43,7 @@
* @param[in] t - time to allow PGOOD to come up
*/
PGOODMonitor(std::unique_ptr<phosphor::power::Device>&& d,
- sdbusplus::bus::bus& b, const sdeventplus::Event& e,
+ sdbusplus::bus_t& b, const sdeventplus::Event& e,
std::chrono::milliseconds& t) :
DeviceMonitor(std::move(d), e, t),
bus(b)
@@ -97,7 +97,7 @@
/**
* The D-Bus object
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* The match object for the properties changed signal
diff --git a/power-sequencer/runtime_monitor.cpp b/power-sequencer/runtime_monitor.cpp
index 01c3e4c..487a2a6 100644
--- a/power-sequencer/runtime_monitor.cpp
+++ b/power-sequencer/runtime_monitor.cpp
@@ -40,7 +40,7 @@
#endif
}
-void RuntimeMonitor::onPowerLost(sdbusplus::message::message&)
+void RuntimeMonitor::onPowerLost(sdbusplus::message_t&)
{
log<level::INFO>("PGOOD failure detected. Checking for faults.");
diff --git a/power-sequencer/runtime_monitor.hpp b/power-sequencer/runtime_monitor.hpp
index 8b6789d..a194d2e 100644
--- a/power-sequencer/runtime_monitor.hpp
+++ b/power-sequencer/runtime_monitor.hpp
@@ -49,7 +49,7 @@
* @param[in] i - poll interval
*/
RuntimeMonitor(std::unique_ptr<phosphor::power::Device>&& d,
- sdbusplus::bus::bus& b, const sdeventplus::Event& e,
+ sdbusplus::bus_t& b, const sdeventplus::Event& e,
std::chrono::milliseconds& i) :
DeviceMonitor(std::move(d), e, i),
bus(b), match(bus, getMatchString(),
@@ -75,7 +75,7 @@
*
* @param[in] msg - D-Bus message for callback
*/
- void onPowerLost(sdbusplus::message::message& msg);
+ void onPowerLost(sdbusplus::message_t& msg);
/**
* Returns the match string for the PowerLost signal
@@ -94,7 +94,7 @@
/**
* The D-Bus object
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Match object for PowerLost signals
diff --git a/power-sequencer/ucd90160.cpp b/power-sequencer/ucd90160.cpp
index 72728e4..3801d40 100644
--- a/power-sequencer/ucd90160.cpp
+++ b/power-sequencer/ucd90160.cpp
@@ -50,7 +50,7 @@
namespace device_error = sdbusplus::xyz::openbmc_project::Common::Device::Error;
namespace power_error = sdbusplus::org::open_power::Witherspoon::Fault::Error;
-UCD90160::UCD90160(size_t instance, sdbusplus::bus::bus& bus) :
+UCD90160::UCD90160(size_t instance, sdbusplus::bus_t& bus) :
Device(DEVICE_NAME, instance),
interface(std::get<ucd90160::pathField>(deviceMap.find(instance)->second),
DRIVER_NAME, instance),
diff --git a/power-sequencer/ucd90160.hpp b/power-sequencer/ucd90160.hpp
index 82efc92..4701826 100644
--- a/power-sequencer/ucd90160.hpp
+++ b/power-sequencer/ucd90160.hpp
@@ -43,7 +43,7 @@
* @param[in] instance - the device instance number
* @param[in] bus - D-Bus bus object
*/
- UCD90160(size_t instance, sdbusplus::bus::bus& bus);
+ UCD90160(size_t instance, sdbusplus::bus_t& bus);
/**
* Analyzes the device for errors when the device is
@@ -301,7 +301,7 @@
/**
* The D-Bus bus object
*/
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/**
* Map of device instance to the instance specific data
diff --git a/power-supply/average.hpp b/power-supply/average.hpp
index bbbda54..2a05912 100644
--- a/power-supply/average.hpp
+++ b/power-supply/average.hpp
@@ -11,7 +11,7 @@
{
template <typename T>
-using ServerObject = typename sdbusplus::server::object::object<T>;
+using ServerObject = typename sdbusplus::server::object_t<T>;
using AverageInterface =
sdbusplus::org::open_power::Sensor::Aggregation::History::server::Average;
@@ -42,7 +42,7 @@
* @param[in] bus - D-Bus object
* @param[in] objectPath - the D-Bus object path
*/
- Average(sdbusplus::bus::bus& bus, const std::string& objectPath) :
+ Average(sdbusplus::bus_t& bus, const std::string& objectPath) :
ServerObject<AverageInterface>(bus, objectPath.c_str())
{
unit(Average::Unit::Watts);
diff --git a/power-supply/main.cpp b/power-supply/main.cpp
index 00dae73..b526264 100644
--- a/power-supply/main.cpp
+++ b/power-supply/main.cpp
@@ -127,7 +127,7 @@
psuDevice->enableHistory(basePath, numRecords, syncGPIOPath, gpioNum);
// Systemd object manager
- sdbusplus::server::manager::manager objManager{bus, basePath.c_str()};
+ sdbusplus::server::manager_t objManager{bus, basePath.c_str()};
std::string busName =
std::string{INPUT_HISTORY_BUSNAME_ROOT} + '.' + name;
diff --git a/power-supply/maximum.hpp b/power-supply/maximum.hpp
index 2056510..599548e 100644
--- a/power-supply/maximum.hpp
+++ b/power-supply/maximum.hpp
@@ -11,7 +11,7 @@
{
template <typename T>
-using ServerObject = typename sdbusplus::server::object::object<T>;
+using ServerObject = typename sdbusplus::server::object_t<T>;
using MaximumInterface =
sdbusplus::org::open_power::Sensor::Aggregation::History::server::Maximum;
@@ -42,7 +42,7 @@
* @param[in] bus - D-Bus object
* @param[in] objectPath - the D-Bus object path
*/
- Maximum(sdbusplus::bus::bus& bus, const std::string& objectPath) :
+ Maximum(sdbusplus::bus_t& bus, const std::string& objectPath) :
ServerObject<MaximumInterface>(bus, objectPath.c_str())
{
unit(Maximum::Unit::Watts);
diff --git a/power-supply/power_supply.cpp b/power-supply/power_supply.cpp
index 548895d..ce6a43a 100644
--- a/power-supply/power_supply.cpp
+++ b/power-supply/power_supply.cpp
@@ -43,7 +43,7 @@
PowerSupply::PowerSupply(const std::string& name, size_t inst,
const std::string& objpath, const std::string& invpath,
- sdbusplus::bus::bus& bus, const sdeventplus::Event& e,
+ sdbusplus::bus_t& bus, const sdeventplus::Event& e,
std::chrono::seconds& t, std::chrono::seconds& p) :
Device(name, inst),
monitorPath(objpath), pmbusIntf(objpath),
@@ -175,7 +175,7 @@
return;
}
-void PowerSupply::inventoryChanged(sdbusplus::message::message& msg)
+void PowerSupply::inventoryChanged(sdbusplus::message_t& msg)
{
std::string msgSensor;
std::map<std::string, std::variant<uint32_t, bool>> msgData;
@@ -211,7 +211,7 @@
bus, this->present);
}
-void PowerSupply::powerStateChanged(sdbusplus::message::message& msg)
+void PowerSupply::powerStateChanged(sdbusplus::message_t& msg)
{
int32_t state = 0;
std::string msgSensor;
diff --git a/power-supply/power_supply.hpp b/power-supply/power_supply.hpp
index b3410af..c87df39 100644
--- a/power-supply/power_supply.hpp
+++ b/power-supply/power_supply.hpp
@@ -52,7 +52,7 @@
*/
PowerSupply(const std::string& name, size_t inst,
const std::string& objpath, const std::string& invpath,
- sdbusplus::bus::bus& bus, const sdeventplus::Event& e,
+ sdbusplus::bus_t& bus, const sdeventplus::Event& e,
std::chrono::seconds& t, std::chrono::seconds& p);
/**
@@ -115,7 +115,7 @@
std::string inventoryPath;
/** @brief Connection for sdbusplus bus */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief True if the power supply is present. */
bool present = false;
@@ -287,7 +287,7 @@
* @param[in] msg - Data associated with Present change signal
*
*/
- void inventoryChanged(sdbusplus::message::message& msg);
+ void inventoryChanged(sdbusplus::message_t& msg);
/**
* Updates the presence status by querying D-Bus
@@ -313,7 +313,7 @@
*
* @param[in] msg - Data associated with the power state signal
*/
- void powerStateChanged(sdbusplus::message::message& msg);
+ void powerStateChanged(sdbusplus::message_t& msg);
/**
* @brief Wrapper for PMBus::read() and adding metadata
diff --git a/tools/power-utils/updater.hpp b/tools/power-utils/updater.hpp
index fae9d24..458f651 100644
--- a/tools/power-utils/updater.hpp
+++ b/tools/power-utils/updater.hpp
@@ -95,7 +95,7 @@
private:
/** @brief The sdbusplus DBus bus connection */
- sdbusplus::bus::bus bus;
+ sdbusplus::bus_t bus;
/** @brief The PSU inventory path */
std::string psuInventoryPath;
diff --git a/utility.cpp b/utility.cpp
index 04cb6ae..ad8e232 100644
--- a/utility.cpp
+++ b/utility.cpp
@@ -34,7 +34,7 @@
using json = nlohmann::json;
std::string getService(const std::string& path, const std::string& interface,
- sdbusplus::bus::bus& bus, bool logError)
+ sdbusplus::bus_t& bus, bool logError)
{
auto method = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH,
MAPPER_INTERFACE, "GetObject");
@@ -63,8 +63,7 @@
return response.begin()->first;
}
-DbusPropertyMap getAllProperties(sdbusplus::bus::bus& bus,
- const std::string& path,
+DbusPropertyMap getAllProperties(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface,
const std::string& service)
{
@@ -88,7 +87,7 @@
return properties;
}
-DbusSubtree getSubTree(sdbusplus::bus::bus& bus, const std::string& path,
+DbusSubtree getSubTree(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface, int32_t depth)
{
auto mapperCall = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH,
@@ -157,7 +156,7 @@
return type;
}
-bool isPoweredOn(sdbusplus::bus::bus& bus, bool defaultState)
+bool isPoweredOn(sdbusplus::bus_t& bus, bool defaultState)
{
int32_t state = defaultState;
@@ -175,7 +174,7 @@
return state != 0;
}
-std::vector<std::string> getPSUInventoryPaths(sdbusplus::bus::bus& bus)
+std::vector<std::string> getPSUInventoryPaths(sdbusplus::bus_t& bus)
{
std::vector<std::string> paths;
auto method = bus.new_method_call(MAPPER_BUSNAME, MAPPER_PATH,
diff --git a/utility.hpp b/utility.hpp
index 31684ac..1db17f3 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -44,7 +44,7 @@
* @return The service name
*/
std::string getService(const std::string& path, const std::string& interface,
- sdbusplus::bus::bus& bus, bool logError = true);
+ sdbusplus::bus_t& bus, bool logError = true);
/**
* @brief Read a D-Bus property
@@ -59,7 +59,7 @@
template <typename T>
void getProperty(const std::string& interface, const std::string& propertyName,
const std::string& path, const std::string& service,
- sdbusplus::bus::bus& bus, T& value)
+ sdbusplus::bus_t& bus, T& value)
{
std::variant<T> property;
@@ -87,7 +87,7 @@
template <typename T>
void setProperty(const std::string& interface, const std::string& propertyName,
const std::string& path, const std::string& service,
- sdbusplus::bus::bus& bus, T& value)
+ sdbusplus::bus_t& bus, T& value)
{
std::variant<T> propertyValue(value);
@@ -109,8 +109,7 @@
*
* @return DbusPropertyMap - Map of property names and values
*/
-DbusPropertyMap getAllProperties(sdbusplus::bus::bus& bus,
- const std::string& path,
+DbusPropertyMap getAllProperties(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface,
const std::string& service = std::string());
@@ -128,7 +127,7 @@
* @return DbusSubtree - Map of object paths to a map of service names to their
* interfaces.
*/
-DbusSubtree getSubTree(sdbusplus::bus::bus& bus, const std::string& path,
+DbusSubtree getSubTree(sdbusplus::bus_t& bus, const std::string& path,
const std::string& interface, int32_t depth);
/**
@@ -138,7 +137,7 @@
* @param[in] bus - D-Bus object
*/
template <typename T>
-void powerOff(sdbusplus::bus::bus& bus)
+void powerOff(sdbusplus::bus_t& bus)
{
phosphor::logging::report<T>();
@@ -179,7 +178,7 @@
* @return true if power is on, otherwise false;
* defaultState if it fails to get the power state.
*/
-bool isPoweredOn(sdbusplus::bus::bus& bus, bool defaultState = false);
+bool isPoweredOn(sdbusplus::bus_t& bus, bool defaultState = false);
/**
* Get all PSU inventory paths from D-Bus
@@ -188,7 +187,7 @@
*
* @return The list of PSU inventory paths
*/
-std::vector<std::string> getPSUInventoryPaths(sdbusplus::bus::bus& bus);
+std::vector<std::string> getPSUInventoryPaths(sdbusplus::bus_t& bus);
} // namespace util
} // namespace power