Skip to content

node ​

Classes ​

ClassDescription
SerialTransportNode.js serial-port transport.
TcpTransportTCP transport for network-attached thermal label printers.
UsbTransportUSB transport over libusb for Node.js.

Interfaces ​

InterfaceDescription
EnumeratedNetworkDevice-
EnumeratedUsbDevice-
SnmpMessageThe SNMPv1 GET request/response envelope. Exposed so tests and stubs can build well-formed agent responses; drivers never need it.
SnmpOptionsOptions shared by snmpGet and snmpBroadcast.
SnmpVarbindOne OID = value pair inside an SNMP PDU.
UsbOpenOptions-

Type Aliases ​

Type AliasDescription
SnmpValueA decoded SNMP value.

Variables ​

VariableDescription
PRINTER_MIBStandard MIB-II / Host-Resources-MIB / Printer-MIB objects a network printer answers. Indexes are .1 (first host device, first input tray) as measured on Brother NC print servers; other vendors may order hrDeviceTable differently, which is why sysDescr is here.

Functions ​

FunctionDescription
decodeSnmpMessageDecode an SNMPv1 GET request or response. Throws RangeError on a truncated or non-SNMP datagram; callers drop those.
encodeSnmpMessageEncode an SNMPv1 message. See SnmpMessage.
enumerateNetworkDevicesFind network printers on the local subnets: one SNMP broadcast of hrDeviceDescr.1, every responder matched against the TCP-capable entries of the given registries, then one unicast for the serial. Responders whose hrDeviceDescr.1 is absent or matches nothing go through identifyNetworkDevice for the sysDescr fallback.
enumerateUsbDevicesEnumerate connected USB devices that match one of the given registries.
identifyNetworkDeviceAsk one host over SNMP what it is and match the answer against the TCP-capable entries of the given registries.
snmpBroadcastSNMPv1 GET of one OID to the directed broadcast address of every non-internal IPv4 interface. Collects answers for windowMs (default 1000) and resolves with one entry per responder address, first answer wins. retries resends of the broadcast are spread evenly over the window (WiFi drops broadcast frames; dedupe makes the resend free).
snmpGetSNMPv1 GET of one or more OIDs from host.