Click or drag to resize

SnmpPrinter Class

An instance of an SNMP only Zebra printer.
Inheritance Hierarchy
SystemObject
  Zebra.Sdk.PrinterSnmpPrinter

Namespace:  Zebra.Sdk.Printer
Assembly:  SdkApi.Core (in SdkApi.Core.dll) Version: 2.15.2634
Syntax
public class SnmpPrinter

The SnmpPrinter type exposes the following members.

Constructors
  NameDescription
Public methodSnmpPrinter(String)
Creates an instance of a Zebra printer which is limited to only SNMP operations.
Public methodSnmpPrinter(String, String, String)
Creates an instance of a Zebra printer, with the given community names, which is limited to only SNMP operations.
Top
Properties
  NameDescription
Public propertyCommunityNameGet
Gets the SNMP get community name.
Public propertyCommunityNameSet
Gets the SNMP set community name.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetOidValue
Gets the value of the specified oid.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodSetOidValue(String, Int32)
Sets the value of the specified oid to valueToSet.
Public methodSetOidValue(String, String)
Sets the value of the specified oid to valueToSet.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
The printer does not make a raw port connection.
Examples
using System;
using Zebra.Sdk.Printer;

public class SnmpPrinterExample {

    public static void Main(string[] args) {
        SnmpPrinter myPrinter = new SnmpPrinter("1.2.3.4", "getCommunityName", "setCommunityName");
        try {
            string printAdjOid = "1.3.6.1.4.1.10642.6.4.0";
            string printAdjFromSnmp = myPrinter.GetOidValue(printAdjOid);
            Console.WriteLine($"printAdj = {printAdjFromSnmp}");

            int newprintAdj = int.Parse(printAdjFromSnmp) + 1;
            myPrinter.SetOidValue(printAdjOid, newprintAdj);

            string friendlyNameOid = "1.3.6.1.4.1.10642.20.3.5.0";
            string friendlyNameFromSnmp = myPrinter.GetOidValue(friendlyNameOid);
            Console.WriteLine($"friendlyName = {friendlyNameFromSnmp}");

            string newfriendlyName = "AwesomePrinter";
            myPrinter.SetOidValue(friendlyNameOid, newfriendlyName);
        } catch (SnmpException e) {
            Console.WriteLine(e.ToString());
        }
    }
}
See Also