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
DataCompletionCallback interface for read operations. onCompletion is invoked when the read operation is complete.
Available disconnect reasons for externally connected readers.
ErrorCompletionCallback interface for write operations.
ExternalUsbChannelListener interface for receiving notifications from the external channel.
Properties
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.
Packet size read from the reader when connecting
How frequently to poll for reading data, will be filled in by the Terminal SDK.
How long to wait before giving up on a read or write operation - will be filled in by the Terminal SDK.
The serial number of the connected reader, to be provided by the integration.
Functions
Request to disconnect from the reader connected by the external channel.
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.
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.