How to retrieve the attribute range limits within the server

Hi,

In my device server I would need to verify the attribute range limits on my own. This is because the attribute is not directly written but changes its value implicitly. What is the best way to obtain the attribute range limits within the server? The value would need to be up-to-date and this query should not add too much overhead (it will be called very often but the limits will not change too often). Is there any alternative to the AttributeProxy and subscribe to the ATTR_CONF_EVENT?

Thanks!
Zibi
Hi again,

I already found a better way:) the WAttribute.get_min_value and WAttribute.get_max_value. When I call them they always retrieve the up-to-date value. Is it that they consult it in the Database, or when one changes a value in the Database it is notified to the server?

Thanks,
Zibi
Hi Zibi,

When someone modifies the value in the Database, using a Tango tool like Jive for instance, it will actually call set_attribute_config method on the admin device, so the server is notified.
If you reset the min and max values to default values using the right-click menu entry with jive, it will delete the corresponding attribute configuration from the database and restart the affected device, so again, the server will be notified.
So using WAttribute.get_min_value and WAttribute.get_max_value should indeed give you the correct values, unless you are not using the standard tools and you are editing the database directly without restarting the device.

Hoping this helps,
Reynald
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Great! We always use the standard tools here, either Jive, or directly DeviceProxy.set_attribute_config. I will then use this methods since they will not add any overhead.

Now, just to understand things better - so no rush with the reply..

If one executes the DeviceProxy.set_attribute_config, this will actually call the set_attribute_config on the admin device? And this internally will do two things: update the WAttribute range and put the attribute property via the Databaseds? More or less:)

Many thanks!
zreszela
If one executes the DeviceProxy.set_attribute_config, this will actually call the set_attribute_config on the admin device?

Actually, Emmanuel Taurel told me I wrote something wrong.
set_attribute_config is invoked on the device, not on the admin device.
I got confused because I was looking at the logs and I saw the messages related to set_attribute_config were all related to the admin device. But this was actually because all the log messages coming from the C++ library are associated with the source equal to admin device, even though they may be related to a normal device.

zreszela
And this internally will do two things: update the WAttribute range and put the attribute property via the Databaseds? More or less:)

I think this is correct.
Rosenberg's Law: Software is easy to make, except when you want it to do something new.
Corollary: The only software that's worth making is software that does something new.
Thank you very much for your clarification!
 
Register or login to create to post a reply.