public interface SignatureDevice extends Device
The signature device object is obtained from the POSTerminal
, its' as follows:
SignatureDevice signatureDevice = (SignatureDevice) POSTerminal.getInstance().getDevice("com.cloudpos.device.signature");Among them, the "com.cloudpos.device.signature" string is to identify the signature device, defined by the specific implementation.
Uses the signature device object to control the operation of the signature device.
An app can request permission to access the device, as shown below:
<uses-permission android:name="android.permission.CLOUDPOS_SIGNATURE"/>
Device
Modifier and Type | Method and Description |
---|---|
void |
listenSignature(java.lang.String transactionCode,
OperationListener listener,
int timeout)
Listens until write the signature in this terminal.
|
void |
open(int logicID)
Opens the device.
|
SignatureOperationResult |
waitSignature(java.lang.String transactionCode,
int timeout)
This is the synchronous method of the
listenSignature(String,OperationListener,int) . |
cancelRequest, close, getFailCount, getUsageCount, open
void open(int logicID) throws DeviceException
logicID
- logical ID of the device to open.DeviceException
- for the standard reasons that are documented in
DeviceException
.void listenSignature(java.lang.String transactionCode, OperationListener listener, int timeout) throws DeviceException
This is an asynchronous method.
handleResult()
will be invoked when at least one card has been detected in the field.
Because this method uses a timeout parameter, the device receiving this request MUST be able to
successfully respond to cancelRequest()
and abort the operation.
In case of a timeout occurring, the operation result will contain code=
ERR_TIMEOUT
, and no information about
card will be available.
transactionCode
- a transaction code.timeout
- the maximum scanning time of the method, in milliseconds.DeviceException
- for the standard reasons that are documented in
DeviceException
OperationListener.handleResult(com.cloudpos.OperationResult)
SignatureOperationResult waitSignature(java.lang.String transactionCode, int timeout) throws DeviceException
listenSignature(String,OperationListener,int)
.transactionCode
- a transaction code.timeout
- the maximum scanning time of the method, in milliseconds.DeviceException
- for the standard reasons that are documented in
DeviceException