valve: add event interface
Add the interface for valve to generate events when the valve is opened
or closed.
Change-Id: Ib27069ac41f8f97fabcdfcc5c2ad63d968ca4c6b
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/gen/xyz/openbmc_project/State/Valve/meson.build b/gen/xyz/openbmc_project/State/Valve/meson.build
new file mode 100644
index 0000000..bc6a399
--- /dev/null
+++ b/gen/xyz/openbmc_project/State/Valve/meson.build
@@ -0,0 +1,26 @@
+# Generated file; do not modify.
+
+sdbusplus_current_path = 'xyz/openbmc_project/State/Valve'
+
+generated_sources += custom_target(
+ 'xyz/openbmc_project/State/Valve__cpp'.underscorify(),
+ input: ['../../../../../yaml/xyz/openbmc_project/State/Valve.events.yaml'],
+ output: ['event.cpp', 'event.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/State/Valve',
+ ],
+ install: should_generate_cpp,
+ install_dir: [false, get_option('includedir') / sdbusplus_current_path],
+ build_by_default: should_generate_cpp,
+)
+
diff --git a/gen/xyz/openbmc_project/State/meson.build b/gen/xyz/openbmc_project/State/meson.build
index 7ac8f28..acd8a69 100644
--- a/gen/xyz/openbmc_project/State/meson.build
+++ b/gen/xyz/openbmc_project/State/meson.build
@@ -17,6 +17,7 @@
subdir('Shutdown')
subdir('SystemdTarget')
subdir('Thermal')
+subdir('Valve')
subdir('Watchdog')
sdbusplus_current_path = 'xyz/openbmc_project/State'
@@ -458,6 +459,50 @@
)
generated_markdown += custom_target(
+ 'xyz/openbmc_project/State/Valve__markdown'.underscorify(),
+ input: ['../../../../yaml/xyz/openbmc_project/State/Valve.events.yaml'],
+ output: ['Valve.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/State/Valve',
+ ],
+ install: should_generate_markdown,
+ install_dir: [inst_markdown_dir / sdbusplus_current_path],
+ build_by_default: should_generate_markdown,
+)
+
+generated_registry += custom_target(
+ 'xyz/openbmc_project/State/Valve__registry'.underscorify(),
+ input: ['../../../../yaml/xyz/openbmc_project/State/Valve.events.yaml'],
+ output: ['Valve.json'],
+ depend_files: sdbusplusplus_depfiles,
+ command: [
+ sdbuspp_gen_meson_prog,
+ '--command',
+ 'registry',
+ '--output',
+ meson.current_build_dir(),
+ '--tool',
+ sdbusplusplus_prog,
+ '--directory',
+ meson.current_source_dir() / '../../../../yaml',
+ 'xyz/openbmc_project/State/Valve',
+ ],
+ install: should_generate_registry,
+ install_dir: [inst_registry_dir / sdbusplus_current_path],
+ build_by_default: should_generate_registry,
+)
+
+generated_markdown += custom_target(
'xyz/openbmc_project/State/Watchdog__markdown'.underscorify(),
input: [
'../../../../yaml/xyz/openbmc_project/State/Watchdog.interface.yaml',
diff --git a/yaml/xyz/openbmc_project/State/Valve.events.yaml b/yaml/xyz/openbmc_project/State/Valve.events.yaml
new file mode 100644
index 0000000..d9e975b
--- /dev/null
+++ b/yaml/xyz/openbmc_project/State/Valve.events.yaml
@@ -0,0 +1,22 @@
+version: 1.0.0
+
+events:
+ - name: ValveOpen
+ metadata:
+ - name: ValveName
+ type: object_path
+ primary: true
+ description: The name or identifier of the valve.
+ en:
+ description: The valve is open for coolant flow to resume.
+ message: The {ValveName} is open for coolant flow.
+
+ - name: ValveClose
+ metadata:
+ - name: ValveName
+ type: object_path
+ primary: true
+ description: The name or identifier of the valve.
+ en:
+ description: The valve is closed for coolant flow to stop.
+ message: The {ValveName} is closed for coolant flow.