SdkApi.Desktop
Gets the expected bare word arguments.
Max length of optionTitle is 12 characters.
Max length of optionTitle is 12 characters.
Max length of optionTitle is 12 characters.
Hide the option so it does not appear on the help menu.
Option object.
Option object.
True if the Option is hidden from the help menu.
Argument name if there is one.
Whether command has arg.
Long option.
Short option.
Description.
Establishes a Bluetooth® connection to a printer. (Windows 10 only)
In order to connect to a device with Bluetooth®, the device must be discoverable, authentication must be enabled,
and the authentication pin must be set (1-16 alphanumeric characters).
The encryption type and whether or not it is used is determined by the device initiating the connection and not
the device being connected to.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
Printer connection error or unsupported operating system.
For internal use of the Zebra Printer API only.
Constructs a new Bluetooth® connection with the given macAddress.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the default timeouts for . The default timeout is a maximum of 10
seconds for any data to be received. If no more data is available after 500 milliseconds the read operation is assumed to be
complete.
To specify timeouts other than the defaults, use:
The device's MAC address.
Unsupported operating system.
Constructs a new Bluetooth® connection with the givenmacAddress and timeout values.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the specified timeouts for . The timeout is a maximum of
maxTimeoutForRead milliseconds for any data to be received. If no more data is available after timeToWaitForMoreData
milliseconds the read operation is assumed to be complete.
The device's MAC address.
The maximum time, in milliseconds, to wait for any data to be received.
The maximum time, in milliseconds, to wait in-between reads after the initial read.
Unsupported operating system.
Exposed this protected constructor for testing. We can pass in a mock Connector rather than the BT specific one.
The MAC address is a hexadecimal string with no separators between the octets (e.g. 0011BBDD55FF).
Unsupported operating system.
Opens a Bluetooth® connection as specified in the constructor.
Closes the Bluetooth® connection.
The friendly name is obtained from the device when this connection is opened. If the friendly name changes on the
device, it will not be refreshed until the connection is closed and reopened.
Bluetooth:[MAC Address]:[Friendly Name].
Gets the MAC address and the friendly name as the description.
[MAC Address]:[Friendly Name]
Gets the MAC address which was passed into the constructor. The MAC address is a hexadecimal string with
separators between the octets (e.g. 00:11:BB:DD:55:FF).
Gets the friendly name of the Bluetooth® connection. The friendly name is obtained from the device when
this connection is opened. If the friendly name changes on the device, it will not be refreshed until the
connection is closed and reopened.
Establishes an insecure Bluetooth® connection to a printer. Insecure Bluetooth® connections do not require
the device and the printer to be paired. (Windows 10 only)
For Zebra Internal Use Only.
Unsupported operating system.
Constructs a new insecure Bluetooth® connection with the given macAddress.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the default timeouts for . The default timeout is a maximum of 5 seconds for
any data to be received. If no more data is available after 500 milliseconds the read operation is assumed to be complete.
To specify timeouts other than the defaults, use:
.
The device's MAC address.
Unsupported operating system.
Constructs a new insecure Bluetooth® connection with the given macAddress and timeout values.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the specified timeouts for . The timeout is a maximum of maxTimeoutForRead
milliseconds for any data to be received. If no more data is available after timeToWaitForMoreData milliseconds the read operation
is assumed to be complete.
The device's MAC address.
The maximum time, in milliseconds, to wait for any data to be received.
The maximum time, in milliseconds, to wait in-between reads after the initial read.
Unsupported operating system.
Establishes a Bluetooth® status only connection to a Link-OS printer. (Windows 10 only)
A must be actively open before this connection can be used.
This connection requires Link-OS firmware 2.5 or higher. This channel will not block the printing channel,
nor can it print. If you wish to print, see .
Note: In order to connect to a device with Bluetooth®, the device must be discoverable, authentication
must be enabled, and the authentication pin must be set (1-16 alphanumeric characters).
The encryption type and whether or not it is used is determined by the device initiating the connection and not the
device being connected to.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
Printer connection error or unsupported soperating system.
For internal use of the Zebra Printer API only.
Constructs a new Bluetooth® connection with the given macAddress.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the default timeouts for . The default timeout is a maximum of 5
seconds for any data to be received. If no more data is available after 500 milliseconds the read operation is
assumed to be complete.
To specify timeouts other than the defaults, use:
The device's MAC address.
Unsupported operating system.
Constructs a new status only Bluetooth® connection with the given macAddress and timeout values.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the specified timeouts for . The timeout is a maximum of
maxTimeoutForRead milliseconds for any data to be received. If no more data is available after timeToWaitForMoreData
milliseconds the read operation is assumed to be complete.
The device's MAC address.
The maximum time, in milliseconds, to wait for any data to be received.
The maximum time, in milliseconds, to wait in-between reads after the initial read.
Unsupported operating system.
Exposed this protected constructor for testing. We can pass in a mock Connector rather than the BT specific one.
The MAC address is a hexadecimal string with no separators between the octets (e.g. 0011BBDD55FF).
Unsupported operating system.
Opens a status only Bluetooth® connection as specified in the constructor.
If the device does not support status connections (that is, if it is not a Link-OS 2.5 or higher device) calling
open will throw a ConnectionException.
Closes the Bluetooth® connection.
Returns Bluetooth_STATUS:[MAC Address]:[Friendly Name].
The friendly name is obtained from the device when this connection is opened. If the friendly name changes on the
device, it will not be refreshed until the connection is closed and reopened.
Bluetooth_STATUS:[MAC Address]:[Friendly Name].
Return the MAC address and friendly name of the status port as the description.
[MAC Address]:[Friendly Name]
Returns the MAC address which was passed into the constructor.
The MAC address is a hexadecimal string with separators between the octets (e.g. 00:11:BB:DD:55:FF).
Returns the friendly name of the Bluetooth® connection.
The friendly name is obtained from the device when this connection is opened. If the friendly name
changes on the device, it will not be refreshed until the connection is closed and reopened.
Establishes a status only insecure Bluetooth® connection to a Link-OS printer. (Windows 10 only)
A must be actively open before this connection can be used.
This connection requires Link-OS firmware 2.5 or higher. This channel will not block the printing channel, nor can it print.
If you wish to print, see . Insecure Bluetooth® connections do not require the device
and the printer to be paired.
For internal use of the Zebra Printer API only.
Unsupported operating system.
Constructs a new status only insecure Bluetooth® connection with the given macAddress.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the default timeouts for . The default timeout is a maximum of 5
seconds for any data to be received. If no more data is available after 500 milliseconds the read operation is
assumed to be complete.
To specify timeouts other than the defaults, use:
Unsupported operating system.
Constructs a new status only insecure Bluetooth® connection with the given macAddress and timeout values.
The MAC address is a hexadecimal string with or without separators between the octets (e.g. 00:11:BB:DD:55:FF or 0011BBDD55FF).
This constructor will use the specified timeouts for . The timeout is a maximum of
maxTimeoutForRead milliseconds for any data to be received. If no more data is available after timeToWaitForMoreData
milliseconds the read operation is assumed to be complete.
The device's MAC address.
The maximum time, in milliseconds, to wait for any data to be received.
The maximum time, in milliseconds, to wait in-between reads after the initial read.
Unsupported operating system.
Builds a Connection from a description string. The description string is used to specify a connection to a specific
device over TCP, USB, or Bluetooth® (Windows 10 only).
The description string may be of the explicit forms:
"TCP:192.168.1.4:6101" -- creates a TCP connection to the device with IP address 192.168.1.4 on port 6101.
"TCP:192.168.1.4" -- creates a TCP connection to the device with IP address 192.168.1.4 on default port 9100.
"TCP:dnsName:6101" -- creates a TCP connection to the device with 'dnsName' on port 6101.
"TCP:dnsName" -- creates a TCP connection to the device with 'dnsName' on default port 9100.
"TCP_MULTI:192.168.1.4" -- creates a Multichannel TCP connection to the device with '192.168.1.4' using the default ports for both the printing channel(9100) and the status channel(9200).
"TCP_MULTI:192.168.1.4:1234" -- creates a Multichannel TCP connection to the device with '192.168.1.4' using the given port for the printing channel(1234) and the default port for the status channel(9200).
"TCP_MULTI:192.168.1.4:1234:5678" -- creates a Multichannel TCP connection to the device with '192.168.1.4' using the given ports for the printing channel(1234) and the status channel(5678).
"TCP_MULTI:dnsName:1234:5678" -- creates a Multichannel TCP connection to the device with 'dnsName' using the given ports for the printing channel(1234) and the status channel(5678).
"TCP_STATUS:192.168.1.4:1234" -- creates a TCP status only connection to the device with IP address 192.168.1.4 on port 1234.
"TCP_STATUS:192.168.1.4" -- creates a TCP status only connection to the device with IP address 192.168.1.4 on the default status port 9200.
"USB:deviceName" -- creates a USB connection (through the ZebraDesigner driver) to the device with printer name 'deviceName'.
"USB_DIRECT:\\?\usb#vid_0a5f&pid_00bd#qln320#..." -- creates a USB connection (direct) to the device using '\\?\usb#vid_0a5f&pid_00bd#qln320#...' as the USB symbolic name.
"BT:11:22:33:44:55:66" -- creates a Bluetooth® connection to the device using '11:22:33:44:55:66' as the MAC address. (Windows 10 only)
"BT_MULTI:11:22:33:44:55:66" -- creates a multichannel Bluetooth® connection to the device using '11:22:33:44:55:66' as the MAC address. (Link-OS 2.5 or higher for the status channel, Windows 10 only)
"BT_STATUS:11:22:33:44:55:66" -- creates a status only Bluetooth® connection to the device using '11:22:33:44:55:66' as the MAC address. (Link-OS 2.5 or higher, Windows 10 only)
Generic text may also be used to attempt to specify a device. For example a description string of "genericText" will
attempt to connect to a device using the following priority:
-
TCP_MULTI
-
TCP
-
TCP_STATUS
-
USB
-
USB_DIRECT
-
BT_MULTI
-
BT
-
BT_STATUS
If you supply the string 'MyString'. This could be interpreted to be either a DNS name, or a USB device name.
ConnectionBuilder will attempt to connect to this string given the above priority order.
If you supply a more specific string, such as '192.168.2.3', ConnectionBuilder will more efficiently interpret this
string as being an IP address and, therefore, only attempt the TCP connections.
Note: Colon (':') characters are not supported in dnsName, friendlyName, uniqueId, deviceName, or genericText fields.
The following is an example of building a connection from a string:
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
Add a connection type to the ConnectionBuilder.
Connection class.
Creates a Connection type based on the contents of descriptionString.
"TCP:192.168.1.2:9100"
The format of the input string is: [prefix:] address [: port_number(s)].
-
Prefix is either TCP_MULTI, TCP, TCP_STATUS, USB (if applicable), USB_DIRECT (if applicable), BT_MULTI (if applicable),
BT (if applicable), or BT_STATUS (if applicable).
-
The format of address depends on the prefix
- USB : address is the printer driver name.
- USB_DIRECT : address is the USB symbolic name.
- TCP : address is either a DNS name or an IPv4 address.
- BT : address is the MAC address. (Windows 10 only)
- port_number(s) is optional, and only applicable for TCP connections.
-
Examples:
- TCP:ZBR3054027:9100
- TCP_MULTI:ZBR3054027:9100:9200
- USB:ZDesigner Qln320
- USB_DIRECT:\\?\usb#vid_0a5f&pid_00bd#qln320#...
- BT:11:22:33:44:55:66
- 10.1.2.3
Connection derived from the contents of descriptionString.If a connection could not be established for the given descriptionString.
Establishes a USB connection to a printer.
This class is only supported on Windows PC platforms.
For internal use of the Zebra Printer API only.
Information required to instantiate a DriverPrinterConnection
Initializes a new instance of the DriverPrinterConnection class.
This constructor will use the default timeouts for .
The default timeout is a maximum of 5 seconds for any data to be received. If no more
data is available after 500 milliseconds the read operation is assumed to be complete.
To specify timeouts other than the defaults, use:
.
The printer name.
Initializes a new instance of the DriverPrinterConnection class.
This constructor will use the specified timeouts for .
The timeout is a maximum of maxTimeoutForRead milliseconds for any data to be received.
If no more data is available after timeToWaitForMoreData milliseconds the read operation
is assumed to be complete.
The printer name.
The maximum milliseconds to wait for the initial data to be received.
The maximum milliseconds to wait for additional data to be received.
Returns the name of the printer.
Returns USB:[PrinterName].
The PrinterName is the parameter which was passed into the constructor.
Return the printer name as the description.
Releases all resources used by the
This does not work at the moment so do not use
This sort of works on desktop but only worked on tablet if the bt devices window was open
so do not use
35 seconds was chosen for a Max Timeout so that if the pairing request is
ignored it will close and deny the pair before we hit the Max Timeout and close.
Establishes a Bluetooth® label and status connection to a printer. (Windows 10 only)
In order to connect to a device with Bluetooth®, the device must be discoverable,
authentication must be enabled, and the authentication pin must be set (1-16 alphanumeric characters).
The encryption type and whether or not it is used is determined by the device initiating the connection and not
the device being connected to.
For internal use of the Zebra Printer API only.
Unsupported operating system.
Initializes a new instance of the MultichannelBluetoothConnection class.
This constructor will use the default timeouts for . The default timeout is a
maximum of 5 seconds for any data to be received. If no more data is available after 500 milliseconds the read
operation is assumed to be complete.
To specify timeouts other than the defaults, use:
or
.
The MAC Address of the Printer.
Unsupported operating system.
Initializes a new instance of the MultichannelBluetoothConnection class.
This constructor will use the specified timeouts for for both channels.
The timeout is a maximum of maxTimeoutForRead milliseconds for any data to be received. If no more
data is available after timeToWaitForMoreData milliseconds the read operation is assumed to be complete.
If you wish to specify different timeouts for each channel, use
}.
The MAC Address of the Printer.
The maximum time, in milliseconds, to wait for any data to be received.
The maximum time, in milliseconds, to wait in-between reads after the initial read.
Unsupported operating system.
Initializes a new instance of the MultichannelBluetoothConnection class.
This constructor will use the specified timeouts for for the channels.
The timeout is a maximum of printingChannelMaxTimeoutForRead/statusChannelMaxTimeoutForRead milliseconds
for any data to be received on the printing/status channels respectively. If no more data is available after
printingChannelTimeToWaitForMoreData/statusChannelTimeToWaitForMoreData milliseconds on the printing/status
channels respectively the read operation is assumed to be complete.
The MAC Address of the Printer.
The maximum time, in milliseconds, to wait for any data to be received on
the printing channel.
The maximum time, in milliseconds, to wait in-between reads after the
initial read on the printing channel.
The maximum time, in milliseconds, to wait for any data to be received on
the status channel.
The maximum time, in milliseconds, to wait in-between reads after the
initial read on the status channel.
Unsupported operating system.
Opens both the printing and status channel of this Multichannel connection.
If neither channel can be opened, then a is thrown. When this Multichannel connection
is no longer needed, you must call to free up system resources.
If the connection cannot be established.
Returns Bluetooth_MULTI:[MAC Address]:[Friendly Name].
The friendly name is obtained from the device when this connection is opened. If the friendly name changes on the
device, it will not be refreshed until the connection is closed and reopened.
Bluetooth_MULTI:[MAC Address]:[Friendly Name].
Return the MAC address as the description.
Unsupported operating system.
Establishes a direct connection to an attached Zebra USB printer without requiring the presence of a USB driver.
The symbolic name of the printer.
Initializes a new instance of the UsbConnection class.
This constructor will attempt a connection to the printer specified in the symbolic name.
The USB symbolic name for the device returned by the UsbDiscoverer.GetZebraUsbPrinters() member function.
If the system is not running the Windows operating system or if the device cannot be found.
Initializes a new instance of the UsbConnection class.
This constructor will attempt a connection to the printer specified in the symbolic name.
The USB symbolic name for the device returned by the UsbDiscoverer.GetZebraUsbPrinters() member function.
Maximum time to wait for read data
Maximum time to wait for more data after intial data is sent from printer
If the system is not running the Windows operating system or if the device cannot be found.
Initializes a new instance of the UsbConnection class.
This constructor will attempt a connection to a printer that meets the connectionInfo criteria
Printer serial number or model number
Printer connection error
Cannot find specified device among attached devices
Reads up to maxBytesToRead into byte array
The maximum number of bytes to read.
Performing reads using DriverPrinterConnection and UsbConnection concurrently could cause indeterminate reads.
Returns number of bytes currently read from printer.
Number of bytes currently read from printer.
If an I/O error occurs.
Gets the printer's serial number.
Returns the Connection Builder name of the USB device.
Returns printer's manufacturer.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
For internal use of the Zebra Printer API only.
A factory used to acquire an instance of a ZebraImageI.
Creates an instance of from the image specified in image.
The image
An image formatted for Zebra Printers
If the file could not be found, open, or is an unsupported graphic.
If image is null
Creates an instance of from the image specified in fullPath.
The full path of the image.
An image formatted for Zebra Printers
If the file could not be found, open, or is an unsupported graphic.
If fullPath is null
Creates an instance of from the image data specified in imageData
A stream containing the image data.
An image formatted for Zebra Printers.
If the file could not be found, open, or is an unsupported graphic.
If imageData is null
A class that discovers Bluetooth® devices.
Find Bluetooth® devices that are discoverable.
This method will return all devices found, not just Zebra printers.
A instance that is used to handle discovery events (e.g. found a printer, errors, discovery finished).
For communication or discovery errors.
Find Bluetooth® devices that are discoverable.
This method will return all devices found, not just Zebra printers.
A instance that is used to handle discovery events (e.g. found a printer, errors, discovery finished).
Time to wait, in milliseconds, before determining that there are no more discovery responses.
For communication or discovery errors.
Find Bluetooth® devices that are discoverable.
This method will return all devices found, not just Zebra printers.
A instance that is used to handle discovery events (e.g. found a printer, errors, discovery finished).
A custom instance used to determine whether or not a discovered device should be ignored.
For communication or discovery errors.
Find Bluetooth® devices that are discoverable.
This method will return all devices found, not just Zebra printers.
A instance that is used to handle discovery events (e.g. found a printer, errors, discovery finished).
A custom instance used to determine whether or not a discovered device should be ignored.
Time to wait, in milliseconds, before determining that there are no more discovery responses.
For communication or discovery errors.
Find services (ConnectionChannels) that are supported by the device at macAddress.
MAC address of the device.
A instance that is used to handle service discovery events.
The Bluetooth MAC address is invalid.
DeviceFilter is an interface to allow the user to write custom code to determine whether or not the
BluetoothDiscoverer should include a particular BluetoothDevice in it's result set.
Method called by a BluetoothDiscoverer to determine whether or not a Bluetooth® device should be added to
it's list of discovered devices.
BluetoothDevice to potentially be added to the list of of discovered Bluetooth® devices.
A bool indicating whether or not a particular BluetoothDevice should be added.
Instance of DiscoveredPrinter that is returned when performing a Bluetooth® discovery.
The friendly name of the Bluetooth® device.
Returns an instance of a DiscoveredPrinterBluetooth with macAddress.
MAC address of the printer.
Friendly name of the printer.
Instance of that is returned when performing a Driver Discovery.
Local printer name associated with the driver.
Returns an instance of a with printerName, driverName,
and portNames.
The printer name.
The name of the ZebraDesigner driver.
The port name.
Returns the name of the printer.
The printer name.
Instance of that is returned when performing a search of currently connected Zebra USB printers.
Returns an instance of a built using built using the provided symbolicName.
The symbolic name for the printer returned by
or .
If a connection to the discover USB printer cannot be established.
Returns an instance of a built using the provided symbolicName and
attributes.
The symbolic name for the printer returned by
or .
A map of attributes associated with the discovered USB printer.
If a connection to the discover USB printer cannot be established.
Interface definition for a callback to be invoked for service discovery events.
This method is invoked when a service has been discovered. This method will be invoked for each service that is found.
A discovered channel.
This method is invoked when discovery is finished.
A class used to discover a printer described by a URL. (Windows 10 only)
This method will search using a combination of discovery methods to find the printer described by the specified URL. (Windows 10 only)
This method will invoke the method for each interface that
the specified printer is found. will be invoked when the discovery is
finished and will be invoked when any errors are encountered during
discovery. When is invoked, the discovery will be canceled and
will not be invoked.
This method will typically be used when reading an NFC tag attached to a Zebra printer. To launch your app when a
Zebra NFC tag is read:
- Register to listen for Zebra NFC Tag scans in your application
- Handle the NFC scan in your application
The URL describing the targeted printer (Typically, this information is encoded on an NFC tag attached
to the printer)
Example:
"http://www.zebra.com/apps/r/nfc?mBL=00225832C75F&mW=000000000000&mE=000000000000&c=QN3-AUBA0E01-00&s=XXQLJ112600422&v=0"
A instance that is used to handle discovery events (e.g. found a
printer, errors, discovery finished).
If an error occurs while starting the discovery (errors during discovery will be sent
via ).
A class used to discover USB connected Zebra printers. Printers can be accessed directly or through a Zebra Designer
printer driver if your printer supports the driver.
A class used to discover USB connected Zebra printers. Printers can be accessed either directly or through a USB
printer driver.
Enumerate locally installed Zebra Designer Drivers.
List of ZebraDesigner drivers installed.
If the system is not running the Windows operating system or an error occurs during discovery.
Enumerate all currently connected Zebra USB printers.
List of locally connected Zebra USB printers.
If the system is not running the Windows operating system or an error occurs during discovery.
Enumerate currently connected Zebra USB printers that meet the specified DiscoveredPrinterFilter criteria.
A custom instance used to determine whether or not a discovered device should be ignored.
>List of locally connected Zebra USB printers.
If the system is not running the Windows operating system or an error occurs during discovery.
For Zebra Internal Use Only.
For Zebra Internal Use Only.
DiscoveredPrinterFilter implementation that filters out all unsupported Zebra Printers.
Determines if the discoveredPrinter is a supported Zebra Printer.
The discovered printer.
True if the discoveredPrinter is a supported Zebra Printer.
Handler class used to notify of connection status
Called when a printer establishes a connection.
Printer which just established a connection.
Called when a printer goes offline.
Printer which just went offline.
Removes the Connection handler from the runtime.