How can a controllee notify a controller of a value change of a read-only property? [closed]

asked 2015-12-06 18:00:13 -0700

renwei gravatar image

By checking the control panel code (e.g., in services\base\controlpanel\cpp\src\Widgets\Property.cc), I notice that the ValueChanged signal is sent by the controllee to all controllers only when SetPropertyValue is called, i.e., the property is being changed by a controller. Since we can define a read-only property by setting "writtable" to false in the UI xml, I assume that SetPropertyValue won't be called for those read-only properties. In this case, if the controllee internally changes the read-only property value (e.g., a smart AC updates the current temperature), how can the controllee notify the controllers of the property value change? Do the controllers have to periodically get the property value?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by renwei
close date 2015-12-07 23:30:15

2 answers

Sort by ยป oldest newest most voted

answered 2015-12-07 12:22:16 -0700

praveenb gravatar image

As you correctly note, a property can either be externally changed via org.freedesktop.DBus.Properties.Set or it can be internally updated due to changes in the environment. The application running on the device (smart AC in your case), can choose to emit a org.freedesktop.DBus.Properties.PropertiesChanged signal when the device's current temperature changes.

In terms of AllJoyn Client Library API, the following are available:

edit flag offensive delete publish link more

answered 2015-12-07 23:29:39 -0700

renwei gravatar image

Thank praveenb for the detailed info. I think that I have found an easier way of doing this within the control panel service framework. I didn't realize that the generated class obtained from the UI xml has public static singleton pointers to each property. In this case, in the provided function for Property A's set function, we can actually use the public function Property::SendValueChangedSignal to notify the controllers of the value change of Property B.

edit flag offensive delete publish link more


I now realize my answer was generic and not specific to ControlPanel. I went back and looked at ControlPanel interface document ( https://allseenalliance.org/framework/documentation/learn/base-services/controlpanel/interface ) and it talks about ValueChanged signal. You are in the right direction.

praveenb ( 2015-12-08 14:41:20 -0700 )edit

Question Tools

1 follower


Asked: 2015-12-06 18:00:13 -0700

Seen: 393 times

Last updated: Dec 07 '15