Skip to content

Channel

Channel information to your printer.

Overview

You use this object to specify your printer. To send data to your printer, you initialize this class and pass it to PrinterDriverGenerator. If you change your channel, you initialize this class again.

Class methods

newWifiChannel

Create this class with an IP address of your printer to connect through a network.

Declaration

public static Channel newWifiChannel(final String ipAddress);

Parameters

Name Type Description
ipAddress String IP Address of your printer

newBluetoothChannel

Create this class with a MAC address of your printer to connect through a bluetooth.

Declaration

public static Channel newBluetoothChannel(final String macAddress, final BluetoothAdapter bluetoothAdapter);
Name Type Description
macAddress String A bluetooth MAC address of your printer
bluetoothAdapter BluetoothAdapter BluetoothAdapter of your application

newBluetoothLowEnergyChannel

Create this class with a local name of your printer to connect through a bluetooth low energy.

Declaration

public static Channel newBluetoothLowEnergyChannel(final String localName, final Context context, final BluetoothAdapter bluetoothAdapter);

Parameters

Name Type Description
localName String A local name for bluetooth low energy of your printer
context Context Context of your application
bluetoothAdapter BluetoothAdapter BluetoothAdapter of your application

newUsbChannel

Create this class to connect through a USB connection.

Declaration

public static Channel newUsbChannel(final UsbManager usbManager);

Parameters

Name Type Description
usbManager UsbManager UsbManager of your application

Properties

channelType

A channel type which is set in initializing you called.

Declaration

public ChannelType getChannelType();

channelInfo

Channel information such as an IP Address and filepath you passed in initializing.

Declaration

public String getChannelInfo();

extraInfo

Printer information such as model name and serial number. This only has a value when the BRLMChannel is generated by PrinterSearcher. You can get following value using ExtraInfoKey.

Value ExtraInfoKey Description
Model name ModelName The printer's model name (e.g. QL-1110NWB)
Serial number SerialNumber The printer's serial number
MAC address MACAddress The printer's MAC address. nil is stored for Bluetooth/Bluetooth Low Energy connected devices.
Node name NodeName The printer's node name. nil is stored for Bluetooth/Bluetooth Low Energy connected devices.
Location Location The printer's location string. nil is stored for Bluetooth/Bluetooth Low Energy connected devices.

Types

ChannelType

Enum type to specify a channel type you use to connect with printers.

Declaration

public enum ChannelType {
    USB,
    Wifi,
    Bluetooth,
    BluetoothLowEnergy,
}

ExtraInfoKey

Enum type to get a value from extraInfo.

Declaration

public enum ExtraInfoKey{
    ModelName,
    SerialNubmer,
    MACAddress,
    NodeName,
    Location,
}