i2c/isa command line tools
Hi all,
I plan to operate the following changes on isaset and i2cset:
1* Add an optional mask to the byte being written. 2* Remove the 5 second delay.
The idea is that these tools should be usable to fix broken configurations or tweak the chips above what drivers do.
In that respect we may need i2cget and isaget someday.
While we're at it I guess we could remove the 5 second delay from the other tools as well (i2cdump, isadump and even i2cdetect). I doubt it really helps. Who reads and understands the command summary anyway? If you didn't take care of what you typed, there's no reason you will care much about what the program says.
Objections?
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
Quoted 3 lines
I was thinking, instead, about an option we could add to all the tools (say -y for "yes") that would skip the warning and the delay. This would make the tools better for use in scripts.
I thought of that at first too, but it isn't trivial. Command line parsing in these tools is tricky and adding such a flag will make things even more complex. This may be worth the pain if someone really enjoys the "interactive" mode, but if not, I guess we don't want to keep it.
So what I propose is to surround the "interactive" code in i2cset and isaset with #ifdef INTERACTIVE/#endif instead of really deleting it. This allows people who want it to enable that "feature". In case we later switch to a more advanced command line parsing, we'll propose a switch instead.
I would also suggest not to print anything on success in non-interactive mode. Seems that it is a common unix practice to keep quiet when everything's fine.
The mask is something different which can be implemented in any case.
Thanks.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/
I was thinking, instead, about an option we could add to all the tools (say -y for "yes") that would skip the warning and the delay. This would make the tools better for use in scripts.
Quoted 19 lines · Jean Delvare
Hi all,
I plan to operate the following changes on isaset and i2cset:
1* Add an optional mask to the byte being written. 2* Remove the 5 second delay.The idea is that these tools should be usable to fix broken configurations or tweak the chips above what drivers do.
In that respect we may need i2cget and isaget someday.
While we're at it I guess we could remove the 5 second delay from the other tools as well (i2cdump, isadump and even i2cdetect). I doubt it really helps. Who reads and understands the command summary anyway? If you didn't take care of what you typed, there's no reason you will care much about what the program says.
Objections?
Quoted 16 lines
Quoted 3 lines
I was thinking, instead, about an option we could add to all the
tools(say -y for "yes")that would skip the warning and the delay. This would make the tools better for use in scripts.I thought of that at first too, but it isn't trivial. Command line parsing in these tools is tricky and adding such a flag will make things even more complex. This may be worth the pain if someone really enjoys the "interactive" mode, but if not, I guess we don't want to keep it.
So what I propose is to surround the "interactive" code in i2cset and isaset with #ifdef INTERACTIVE/#endif instead of really deleting it. This allows people who want it to enable that "feature". In case we later switch to a more advanced command line parsing, we'll propose a switch instead.
Quoted 3 lines
I would also suggest not to print anything on success in non-interactive mode. Seems that it is a common unix practice to keep quiet when everything's fine.
I gave it a try. Only isaset and isadump were changed so far. 1* Wait for user confirmation instead of the arbitrary 5 sec delay. 2* Can be skipped with -y.
Please test and comment. If it's OK I'll continue with the 3 remaining tools.
Thanks.
Signature · 2 lines
Jean "Khali" Delvare http://khali.linux-fr.org/