Logo
Developer SDK
Version 1.9.632.913d652c-152450467.
TerminalChannel Class Reference

Inherits ProxyManager< T extends android.os.IInterface >, AutoCloseable, and ITerminalChannel.

Public Member Functions

boolean isCapable (@NonNull final String capability) throws RemoteException
 
Map getOptions () throws RemoteException
 
boolean isConnected () throws RemoteException
 
void connect (Map params) throws RemoteException
 
ParcelFileDescriptor getStream () throws RemoteException
 
int read (@NonNull byte[] b, int offset, int length) throws RemoteException
 
void write (@NonNull byte[] b, int offset, int length) throws RemoteException
 
void close () throws RemoteException
 

Static Public Member Functions

static TerminalChannel getTerminalChannel (final Context context, final ServiceConnection altServiceConnection, final Map deviceParams)
 
static InputStream getInputStreamFromParceledDescriptor (ParcelFileDescriptor channel)
 
static OutputStream getOutputStreamFromParceledDescriptor (ParcelFileDescriptor channel)
 

Static Public Attributes

static final String OPEN_CHANNEL_CAPABILITY = "OPEN_CHANNEL_CAPABILITY"
 
static final int SO_CONNECT_TIMEOUT = 1000
 

Detailed Description

Provides low-level access to the communication channels between the payment app and this app. This should be used with extreme caution, much of the functionality for the Commerce Platform will NOT be able to function when using this class for communication.

Definition at line 21 of file TerminalChannel.java.

Member Function Documentation

◆ close()

void close ( ) throws RemoteException

Closes the connection to the device, performing any relevant cleanup.

Exceptions
android.os.RemoteExceptionThrows a remote exception with the appropriate information.

Definition at line 191 of file TerminalChannel.java.

◆ connect()

void connect ( Map  params) throws RemoteException

Starts the connection to the device.

Parameters
params
Exceptions
android.os.RemoteExceptionTranslates any IOExceptions or similar exceptions to this RemoteException for debugging purposes.

Definition at line 112 of file TerminalChannel.java.

◆ getOptions()

Map getOptions ( ) throws RemoteException

Returns the current configuration that is used when connecting to the socket.

Definition at line 75 of file TerminalChannel.java.

◆ getStream()

ParcelFileDescriptor getStream ( ) throws RemoteException

Connects to a bi-directional channel to allow more control over the flow of data. This should not be used with the read/write methods.

Returns
The ParcelFileDescriptor that can then be converted into input/output streams as needed.

Definition at line 131 of file TerminalChannel.java.

◆ getTerminalChannel()

static TerminalChannel getTerminalChannel ( final Context  context,
final ServiceConnection  altServiceConnection,
final Map  deviceParams 
)
static

Creates a representation of the proxy to communicate with the Transaction Service. Starts the service binding and initialization process in the background. If called from a background thread, blocks until the service binding and initialization is complete. If called from the main thread, operations should not be performed immediately, instead giving the service time to bind in the background. Attach a ServiceConnection object to receive the proper notifications when the service is bound or if it disconnects unexpectedly. This automatically attempts to recover in the cases where the service disconnects unexpectedly, or if other errors occur that drop the connection, so do not attempt to handle those error cases other than delaying messages until the service is reconnected.

Definition at line 42 of file TerminalChannel.java.

◆ isConnected()

boolean isConnected ( ) throws RemoteException

Tells whether or not the connection to the payment app is connected and ready.

Definition at line 92 of file TerminalChannel.java.

◆ read()

int read ( @NonNull byte []  b,
int  offset,
int  length 
) throws RemoteException

Reads some number of bytes from the input stream and stores them into the buffer array b.

Parameters
bbyte: the buffer into which the data is read.
Returns
int The total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.
Exceptions
android.os.RemoteExceptionTranslates any IOExceptions or similar exceptions to this RemoteException for debugging purposes.

Definition at line 152 of file TerminalChannel.java.

◆ write()

void write ( @NonNull byte []  b,
int  offset,
int  length 
) throws RemoteException
Parameters
bbyte: the data.
offsetint: the start offset in the data.
lengthint: the number of bytes to write.
Exceptions
android.os.RemoteExceptionTranslates any IOExceptions or similar exceptions to this RemoteException for debugging purposes.

Definition at line 174 of file TerminalChannel.java.

Member Data Documentation

◆ OPEN_CHANNEL_CAPABILITY

final String OPEN_CHANNEL_CAPABILITY = "OPEN_CHANNEL_CAPABILITY"
static

Use this capability query to determine if a channel can be opened at all.

Definition at line 23 of file TerminalChannel.java.

◆ SO_CONNECT_TIMEOUT

final int SO_CONNECT_TIMEOUT = 1000
static

The key to use when configuring the timeout duration when connecting.

Definition at line 25 of file TerminalChannel.java.


The documentation for this class was generated from the following file:

This document is the confidential property of Verifone, Inc. Any reproduction or distribution of this document, in whole or in part, or the disclosure of any of the information contained herein, without the prior written consent of Verifone, Inc. is prohibited. This document and any supplemental material supplied as part of any review must be returned to Verifone, Inc. upon request. Notice: This document may go through material revisions over time. While the Company will make every effort to keep readers updated as changes occur, care must be taken by the reader to make sure they are reading the latest version. Version numbers appear in the title page and revision history page of this document. All rights reserved. Verifone, the Verifone logo are either trademarks or registered trademarks of Verifone in the United States and/or other countries. All other trademarks or brand names are properties of their respective holders.