[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TEXTUAL-CONVENTION and UNITS question




>>>>> =?iso-8859-1?Q?=22Epping=2C J=F6rg=22?= writes:

Epping> I'm searching for a correct way to
Epping> describe a voltage value in a mib.

Epping> The object is defined as:

dcVoltage OBJECT-TYPE
SYNTAX INTEGER
UNITS "0.01 Volt DC"				-- 5400 -----> 54.00 Volt DC
...
...

Epping> Now I want to change to SYNTAX from
Epping> INTEGER to an own defined SYNTAX
Epping> (dcVolts):

dcVolts ::= TEXTUAL-CONVENTION
 DISPLAY-HINT "d-2"
 DESCRIPTION "This data type represents a dc voltage.
              5400 represents 54.00 volt dc..."
 SYNTAX INTEGER (0..100000)

Epping> Now my question: Is the UNITS instruction
Epping> still needed in the object definition or
Epping> is it not necessary because of the
Epping> textual-convention?

You probably want this:

Volts ::= TEXTUAL-CONVENTION
    DISPLAY-HINT "d-2"
    DESCRIPTION	 "This data type represents a voltage with two
		  decimal digits precision. For example, the
		  value 5400 represents 54.00 volt."
    SYNTAX Integer32

This TC does not say it is DC nor does it impose a restriction. So it
is much more generic than yours. With this, your dcVoltage object
would look like this:

dcVoltage OBJECT-TYPE
    SYNTAX	Volts
    UNITS	"Volt DC"
    ...

The DISPLAY-HINT controls the rendering of the value while the UNITS
clause provides additional information about the units. In this case,
the TC is much more generic while the usage in the dcVoltage object
and its UNITS clause is more specific. Works nicely together.

/js