public interface CashDrawerDevice extends Device
CashDrawerDevice interface defines the APIs for controlling cash drawer devices in applications.
Implementations providing cash drawer services must supply a concrete class implementing this interface.
To obtain a cash drawer device object from the POSTerminal, use the following code:
CashDrawerDevice cashDrawerDevice =
(CashDrawerDevice) POSTerminal.getInstance().getDevice("com.cloudpos.device.cashdrawer");
The identifier "com.cloudpos.device.cashdrawer" is used to specify the cash drawer device, as defined by the specific implementation.
Applications can control the cash drawer device using this interface and must request the necessary permissions:
<uses-permission android:name="android.permission.CLOUDPOS_MONEYBOX"/>
Device| Modifier and Type | Method and Description |
|---|---|
void |
kickOut()
Triggers the cash drawer to open (kick out).
|
void |
open(int logicalID)
Opens the cash drawer for use.
|
void |
openCashBox()
Open Cash Box.
|
int |
queryStatus()
Queries the status of the cash drawer.
|
cancelRequest, close, getFailCount, getUsageCount, openvoid kickOut()
throws DeviceException
DeviceException - for standard errors as documented in DeviceException.void open(int logicalID) throws DeviceException
logicalID - Logical ID of the cash drawer to open.DeviceException - for standard errors as documented in DeviceException.void openCashBox()
throws DeviceException
DeviceException - for standard errors as documented in DeviceException.int queryStatus()
throws DeviceException
0 for opened, 1 for closed, -1 for unknown.DeviceException - for standard errors as documented in DeviceException.