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: I5763a3249f5c8baba800cf5886cb0df4d6b21e58
diff --git a/include/sensorutils.hpp b/include/sensorutils.hpp
index e404a21..5e88dc4 100644
--- a/include/sensorutils.hpp
+++ b/include/sensorutils.hpp
@@ -76,7 +76,7 @@
sd_bus_unref(bus);
return false;
}
- sdbusplus::bus::bus dbus(bus);
+ sdbusplus::bus_t dbus(bus);
auto mapperCall =
dbus.new_method_call("xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 577f513..6d7829a 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -50,7 +50,7 @@
size_t getSelectorPosition();
static void registerOEMFunctions() __attribute__((constructor));
-sdbusplus::bus::bus dbus(ipmid_get_sd_bus_connection()); // from ipmid/api.h
+sdbusplus::bus_t dbus(ipmid_get_sd_bus_connection()); // from ipmid/api.h
static constexpr size_t maxFRUStringLength = 0x3F;
constexpr uint8_t cmdSetSystemGuid = 0xEF;
@@ -111,8 +111,7 @@
return address.find(IPV4_PREFIX) == 0 || address.find(IPV6_PREFIX) == 0;
}
-DbusObjectInfo getIPObject(sdbusplus::bus::bus& bus,
- const std::string& interface,
+DbusObjectInfo getIPObject(sdbusplus::bus_t& bus, const std::string& interface,
const std::string& serviceRoot,
const std::string& match)
{
@@ -268,7 +267,7 @@
ipmi_ret_t getNetworkData(uint8_t lan_param, char* data)
{
ipmi_ret_t rc = IPMI_CC_OK;
- sdbusplus::bus::bus bus(ipmid_get_sd_bus_connection());
+ sdbusplus::bus_t bus(ipmid_get_sd_bus_connection());
const std::string ethdevice = "eth0";
@@ -373,7 +372,7 @@
sd_bus_unref(bus);
return -1;
}
- sdbusplus::bus::bus dbus(bus);
+ sdbusplus::bus_t dbus(bus);
auto mapperCall = dbus.new_method_call("xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper",
diff --git a/src/storagecommands.cpp b/src/storagecommands.cpp
index dc6c91b..d79c6d4 100644
--- a/src/storagecommands.cpp
+++ b/src/storagecommands.cpp
@@ -73,7 +73,7 @@
// collision to verify our dev-id
boost::container::flat_map<uint8_t, std::pair<uint8_t, uint8_t>> deviceHashes;
-static sdbusplus::bus::bus dbus(ipmid_get_sd_bus_connection());
+static sdbusplus::bus_t dbus(ipmid_get_sd_bus_connection());
static bool getSensorMap(std::string sensorConnection, std::string sensorPath,
SensorMap& sensorMap)
@@ -134,13 +134,13 @@
bool writeFru()
{
- sdbusplus::message::message writeFru = dbus.new_method_call(
+ sdbusplus::message_t writeFru = dbus.new_method_call(
fruDeviceServiceName, "/xyz/openbmc_project/FruDevice",
"xyz.openbmc_project.FruDeviceManager", "WriteFru");
writeFru.append(cacheBus, cacheAddr, fruCache);
try
{
- sdbusplus::message::message writeFruResp = dbus.call(writeFru);
+ sdbusplus::message_t writeFruResp = dbus.call(writeFru);
}
catch (const sdbusplus::exception_t&)
{
@@ -176,13 +176,13 @@
writeFru();
}
- sdbusplus::message::message getObjects = dbus.new_method_call(
+ sdbusplus::message_t getObjects = dbus.new_method_call(
fruDeviceServiceName, "/", "org.freedesktop.DBus.ObjectManager",
"GetManagedObjects");
ManagedObjectType frus;
try
{
- sdbusplus::message::message resp = dbus.call(getObjects);
+ sdbusplus::message_t resp = dbus.call(getObjects);
resp.read(frus);
}
catch (const sdbusplus::exception_t&)
@@ -258,7 +258,7 @@
}
fruCache.clear();
- sdbusplus::message::message getRawFru = dbus.new_method_call(
+ sdbusplus::message_t getRawFru = dbus.new_method_call(
fruDeviceServiceName, "/xyz/openbmc_project/FruDevice",
"xyz.openbmc_project.FruDeviceManager", "GetRawFru");
cacheBus = deviceFind->second.first;
@@ -266,7 +266,7 @@
getRawFru.append(cacheBus, cacheAddr);
try
{
- sdbusplus::message::message getRawResp = dbus.call(getRawFru);
+ sdbusplus::message_t getRawResp = dbus.call(getRawFru);
getRawResp.read(fruCache);
}
catch (const sdbusplus::exception_t&)
@@ -446,12 +446,12 @@
ManagedObjectType frus;
- sdbusplus::message::message getObjects = dbus.new_method_call(
+ sdbusplus::message_t getObjects = dbus.new_method_call(
fruDeviceServiceName, "/", "org.freedesktop.DBus.ObjectManager",
"GetManagedObjects");
try
{
- sdbusplus::message::message resp = dbus.call(getObjects);
+ sdbusplus::message_t resp = dbus.call(getObjects);
resp.read(frus);
}
catch (const sdbusplus::exception_t&)