sensor: Add new Accuracy interface
This will express the +/- percentage accuracy of the Value read. Default
to NaN (not a number).
Tested:
Local CI build against phosphor-dbus-interfaces clean.
Built p10bmc obmc-phosphor-image (devtool modify ...)
Find and view client.hpp and server.hpp for Accuracy, looks good.
Change-Id: I42b93c0267cf6ce397c922a0c161c41a56c8b30e
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
diff --git a/gen/xyz/openbmc_project/Sensor/Accuracy/meson.build b/gen/xyz/openbmc_project/Sensor/Accuracy/meson.build
new file mode 100644
index 0000000..b951c45
--- /dev/null
+++ b/gen/xyz/openbmc_project/Sensor/Accuracy/meson.build
@@ -0,0 +1,14 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+ 'xyz/openbmc_project/Sensor/Accuracy__cpp'.underscorify(),
+ input: [ '../../../../../yaml/xyz/openbmc_project/Sensor/Accuracy.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/Sensor/Accuracy',
+ ],
+)
+
diff --git a/gen/xyz/openbmc_project/Sensor/meson.build b/gen/xyz/openbmc_project/Sensor/meson.build
index 9e018b3..b4613c2 100644
--- a/gen/xyz/openbmc_project/Sensor/meson.build
+++ b/gen/xyz/openbmc_project/Sensor/meson.build
@@ -1,4 +1,18 @@
# Generated file; do not modify.
+subdir('Accuracy')
+generated_others += custom_target(
+ 'xyz/openbmc_project/Sensor/Accuracy__markdown'.underscorify(),
+ input: [ '../../../../yaml/xyz/openbmc_project/Sensor/Accuracy.interface.yaml', ],
+ output: [ 'Accuracy.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/Sensor/Accuracy',
+ ],
+)
+
subdir('Device')
generated_others += custom_target(
'xyz/openbmc_project/Sensor/Device__markdown'.underscorify(),
diff --git a/yaml/xyz/openbmc_project/Sensor/Accuracy.interface.yaml b/yaml/xyz/openbmc_project/Sensor/Accuracy.interface.yaml
new file mode 100644
index 0000000..7d5fa54
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Sensor/Accuracy.interface.yaml
@@ -0,0 +1,16 @@
+description: >
+ Implement to provide accuracy for sensor readings.
+
+properties:
+ - name: Accuracy
+ type: double
+ default: NaN
+ description: >
+ The accuracy range (+/-) of the sensor Value as a percentage, with a
+ value between 0 and 100.
+ This is NOT a percentage of the sensor value ranges.
+ A value of 0.25 would be 0.25%, a value of 2 would represent 2%.
+ A value of 2 for 2% would mean that a reading of 10 would have an
+ actual value of 9.8 to 10.2.
+ flags:
+ - readonly