Skip to content

Interface: OpenOptions ​

Options for PrinterDiscovery.openPrinter().

Leave empty to open the first available printer. Provide one or more fields to narrow the match.

Properties ​

PropertyTypeDescription
baudRate?numberSerial baud rate. Default 9600. Ignored for RFCOMM / Bluetooth SPP (the underlying link handles flow control) but required by the serialport and Web Serial APIs.
deviceKey?stringRegistry key of the device descriptor to use. Required by drivers when the transport carries no model signal (serial / RFCOMM) and when a network printer cannot be identified (no SNMP answer, or a model the driver's registry does not list); ignored when the transport enumerates (USB). When given on a network open it wins over identification: the driver uses this descriptor and asks the printer nothing. Each driver matches the key against its own registry — pass 'LW_330' to the labelwriter driver, 'QL_820NWBc' to the Brother driver, etc. Unknown keys behave like any other "no match" — openPrinter throws.
host?stringTCP host (IP or hostname).
pid?numberMatch by USB Product ID.
port?numberTCP port. Default 9100.
serialNumber?stringMatch by USB / mDNS serial number.
serialPath?stringSerial port path. Examples: /dev/rfcomm0 (Linux, Bluetooth SPP), /dev/ttyUSB0 (Linux, USB-serial adapter), COM3 (Windows).
snmpCommunity?stringSNMP community used to identify and read status from a network printer. Default 'public'. Only meaningful with host; drivers pass it through to the SNMP helpers in @thermal-label/transport.
vid?numberMatch by USB Vendor ID.