Respect case

This commit is contained in:
Florian RICHER 2025-04-19 22:39:10 +02:00
parent 09d58154eb
commit 149b747dce
Signed by: florian.richer
GPG key ID: C73D37CBED7BFC77
2 changed files with 9 additions and 12 deletions

View file

@ -2,15 +2,14 @@
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node> <node>
<interface name="com.example.mytest"> <interface name="com.example.mytest">
<method name="hello"> <method name="SayHello">
<arg name="name" direction="in" type="s"/>
<arg name="msg" direction="out" type="s"/> <arg name="msg" direction="out" type="s"/>
</method> </method>
<signal name="new_name"> <signal name="NameChanged">
<arg name="name" type="s"/> <arg name="Name" type="s"/>
</signal> </signal>
<property name="name" type="s" access="readwrite"/> <property name="Name" type="s" access="readwrite"/>
</interface> </interface>
</node> </node>

View file

@ -21,17 +21,15 @@ impl Device {
} }
impl mytest::ComExampleMytest for Device { impl mytest::ComExampleMytest for Device {
fn hello(&self, name: &str) -> Result<String, tree::MethodErr> { fn say_hello(&self) -> Result<String,tree::MethodErr> {
Ok(format!("Hello, {}!", name)) Ok(format!("Hello, {}!", self.name.borrow()))
} }
fn name(&self) -> Result<String, tree::MethodErr> { fn name(&self) -> Result<String,tree::MethodErr> {
let name = self.name.borrow(); Ok(self.name.borrow().clone())
Ok(name.clone())
} }
fn setname(&self, value: String) -> Result<(), tree::MethodErr> { fn set_name(&self,value:String) -> Result<(),tree::MethodErr> {
self.name.replace(value); self.name.replace(value);
Ok(()) Ok(())
} }