net.posprinter.utils

## Class PosPrinterDev

- java.lang.Object
- - net.posprinter.utils.PosPrinterDev

-     public class PosPrinterDev
      extends java.lang.Object

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `PosPrinterDev.ErrorCode`
    `class` | `PosPrinterDev.PortInfo`
    `static class` | `PosPrinterDev.PortType`
    `class` | `PosPrinterDev.ReturnMessage`
    `class` | `PosPrinterDev.UsbPort`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PosPrinterDev(PosPrinterDev.PortType portType, android.content.Context context)`
    `PosPrinterDev(PosPrinterDev.PortType portType, android.content.Context context, java.lang.String usbPathName)`
    `PosPrinterDev(PosPrinterDev.PortType portType, java.lang.String bluetoothID)`
    `PosPrinterDev(PosPrinterDev.PortType portType, java.lang.String ethernetIP, int ethernetPort)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `PosPrinterDev.ReturnMessage` | `Close()`
    `PosPrinterDev.PortInfo` | `GetPortInfo()`
    `static java.util.List<java.lang.String>` | `GetUsbPathNames(android.content.Context context)` Get printer's usb path in android
    `static java.util.List<java.lang.String>` | `GetUsbProductNames(android.content.Context context)` Get printer's product name by usb
    `RoundQueue<byte[]>` | `getUsbRcData()`
    `PosPrinterDev.ReturnMessage` | `Open()` Open port to connect printer
    `int` | `Read()`
    `PosPrinterDev.ReturnMessage` | `Read(byte[] buffer)`
    `PosPrinterDev.ReturnMessage` | `Read(byte[] buffer, int offset, int count)`
    `PosPrinterDev.ReturnMessage` | `Write(byte[] data)`
    `PosPrinterDev.ReturnMessage` | `Write(byte[] data, boolean isNormal, int timeout)`
    `PosPrinterDev.ReturnMessage` | `Write(byte[] data, int offset, int count)`
    `PosPrinterDev.ReturnMessage` | `Write(int data)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PosPrinterDev

          public PosPrinterDev(PosPrinterDev.PortType portType,
                               android.content.Context context)

    - #### PosPrinterDev

          public PosPrinterDev(PosPrinterDev.PortType portType,
                               android.content.Context context,
                               java.lang.String usbPathName)

    - #### PosPrinterDev

          public PosPrinterDev(PosPrinterDev.PortType portType,
                               java.lang.String bluetoothID)

    - #### PosPrinterDev

          public PosPrinterDev(PosPrinterDev.PortType portType,
                               java.lang.String ethernetIP,
                               int ethernetPort)

  - ### Method Detail

    - #### Open

          public PosPrinterDev.ReturnMessage Open()

      Open port to connect printer
      Returns:

    - #### Write

          public PosPrinterDev.ReturnMessage Write(int data)

    - #### Write

          public PosPrinterDev.ReturnMessage Write(byte[] data)

    - #### Write

          public PosPrinterDev.ReturnMessage Write(byte[] data,
                                                   boolean isNormal,
                                                   int timeout)

    - #### Write

          public PosPrinterDev.ReturnMessage Write(byte[] data,
                                                   int offset,
                                                   int count)

    - #### Read

          public PosPrinterDev.ReturnMessage Read(byte[] buffer)

    - #### Read

          public PosPrinterDev.ReturnMessage Read(byte[] buffer,
                                                  int offset,
                                                  int count)

    - #### Read

          public int Read()

    - #### Close

          public PosPrinterDev.ReturnMessage Close()

    - #### GetUsbPathNames

          public static java.util.List<java.lang.String> GetUsbPathNames(android.content.Context context)

      Get printer's usb path in android
      Parameters:
        `context` -
      Returns:

    - #### GetUsbProductNames

          public static java.util.List<java.lang.String> GetUsbProductNames(android.content.Context context)

      Get printer's product name by usb
      Parameters:
        `context` -
      Returns:

    - #### getUsbRcData

          public RoundQueue<byte[]> getUsbRcData()

    - #### GetPortInfo

          public PosPrinterDev.PortInfo GetPortInfo()