blob: ca37b7b730b45089ff52066389265d8deba7950e [file] [log] [blame]
Jagpal Singh Gille92aba42025-10-16 00:00:13 -07001#pragma once
2
3#include "base_device.hpp"
4
5namespace phosphor::modbus::rtu::device
6{
7
8namespace config
9{
10
11enum class DeviceType
12{
13 reservoirPumpUnit,
14 heatExchanger,
15 flowMeter,
16 unknown
17};
18
19enum class DeviceModel
20{
21 RDF040DSS5193E0,
22 unknown
23};
24
25struct DeviceFactoryConfig : public Config
26{
27 DeviceType deviceType = DeviceType::unknown;
28 DeviceModel deviceModel = DeviceModel::unknown;
29};
30
31} // namespace config
32
33class 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,
Jagpal Singh Gill71848052025-10-16 00:28:58 -070047 PortIntf& serialPort, EventIntf::Events& events)
48 -> std::unique_ptr<BaseDevice>;
Jagpal Singh Gille92aba42025-10-16 00:00:13 -070049};
50
51} // namespace phosphor::modbus::rtu::device