George Liu | d98174e | 2024-10-25 15:48:16 +0800 | [diff] [blame^] | 1 | #include "virtualSensor.hpp" |
| 2 | |
| 3 | #include <sdbusplus/server.hpp> |
| 4 | |
| 5 | int main() |
| 6 | { |
| 7 | // Get a handle to system dbus |
| 8 | auto bus = sdbusplus::bus::new_default(); |
| 9 | |
| 10 | // Add the ObjectManager interface |
| 11 | sdbusplus::server::manager_t objManager(bus, |
| 12 | "/xyz/openbmc_project/sensors"); |
| 13 | |
| 14 | // Create an virtual sensors object |
| 15 | phosphor::virtual_sensor::VirtualSensors virtualSensors(bus); |
| 16 | |
| 17 | // Request service bus name |
| 18 | bus.request_name("xyz.openbmc_project.VirtualSensor"); |
| 19 | |
| 20 | // Run the dbus loop. |
| 21 | bus.process_loop(); |
| 22 | |
| 23 | return 0; |
| 24 | } |