0

How can I get the signal?

asked 2014-12-20 20:38:53 -0700

anonymous user

Anonymous

updated 2014-12-21 16:59:06 -0700

I've made some device's properties with control panel interfaces. And I can set or get the properties with some specific object path as follow codes.

ProxyBusObject proxy =  bus.getProxyBusObject(busName, objectPath, sessionId, new Class<?>[] { Properties.class });

Properties prop = proxy.getInterface(Properties.class);

prop.Set("org.alljoyn.ControlPanel.Property", "Value", value);

And I want to get the signal - property's value changed. I've tried follow codes.

//(added signal handler after connect)
bus.registerSignalHandlers(A.this);
//

//(A class)
@BusSignalHandler(iface="org.alljoyn.ControlPanel.Property", signal="ValueChanged")
public void ValueChangedHandler(Variant var) { Log.d(TAG, "ValueChanged Signal.."); }

But I coundn't get any value changed signal.. Would you please let me know how can i get the signal?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-01-13 16:32:02 -0700

Casper gravatar image

There is a ValueChanged signal in org.alljoyn.ControlPanel.Property. I wanted get the ValueChanged signal with java.

<node xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="https://www.allseenalliance.org/schemas/introspect.xsd">
   <interface name="org.alljoyn.ControlPanel.Property">
      <property name="Version" type="q" access="read"/>
      <property name="States" type="u" access="read"/>
      <property name="OptParams" type="a{qv}" access="read"/>
      <property name="Value" type="v" access="readwrite"/>
      <signal name="MetadataChanged" />
      <signal name="ValueChanged">
         <arg type="v"/>
      </signal>
   </interface>
</node>

After I tried several things, with the code 2, I can get the valueChanged signal. I think the code 1 is better, but it does not work.

// code 1    
bus.registerSignalHandler("org.alljoyn.ControlPanel.Property", "ValueChanged", AllJoynHelper2.this, AllJoynHelper2.this.getClass().getMethod("valueChangedHandler", Variant.class));
// code 2
bus.registerSignalHandler("org.alljoyn.ioe.controlpanelservice.communication.interfaces.PropertyControl", "ValueChanged", AllJoynHelper2.this, AllJoynHelper2.this.getClass().getMethod("valueChangedHandler", Variant.class));
edit flag offensive delete publish link more
0

answered 2015-01-13 12:48:32 -0700

bspencer gravatar image

Can you confirm that you implemented the Properties BusObject in your software and have added it to the Bus?

In order to receive the Signal you need to have an interface registered with the system so that it knows how that it can understand the Signal when it comes in and then it will match your "rule" to invoke the ValueChangedHandler that you setup with the @BusSignalHandler annotation.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
2 followers

Stats

Asked: 2014-12-20 20:38:53 -0700

Seen: 131 times

Last updated: Jan 13 '15