sdbus++: async: client: handle readonly flags for properties
When a property is marked 'const' or 'readonly' in an interface,
if we were to make a call to write the property we would end up
getting a dbus error. Be explicit by not generating the write
function, just like we do in the server interfaces.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iecbc7b9ee3542c1972437a11a9a77c054b758cef
diff --git a/tools/sdbusplus/templates/property.client.hpp.mako b/tools/sdbusplus/templates/property.client.hpp.mako
index b218588..46be6ea 100644
--- a/tools/sdbusplus/templates/property.client.hpp.mako
+++ b/tools/sdbusplus/templates/property.client.hpp.mako
@@ -7,6 +7,7 @@
${property.cppTypeParam(interface.name)}>(ctx, "${property.name}");
}
+% if 'const' not in property.flags and 'readonly' not in property.flags:
/** Set value of ${property.name}
* ${property.description.strip()}
*/
@@ -16,3 +17,4 @@
${property.cppTypeParam(interface.name)}>(
ctx, "${property.name}", std::forward<decltype(value)>(value));
}
+% endif