Package com.datecs.fiscalprinter.SDK

# Class TransportProtocolV1

java.lang.Object
com.datecs.fiscalprinter.SDK.AbstractTransportProtocol
com.datecs.fiscalprinter.SDK.TransportProtocolV1

Direct Known Subclasses:
  `FDModelDetectorV1`

    public class TransportProtocolV1
    extends AbstractTransportProtocol

- ## Field Summary

  Fields
  Modifier and Type | Field | Description
  --- | --- | ---
  `static int` | `MAX_DATA_SIZE` |
  `static int` | `MAX_PACKET_SIZE` |

  ### Fields inherited from class com.datecs.fiscalprinter.SDK.AbstractTransportProtocol

  `CP_1250, CP_1251, CP_866`

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `TransportProtocolV1​(FiscalSocket socket)` |
  `TransportProtocolV1​(FiscalSocket socket, int encoding)` |
  `TransportProtocolV1​(java.io.InputStream in, java.io.OutputStream out, int encoding)` | Initializing transport protocol

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `java.lang.String` | `customCommand​(int command, java.lang.String data)` | Execute command with raw data on device
  `byte[]` | `getStatusBytes()` | Get command and device statuses
  `boolean` | `isStatusBitTriggered​(int byteIndex, int bitIndex)` | Check if status bit is triggered in last command execution

  ### Methods inherited from class com.datecs.fiscalprinter.SDK.AbstractTransportProtocol

  `close, setDebugLevel, setEncoding, toAnsi`

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

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

- ## Field Details

  - ### MAX_PACKET_SIZE

    public static final int MAX_PACKET_SIZE
    See Also:
      Constant Field Values

  - ### MAX_DATA_SIZE

    public static final int MAX_DATA_SIZE
    See Also:
      Constant Field Values

- ## Constructor Details

  - ### TransportProtocolV1

    public TransportProtocolV1​(java.io.InputStream in, java.io.OutputStream out, int encoding)
    Initializing transport protocol
    Parameters:
      `in` - InputStream for the protocol
      `out` - OutputStream for the protocol
      `encoding` - Device encoding

  - ### TransportProtocolV1

    public TransportProtocolV1​(FiscalSocket socket, int encoding)
    Parameters:
      `socket` -
      `encoding` -

  - ### TransportProtocolV1

    public TransportProtocolV1​(FiscalSocket socket)
    Parameters:
      `socket` -

- ## Method Details

  - ### customCommand

    public java.lang.String customCommand​(int command, java.lang.String data) throws java.io.IOException
    Description copied from class: `AbstractTransportProtocol`
    Execute command with raw data on device
    Specified by:
      `customCommand` in class `AbstractTransportProtocol`
    Parameters:
      `command` - Command number
      `data` - Command data
    Returns:
    Throws:
      `java.io.IOException`
    See Also:
      `AbstractTransportProtocol.customCommand(int, String)`

  - ### isStatusBitTriggered

    public boolean isStatusBitTriggered​(int byteIndex, int bitIndex)
    Description copied from class: `AbstractTransportProtocol`
    Check if status bit is triggered in last command execution
    Specified by:
      `isStatusBitTriggered` in class `AbstractTransportProtocol`
    Parameters:
      `byteIndex` - Index of status byte
      `bitIndex` - Index of status bit for given byte index
    Returns:
    See Also:
      `AbstractTransportProtocol.isStatusBitTriggered(int, int)`

  - ### getStatusBytes

    public byte[] getStatusBytes()
    Description copied from class: `AbstractTransportProtocol`
    Get command and device statuses
    Specified by:
      `getStatusBytes` in class `AbstractTransportProtocol`
    Returns:
    See Also:
      `AbstractTransportProtocol.getStatusBytes()`