ExternalUsbChannel

Protocol to implement for providing an external communication channel for a connected reader.

Use of this SDK is subject to the Stripe Terminal Terms: https://stripe.com/terminal/legal

Types

Link copied to clipboard

DataCompletionCallback interface for read operations. onCompletion is invoked when the read operation is complete.

Link copied to clipboard

Available disconnect reasons for externally connected readers.

Link copied to clipboard

ErrorCompletionCallback interface for write operations.

Link copied to clipboard

ExternalUsbChannelListener interface for receiving notifications from the external channel.

Properties

Link copied to clipboard

Listener for receiving notifications/events from the external channel. Listener that will be set by the Terminal SDK when the channel is connected to a reader. Your implementation should not overwrite this reference.

Link copied to clipboard
abstract var packetSize: Int

Packet size read from the reader when connecting

Link copied to clipboard
abstract var pollingIntervalMs: Int

How frequently to poll for reading data, will be filled in by the Terminal SDK.

Link copied to clipboard
abstract val productId: Int

The productId of the connected reader, to be provided by the integration.

Link copied to clipboard
abstract var readWriteTimeoutMs: Int

How long to wait before giving up on a read or write operation - will be filled in by the Terminal SDK.

Link copied to clipboard
abstract val vendorId: Int

The vendorId of the connected reader, to be provided by the integration.

Functions

Link copied to clipboard

Request to disconnect from the reader connected by the external channel.

Link copied to clipboard

Reads data from the external channel. Called once from the SDK to start reading data from the reader. The integration should continuously read data from the Usb channel and forward it to the SDK via the DataCompletionCallback, this should continue until the channel is no longer connected.

Link copied to clipboard

Requests to write data over the external channel. The SDK will track a single write request at a time, so this function should not be called again until the previous write request is complete.