Add the main.cpp file
Separate the main method from virtualSensor.cpp and add it to the
main.cpp file.
Change-Id: Ife3dd9bb6dee552d944399bcc769fc6c4ba54a4b
Signed-off-by: George Liu <liuxiwei@ieisystem.com>
diff --git a/main.cpp b/main.cpp
new file mode 100644
index 0000000..177a0e0
--- /dev/null
+++ b/main.cpp
@@ -0,0 +1,24 @@
+#include "virtualSensor.hpp"
+
+#include <sdbusplus/server.hpp>
+
+int main()
+{
+ // Get a handle to system dbus
+ auto bus = sdbusplus::bus::new_default();
+
+ // Add the ObjectManager interface
+ sdbusplus::server::manager_t objManager(bus,
+ "/xyz/openbmc_project/sensors");
+
+ // Create an virtual sensors object
+ phosphor::virtual_sensor::VirtualSensors virtualSensors(bus);
+
+ // Request service bus name
+ bus.request_name("xyz.openbmc_project.VirtualSensor");
+
+ // Run the dbus loop.
+ bus.process_loop();
+
+ return 0;
+}