On Mon, Jul 18, 2011 at 4:28 AM, Giuseppe Modugno
<[email protected]>wrote:
> **
> On 15 Jul 2011 at 8:26, Fulko Hew wrote:
> > On Fri, Jul 15, 2011 at 3:10 AM, Giuseppe Modugno
> > <[email protected]> wrote:
> > > In this case, when the amplifier is muted, there's no idea
> > > about the last gain level to restore when the switch is open
> > > again turning the encoder right.
> >
> > Doesn't this imply that the variable(s) are/should-be 'read-only' for
> > this current hw?
>
> The rotary encoder was just an example of the behaviour of the hardware
> I'm using. There isn't really any encoder, push-buttons or similar. I have
> only a software API (I can't touch) with some functions to control the
> status and settings of the box. I'd like to convert these functions to
> SNMP.
>
> Two of these functions are:
>
> int volume_set(int volume);
> int volume_get(void);
>
> where volume could be -1 to mute the amplifier or a number between 0
> and 1000 at 5 steps. If a bad value is passed to the function (for example,
> -2 or 33), the function does nothing and returns with an error.
>
... snip ...
But this means I have to save this data in a non-volatile way, because the
> amplifier could be switched off in any moment without any advice.
>
It depends. What do you get when your turn it back on after leaving it set
in the
various permutations? Whatever that is,I would document that in both DEFVAL
and in DESCRIPTION clauses (as appropriate) with whatever 'really happens'.
> What do you think? Are my thoughts correct?
>
It now all really depends on what your API provides, and what you may be
able to synthesize.
The more we find out about what you are dealing with the more the design
changes.
Now that we find out that your basic control is this API with a single
function,
and it is a 'volume' control with an off switch, no independence, no
persistence,
then you are better with the single SNMP variable, with a range of -1..1000
(But I would add some code to your agent so that you can leave the
definition
at 'any value' between 0 and 1000, but then quantize the value (as
required)
by that particular amplifier (only multiples of 5 can be given to the
API).)
As for what gets read/returned after a power re-start, or after setting the
volume
to mute... find out what the amplifier/API really does, and document it.
It doesn't matter what you do as long as you document it in your MIB.
All I would suggest is that you make it as simple, intuitive and flexible as
you
can to future-proof yourself. From my experience, people are willing to
change
software, but they are unwilling to change the MIB.
------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric
Ries, the creator of the Lean Startup Methodology on "Lean Startup
Secrets Revealed." This video shows you how to validate your ideas,
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders