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();

Types

ChannelType

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

Declaration

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