psu-ng: Change main to call non-JSON PSUManager

Change the main function to create the PSU manager object using the
constructor that will pull configuration from D-Bus rather than from a
JSON configuration file.

Since the JSON configuration file parsing information is no longer
passed down to the constructor, remove the argument parsing and default
file handling code.

Update the README to remove the JSON configuration information, add the
D-Bus configuration information.

Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Change-Id: I04f0d532f862bb4e8aa2e7a88dc06327c90d777d
diff --git a/phosphor-power-supply/README.md b/phosphor-power-supply/README.md
index ffb57f5..389dcc9 100644
--- a/phosphor-power-supply/README.md
+++ b/phosphor-power-supply/README.md
@@ -7,27 +7,28 @@
 To enable reading VPD data via PMBus commands to IBM common form factor
 power supplies (ibm-cffps), run meson with `-Dibm-vpd=true`.
 
-# JSON Configuration File
-
-The JSON configuration file should contain:
-
-## PowerSupplies
-An array of power supply properties.
-
-### Inventory
-The D-Bus path used to check the power supply presence (Present) property.
-
-### Bus
-An integer specifying the I2C bus that the PMBus power supply is on.
-
-### Address
-A string representing the 16-bit I2C address of the PMBus power supply.
-
 # D-Bus System Configuration
 
-Entity Manager provides information about the supported system configuration.
+Entity Manager provides information about the supported system configuration
+and the power supply connectors (IBMCFFPSConnector).
+
 The information is as follows:
 
 ## Max Power Supplies
 Integer that indicates the maximum number of power supplies that should be
 present. This is exposed via the `MaxCount` property.
+
+## I2C Bus
+The I2C bus(es) that the power supply is on will be represented by the `I2CBus`
+property under the `xyz.openbmc_project.Configuration.IBMCFFPSConnector`
+interface(s).
+
+## I2C Address
+The I2C address(es) that the power supply is at will be represented by the
+`I2CAddress` property under the IBMCFFPSConnector interface(s).
+
+## Name
+The `Name` property under the IBMCFFPSConnector interface(s) will be used to
+create an inventory path for the power supply. This inventory path is used as
+part of the power supply presence detection, reading the `Present` property
+under this path.
diff --git a/phosphor-power-supply/main.cpp b/phosphor-power-supply/main.cpp
index 8960a53..c48c73a 100644
--- a/phosphor-power-supply/main.cpp
+++ b/phosphor-power-supply/main.cpp
@@ -24,7 +24,7 @@
 
 using namespace phosphor::power;
 
-int main(int argc, char* argv[])
+int main(void)
 {
     try
     {
@@ -32,34 +32,6 @@
 
         CLI::App app{"OpenBMC Power Supply Unit Monitor"};
 
-        std::string configfile;
-        app.add_option("-c,--config", configfile,
-                       "JSON configuration file path");
-
-        // Read the arguments.
-        CLI11_PARSE(app, argc, argv);
-        if (configfile.empty())
-        {
-            if (std::filesystem::exists(
-                    "/etc/phosphor-psu-monitor/psu_config.json"))
-            {
-                configfile = "/etc/phosphor-psu-monitor/psu_config.json";
-            }
-            else
-            {
-                configfile = "/usr/share/phosphor-psu-monitor/psu_config.json";
-            }
-        }
-
-        if (!std::filesystem::exists(configfile))
-        {
-            log<level::ERR>((std::string("Configuration file does not exist: "
-                                         "FILENAME=") +
-                             configfile)
-                                .c_str());
-            return -1;
-        }
-
         auto bus = sdbusplus::bus::new_default();
         auto event = sdeventplus::Event::get_default();
 
@@ -67,7 +39,7 @@
         // handle both sd_events (for the timers) and dbus signals.
         bus.attach_event(event.get(), SD_EVENT_PRIORITY_NORMAL);
 
-        manager::PSUManager manager(bus, event, configfile);
+        manager::PSUManager manager(bus, event);
 
         return manager.run();
     }