Make interface string public

The interface string was private, and the users of sdbusplus have to
define their own strings for the D-Bus interfaces.
By making the interface string public, users do not have to define their
own and the generated string could be used instead.

E.g. one could directly use "Calculator::interface" instead of
"net.poettering.Calculator" in the example.

Signed-off-by: Lei YU <mine260309@gmail.com>
Change-Id: I0846d4e0609c8588d81e8a19bdd69fd79df83848
diff --git a/tools/sdbusplus/templates/interface.mako.server.cpp.in b/tools/sdbusplus/templates/interface.mako.server.cpp.in
index 5af2749..060e32c 100644
--- a/tools/sdbusplus/templates/interface.mako.server.cpp.in
+++ b/tools/sdbusplus/templates/interface.mako.server.cpp.in
@@ -29,7 +29,7 @@
 
 ${classname}::${classname}(bus::bus& bus, const char* path)
         : _${interface_instance()}(
-                bus, path, _interface, _vtable, this), _intf(bus.getInterface())
+                bus, path, interface, _vtable, this), _intf(bus.getInterface())
 {
 }
 
diff --git a/tools/sdbusplus/templates/interface.mako.server.hpp b/tools/sdbusplus/templates/interface.mako.server.hpp
index e5b17ea..a04c02e 100644
--- a/tools/sdbusplus/templates/interface.mako.server.hpp
+++ b/tools/sdbusplus/templates/interface.mako.server.hpp
@@ -121,6 +121,8 @@
     static ${e.name} convert${e.name}FromString(const std::string& s);
     % endfor
 
+        static constexpr auto interface = "${interface.name}";
+
     private:
     % for m in interface.methods:
 ${ m.cpp_prototype(loader, interface=interface, ptype='callback-header') }
@@ -138,7 +140,6 @@
 
     % endfor
 
-        static constexpr auto _interface = "${interface.name}";
         static const vtable::vtable_t _vtable[];
         sdbusplus::server::interface::interface
                 _${"_".join(interface.name.split('.'))}_interface;