net.posprinter.service

## Class PosprinterService.MyBinder

- java.lang.Object
- - android.os.Binder
  - - net.posprinter.service.PosprinterService.MyBinder

- All Implemented Interfaces:
    android.os.IBinder, IMyBinder
  Enclosing class:
    PosprinterService

      public class PosprinterService.MyBinder
      extends android.os.Binder
      implements IMyBinder

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface android.os.IBinder

      `android.os.IBinder.DeathRecipient`

  - ### Field Summary

    - ### Fields inherited from interface android.os.IBinder

      `DUMP_TRANSACTION, FIRST_CALL_TRANSACTION, FLAG_ONEWAY, INTERFACE_TRANSACTION, LAST_CALL_TRANSACTION, LIKE_TRANSACTION, PING_TRANSACTION, TWEET_TRANSACTION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MyBinder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `Acceptdatafromprinter(TaskCallback callback, int cout)` Read data from printer
    `void` | `CheckLinkedState(TaskCallback callback)` Check linked state
    `void` | `ClearBuffer()` Clear buffer
    `void` | `ConnectBtPort(java.lang.String bluetoothID, TaskCallback callback)` Connect printer by bluetooth
    `void` | `ConnectNetPort(java.lang.String ethernetIP, int ethernetPort, TaskCallback callback)` Connect printer by wifi
    `void` | `ConnectUsbPort(android.content.Context context, java.lang.String usbPathName, TaskCallback callback)` Connect printer by usb
    `void` | `DisconnectCurrentPort(TaskCallback callback)` Disconnect current port
    `void` | `DisconnetNetPort(TaskCallback callback)`
    `java.util.List<java.lang.String>` | `getBtAvailableDevice()`
    `java.util.List<java.lang.String>` | `OnDiscovery(PosPrinterDev.PortType portType, android.content.Context context)` Search available bluetooth or usb printer
    `void` | `PrinterIsNormal(TaskCallback callback)` Get the current status of the printer
    `RoundQueue<byte[]>` | `ReadBuffer()` Read buffer
    `void` | `Write(byte[] data, TaskCallback callback)` Send data to printer
    `void` | `WriteDataByUSB(TaskCallback callback, ProcessData processData, int timeout)` Write data to printer by usb
    `void` | `WriteSendData(TaskCallback callback, ProcessData processData)` Send data to printer

    - ### Methods inherited from class android.os.Binder

      `attachInterface, clearCallingIdentity, clearCallingWorkSource, dump, dump, dumpAsync, flushPendingCommands, getCallingPid, getCallingUid, getCallingUidOrThrow, getCallingUserHandle, getCallingWorkSourceUid, getInterfaceDescriptor, isBinderAlive, joinThreadPool, linkToDeath, onTransact, pingBinder, queryLocalInterface, restoreCallingIdentity, restoreCallingWorkSource, setCallingWorkSourceUid, transact, unlinkToDeath`

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

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

    - ### Methods inherited from interface android.os.IBinder

      `getSuggestedMaxIpcSizeBytes`

- - ### Constructor Detail

    - #### MyBinder

          public MyBinder()

  - ### Method Detail

    - #### ConnectNetPort

          public void ConnectNetPort(java.lang.String ethernetIP,
                                     int ethernetPort,
                                     TaskCallback callback)

      Connect printer by wifi
      Specified by:
        `ConnectNetPort` in interface `IMyBinder`
      Parameters:
        `ethernetIP` - printer's ip address(Same network segment)
        `ethernetPort` - port of net(9100,4000)
        `callback` -

    - #### ConnectBtPort

          public void ConnectBtPort(java.lang.String bluetoothID,
                                    TaskCallback callback)

      Connect printer by bluetooth
      Specified by:
        `ConnectBtPort` in interface `IMyBinder`
      Parameters:
        `bluetoothID` - bluetooth device mac address
        `callback` -

    - #### ConnectUsbPort

          public void ConnectUsbPort(android.content.Context context,
                                     java.lang.String usbPathName,
                                     TaskCallback callback)

      Connect printer by usb
      Specified by:
        `ConnectUsbPort` in interface `IMyBinder`
      Parameters:
        `context` -
        `usbPathName` - usb path name
        `callback` -

    - #### DisconnectCurrentPort

          public void DisconnectCurrentPort(TaskCallback callback)

      Disconnect current port
      Specified by:
        `DisconnectCurrentPort` in interface `IMyBinder`
      Parameters:
        `callback` -

    - #### Write

          public void Write(byte[] data,
                            TaskCallback callback)

      Send data to printer
      Specified by:
        `Write` in interface `IMyBinder`
      Parameters:
        `callback` -
        `data` - data

    - #### WriteSendData

          public void WriteSendData(TaskCallback callback,
                                    ProcessData processData)

      Send data to printer
      Specified by:
        `WriteSendData` in interface `IMyBinder`
      Parameters:
        `callback` -
        `processData` - Data sent

    - #### WriteDataByUSB

          public void WriteDataByUSB(TaskCallback callback,
                                     ProcessData processData,
                                     int timeout)

      Description copied from interface: `IMyBinder`
      Write data to printer by usb
      Specified by:
        `WriteDataByUSB` in interface `IMyBinder`
        `processData` - data
        `timeout` - timeout

    - #### Acceptdatafromprinter

          public void Acceptdatafromprinter(TaskCallback callback,
                                            int cout)

      Read data from printer
      Specified by:
        `Acceptdatafromprinter` in interface `IMyBinder`
      Parameters:
        `callback` -
        `cout` - szie of data

    - #### PrinterIsNormal

          public void PrinterIsNormal(TaskCallback callback)

      Get the current status of the printer
      Specified by:
        `PrinterIsNormal` in interface `IMyBinder`
      Parameters:
        `callback` -

    - #### ReadBuffer

          public RoundQueue<byte[]> ReadBuffer()

      Description copied from interface: `IMyBinder`
      Read buffer
      Specified by:
        `ReadBuffer` in interface `IMyBinder`
      Returns:

    - #### ClearBuffer

          public void ClearBuffer()

      Description copied from interface: `IMyBinder`
      Clear buffer
      Specified by:
        `ClearBuffer` in interface `IMyBinder`

    - #### CheckLinkedState

          public void CheckLinkedState(TaskCallback callback)

      Description copied from interface: `IMyBinder`
      Check linked state
      Specified by:
        `CheckLinkedState` in interface `IMyBinder`

    - #### DisconnetNetPort

          public void DisconnetNetPort(TaskCallback callback)

      Specified by:
        `DisconnetNetPort` in interface `IMyBinder`

    - #### OnDiscovery

          public java.util.List<java.lang.String> OnDiscovery(PosPrinterDev.PortType portType,
                                                              android.content.Context context)

      Search available bluetooth or usb printer
      Specified by:
        `OnDiscovery` in interface `IMyBinder`
      Parameters:
        `portType` -
        `context` -
      Returns:

    - #### getBtAvailableDevice

          public java.util.List<java.lang.String> getBtAvailableDevice()

      Specified by:
        `getBtAvailableDevice` in interface `IMyBinder`