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: Ibd0930728f0a945f424e3a3b5d3e8ea9e54f1979
diff --git a/healthMonitor.cpp b/healthMonitor.cpp
index 3523b79..05f9cbc 100644
--- a/healthMonitor.cpp
+++ b/healthMonitor.cpp
@@ -417,7 +417,7 @@
return;
}
- sdbusplus::message::message msg = bus.new_method_call(
+ sdbusplus::message_t msg = bus.new_method_call(
"org.freedesktop.systemd1", "/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager", "StartUnit");
msg.append(sysdUnit, "replace");
@@ -436,7 +436,7 @@
// Find all BMCs (DBus objects implementing the
// Inventory.Item.Bmc interface that may be created by
// configuring the Inventory Manager)
- sdbusplus::message::message msg = bus.new_method_call(
+ sdbusplus::message_t msg = bus.new_method_call(
"xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTreePaths");
@@ -454,7 +454,7 @@
msg.append(std::vector<std::string>{
"xyz.openbmc_project.Inventory.Item.Bmc"});
- sdbusplus::message::message reply = bus.call(msg, 0);
+ sdbusplus::message_t reply = bus.call(msg, 0);
reply.read(bmcIds);
info("BMC inventory found");
}
@@ -640,11 +640,11 @@
// If the SystemInventory does not exist: wait for the InterfaceAdded signal
auto interfacesAddedSignalHandler =
- std::make_unique<sdbusplus::bus::match::match>(
- static_cast<sdbusplus::bus::bus&>(*conn),
+ std::make_unique<sdbusplus::bus::match_t>(
+ static_cast<sdbusplus::bus_t&>(*conn),
sdbusplus::bus::match::rules::interfacesAdded(
phosphor::health::BMCActivationPath),
- [conn](sdbusplus::message::message& msg) {
+ [conn](sdbusplus::message_t& msg) {
sdbusplus::message::object_path o;
msg.read(o);
if (!needUpdate && o.str == phosphor::health::BMCActivationPath)
diff --git a/healthMonitor.hpp b/healthMonitor.hpp
index b5013c8..b86563e 100644
--- a/healthMonitor.hpp
+++ b/healthMonitor.hpp
@@ -25,9 +25,9 @@
// Used for identifying the BMC inventory creation signal
const char* BMCActivationPath = "/xyz/openbmc_project/inventory/bmc/activation";
-bool FindSystemInventoryInObjectMapper(sdbusplus::bus::bus& bus)
+bool FindSystemInventoryInObjectMapper(sdbusplus::bus_t& bus)
{
- sdbusplus::message::message msg =
+ sdbusplus::message_t msg =
bus.new_method_call("xyz.openbmc_project.ObjectMapper",
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetObject");
@@ -36,7 +36,7 @@
try
{
- sdbusplus::message::message reply = bus.call(msg, 0);
+ sdbusplus::message_t reply = bus.call(msg, 0);
return true;
}
catch (const std::exception& e)
@@ -57,9 +57,8 @@
sdbusplus::xyz::openbmc_project::Association::server::Definitions;
using healthIfaces =
- sdbusplus::server::object::object<ValueIface, CriticalInterface,
- WarningInterface,
- AssociationDefinitionInterface>;
+ sdbusplus::server::object_t<ValueIface, CriticalInterface, WarningInterface,
+ AssociationDefinitionInterface>;
using AssociationTuple = std::tuple<std::string, std::string, std::string>;
@@ -92,7 +91,7 @@
* @param[in] bus - Handle to system dbus
* @param[in] objPath - The Dbus path of health sensor
*/
- HealthSensor(sdbusplus::bus::bus& bus, const char* objPath,
+ HealthSensor(sdbusplus::bus_t& bus, const char* objPath,
HealthConfig& sensorConfig,
const std::vector<std::string>& bmcIds) :
healthIfaces(bus, objPath),
@@ -116,7 +115,7 @@
private:
/** @brief sdbusplus bus client connection. */
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
/** @brief Sensor config from config file */
HealthConfig& sensorConfig;
/** @brief the Event Loop structure */
@@ -147,7 +146,7 @@
*
* @param[in] bus - Handle to system dbus
*/
- HealthMon(sdbusplus::bus::bus& bus) : bus(bus)
+ HealthMon(sdbusplus::bus_t& bus) : bus(bus)
{
// Read JSON file
sensorConfigs = getHealthConfig();
@@ -168,7 +167,7 @@
void createHealthSensors(const std::vector<std::string>& bmcIds);
private:
- sdbusplus::bus::bus& bus;
+ sdbusplus::bus_t& bus;
std::vector<HealthConfig> sensorConfigs;
std::vector<HealthConfig> getHealthConfig();
};