Click or drag to resize

SmiTypeExtensionsDecode Method

Decodes the provided SNMP data into a human-readable string representation based on the specified SMI type.

Namespace: Lextm.SharpSnmpPro.Mib
Assembly: SharpSnmpPro.Mib (in SharpSnmpPro.Mib.dll) Version: 2.1.3+8c6e8963be682b1d7fd7055c260d7b3d449dbc11
Syntax
public static string Decode(
	this ISmiType type,
	ISnmpData data
)

Parameters

type  ISmiType
The SMI type used to interpret and decode the SNMP data. Must implement ISmiType.
data  ISnmpData
The SNMP data to decode. Cannot be .

Return Value

String
A string representation of the decoded SNMP data. If the data matches a named number in the SMI type, the result includes the name and value (e.g., "Name(123)"). Otherwise, the raw string representation of the data is returned.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ISmiType. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown if data is .
InvalidOperationExceptionThrown if the provided type cannot verify the data or if the data type is incompatible.
Remarks
This method uses the SMI type hierarchy to decode the data. If the type is a derived type, the method attempts to retrieve a decoder from the DecoderRegistry. If the type is a basic type, it verifies the data and decodes it accordingly. Named numbers in integer types are resolved to their corresponding names if available.
See Also