Add Generic button dbus interface
The button interface is a generic dbus interface which can be used
in the front panel phosphor-buttons dbus objects that has button type
physical form factor(Pressed/Released).
This dbus interface will be initially used by ocp debug card host selector
button interface as it has a button form factor type.
Design : https://github.com/openbmc/docs/blob/master/designs/multihost-phosphor-buttons.md
Signed-off-by: Naveen Moses <naveen.mosess@hcl.com>
Change-Id: I10e940c93ce549489fd23ff76a3be9e09ae1ae9c
diff --git a/gen/xyz/openbmc_project/Chassis/Buttons/Button/meson.build b/gen/xyz/openbmc_project/Chassis/Buttons/Button/meson.build
new file mode 100644
index 0000000..dfe5489
--- /dev/null
+++ b/gen/xyz/openbmc_project/Chassis/Buttons/Button/meson.build
@@ -0,0 +1,14 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+ 'xyz/openbmc_project/Chassis/Buttons/Button__cpp'.underscorify(),
+ input: [ '../../../../../../yaml/xyz/openbmc_project/Chassis/Buttons/Button.interface.yaml', ],
+ output: [ 'server.cpp', 'server.hpp', 'client.hpp', ],
+ command: [
+ sdbuspp_gen_meson_prog, '--command', 'cpp',
+ '--output', meson.current_build_dir(),
+ '--tool', sdbusplusplus_prog,
+ '--directory', meson.current_source_dir() / '../../../../../../yaml',
+ 'xyz/openbmc_project/Chassis/Buttons/Button',
+ ],
+)
+
diff --git a/gen/xyz/openbmc_project/Chassis/Buttons/meson.build b/gen/xyz/openbmc_project/Chassis/Buttons/meson.build
index 994214a..0de2bfb 100644
--- a/gen/xyz/openbmc_project/Chassis/Buttons/meson.build
+++ b/gen/xyz/openbmc_project/Chassis/Buttons/meson.build
@@ -1,4 +1,18 @@
# Generated file; do not modify.
+subdir('Button')
+generated_others += custom_target(
+ 'xyz/openbmc_project/Chassis/Buttons/Button__markdown'.underscorify(),
+ input: [ '../../../../../yaml/xyz/openbmc_project/Chassis/Buttons/Button.interface.yaml', ],
+ output: [ 'Button.md' ],
+ command: [
+ sdbuspp_gen_meson_prog, '--command', 'markdown',
+ '--output', meson.current_build_dir(),
+ '--tool', sdbusplusplus_prog,
+ '--directory', meson.current_source_dir() / '../../../../../yaml',
+ 'xyz/openbmc_project/Chassis/Buttons/Button',
+ ],
+)
+
subdir('HostSelector')
generated_others += custom_target(
'xyz/openbmc_project/Chassis/Buttons/HostSelector__markdown'.underscorify(),
diff --git a/yaml/xyz/openbmc_project/Chassis/Buttons/Button.interface.yaml b/yaml/xyz/openbmc_project/Chassis/Buttons/Button.interface.yaml
new file mode 100644
index 0000000..4acaf70
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Chassis/Buttons/Button.interface.yaml
@@ -0,0 +1,47 @@
+description: >
+ Button interface is a generic phosphor button interface which supports
+ two primary actions (pressed/releasd). When the button is pressed
+ "Pressed" signal is emitted and when button is released then "Released"
+ signal is emitted.
+methods:
+ - name: simPress
+ description: >
+ Emulate button press.
+ errors:
+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+ - xyz.openbmc_project.Chassis.Common.Error.IOError
+ - name: simRelease
+ description: >
+ Emulate button release.
+ errors:
+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+ - xyz.openbmc_project.Chassis.Common.Error.IOError
+ - name: simLongPress
+ description: >
+ Emulate long button press.
+ errors:
+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+ - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+properties:
+ - name: Enabled
+ type: boolean
+ default: true
+ description: >
+ Enable/disable the button object.
+ false means button is disabled
+ true means button is enabled
+ errors:
+ - xyz.openbmc_project.Chassis.Common.Error.UnsupportedCommand
+ - xyz.openbmc_project.Chassis.Common.Error.IOError
+
+signals:
+ - name: Released
+ description: >
+ Button released signal
+ - name: Pressed
+ description: >
+ Button pressed signal
+ - name: PressedLong
+ description: >
+ Button long pressed signal