add dbus interface for modbus inventory source
The modbus detect service will probe the modbus to detect devices using
the configuration supplied via ModbusDetectDevice interface. In return,
it will generate this Dbus interface to publish inventory information
for discovered modbus devices of that type.
Change-Id: I786b820babe9bed108e13f752a99c0756edc2038
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/gen/xyz/openbmc_project/Inventory/Source/Modbus/FRU/meson.build b/gen/xyz/openbmc_project/Inventory/Source/Modbus/FRU/meson.build
new file mode 100644
index 0000000..b2e4b9b
--- /dev/null
+++ b/gen/xyz/openbmc_project/Inventory/Source/Modbus/FRU/meson.build
@@ -0,0 +1,40 @@
+# Generated file; do not modify.
+
+sdbusplus_current_path = 'xyz/openbmc_project/Inventory/Source/Modbus/FRU'
+
+generated_sources += custom_target(
+ 'xyz/openbmc_project/Inventory/Source/Modbus/FRU__cpp'.underscorify(),
+ input: [
+ '../../../../../../../yaml/xyz/openbmc_project/Inventory/Source/Modbus/FRU.interface.yaml',
+ ],
+ output: [
+ 'common.hpp',
+ 'server.hpp',
+ 'server.cpp',
+ 'aserver.hpp',
+ 'client.hpp',
+ ],
+ depend_files: sdbusplusplus_depfiles,
+ command: [
+ sdbuspp_gen_meson_prog,
+ '--command',
+ 'cpp',
+ '--output',
+ meson.current_build_dir(),
+ '--tool',
+ sdbusplusplus_prog,
+ '--directory',
+ meson.current_source_dir() / '../../../../../../../yaml',
+ 'xyz/openbmc_project/Inventory/Source/Modbus/FRU',
+ ],
+ install: should_generate_cpp,
+ install_dir: [
+ get_option('includedir') / sdbusplus_current_path,
+ get_option('includedir') / sdbusplus_current_path,
+ false,
+ get_option('includedir') / sdbusplus_current_path,
+ get_option('includedir') / sdbusplus_current_path,
+ ],
+ build_by_default: should_generate_cpp,
+)
+
diff --git a/gen/xyz/openbmc_project/Inventory/Source/Modbus/meson.build b/gen/xyz/openbmc_project/Inventory/Source/Modbus/meson.build
new file mode 100644
index 0000000..7c9b9cd
--- /dev/null
+++ b/gen/xyz/openbmc_project/Inventory/Source/Modbus/meson.build
@@ -0,0 +1,29 @@
+# Generated file; do not modify.
+subdir('FRU')
+
+sdbusplus_current_path = 'xyz/openbmc_project/Inventory/Source/Modbus'
+
+generated_markdown += custom_target(
+ 'xyz/openbmc_project/Inventory/Source/Modbus/FRU__markdown'.underscorify(),
+ input: [
+ '../../../../../../yaml/xyz/openbmc_project/Inventory/Source/Modbus/FRU.interface.yaml',
+ ],
+ output: ['FRU.md'],
+ depend_files: sdbusplusplus_depfiles,
+ command: [
+ sdbuspp_gen_meson_prog,
+ '--command',
+ 'markdown',
+ '--output',
+ meson.current_build_dir(),
+ '--tool',
+ sdbusplusplus_prog,
+ '--directory',
+ meson.current_source_dir() / '../../../../../../yaml',
+ 'xyz/openbmc_project/Inventory/Source/Modbus/FRU',
+ ],
+ install: should_generate_markdown,
+ install_dir: [inst_markdown_dir / sdbusplus_current_path],
+ build_by_default: should_generate_markdown,
+)
+
diff --git a/gen/xyz/openbmc_project/Inventory/Source/meson.build b/gen/xyz/openbmc_project/Inventory/Source/meson.build
index ee7460e..90fbbb5 100644
--- a/gen/xyz/openbmc_project/Inventory/Source/meson.build
+++ b/gen/xyz/openbmc_project/Inventory/Source/meson.build
@@ -1,5 +1,6 @@
# Generated file; do not modify.
subdir('DevicePresence')
+subdir('Modbus')
subdir('PLDM')
sdbusplus_current_path = 'xyz/openbmc_project/Inventory/Source'
diff --git a/yaml/xyz/openbmc_project/Inventory/Source/Modbus/FRU.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Source/Modbus/FRU.interface.yaml
new file mode 100644
index 0000000..f97720d
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Inventory/Source/Modbus/FRU.interface.yaml
@@ -0,0 +1,51 @@
+description: >
+ This interface displays FRU inventory information for a Modbus device,
+ including specific hardware access details such as address and LinkTTY that
+ were discovered through probing.
+
+properties:
+ - name: Name
+ type: string
+ description: >
+ The name of the modbus device.
+ - name: Address
+ type: uint16
+ description: >
+ The address of the modbus device.
+ - name: LinkTTY
+ type: string
+ description: >
+ The Link TTY on which this device is discovered.
+ - name: PartNumber
+ type: string
+ default: "Unknown"
+ description: >
+ The part number of the modbus device.
+ - name: SparePartNumber
+ type: string
+ default: "Unknown"
+ description: >
+ The additional part number, if any.
+ - name: SerialNumber
+ type: string
+ default: "Unknown"
+ description: >
+ The serial number of the modbus device.
+ - name: BuildDate
+ type: string
+ default: "Unknown"
+ description: >
+ The date this specific modbus device was built or manufactured.
+ - name: Model
+ type: string
+ default: "Unknown"
+ description: >
+ The model of the modbus device.
+ - name: Manufacturer
+ type: string
+ default: "Unknown"
+ description: >
+ The manufacturer name of the modbus device.
+
+paths:
+ - namespace: /xyz/openbmc_project/inventory_source