| Jagpal Singh Gill | e92aba4 | 2025-10-16 00:00:13 -0700 | [diff] [blame^] | 1 | #pragma once |
| 2 | |
| 3 | #include "base_device.hpp" |
| 4 | |
| 5 | namespace phosphor::modbus::rtu::device |
| 6 | { |
| 7 | |
| 8 | namespace config |
| 9 | { |
| 10 | |
| 11 | enum class DeviceType |
| 12 | { |
| 13 | reservoirPumpUnit, |
| 14 | heatExchanger, |
| 15 | flowMeter, |
| 16 | unknown |
| 17 | }; |
| 18 | |
| 19 | enum class DeviceModel |
| 20 | { |
| 21 | RDF040DSS5193E0, |
| 22 | unknown |
| 23 | }; |
| 24 | |
| 25 | struct DeviceFactoryConfig : public Config |
| 26 | { |
| 27 | DeviceType deviceType = DeviceType::unknown; |
| 28 | DeviceModel deviceModel = DeviceModel::unknown; |
| 29 | }; |
| 30 | |
| 31 | } // namespace config |
| 32 | |
| 33 | class DeviceFactory |
| 34 | { |
| 35 | public: |
| 36 | DeviceFactory() = delete; |
| 37 | |
| 38 | static auto getInterfaces() -> std::vector<std::string>; |
| 39 | |
| 40 | static auto getConfig(sdbusplus::async::context& ctx, |
| 41 | const sdbusplus::message::object_path& objectPath, |
| 42 | const std::string& interfaceName) |
| 43 | -> sdbusplus::async::task<std::optional<config::DeviceFactoryConfig>>; |
| 44 | |
| 45 | static auto create(sdbusplus::async::context& ctx, |
| 46 | const config::DeviceFactoryConfig& config, |
| 47 | PortIntf& serialPort) -> std::unique_ptr<BaseDevice>; |
| 48 | }; |
| 49 | |
| 50 | } // namespace phosphor::modbus::rtu::device |