On 24/02/17 17:41, Matteo Facchinetti wrote:
Hi,

I'm writing an HAL driver that I want to push when I'll finish but I have a question about RW parameters and the possibility to call a function when user update its value.

In detail, I have a complicated control word with more bits with different meanings and values and a constraint like this:
"if you set a flag, the software should reset others".

I created a parameter for each flags/property that user can control and in my driver I like to call a control function that update the control word each time user update value of the related parameter with setp command.

Is possible to associate a function to the update parameter event?

The easiest is probably just to store the 'old' value and at every poll, check this against the current
value.
If they are different execute the code you want to.

Just need to make sure you initialise the param value properly when the component starts.


Or is there an other way to make that?


Thanks in advance,

Matteo


--
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- You received this message because you are subscribed to the Google Groups "Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to