CashDrawer API: Difference between revisions

From wizarPOS
No edit summary
No edit summary
Line 1: Line 1:
== Functions ==
== Interface ==
The calling sequence is [[#open|open]]>[[#kick_out|kick_out]]>[[#close|close ]]
The calling sequence is [[#open|open]]>[[#kick_out|kick_out]]>[[#close|close ]]
=== open ===
=== open ===
  int moneybox_open()
  <syntaxhighlight lang="c">int moneybox_open()</syntaxhighlight >
Open the cash drawer device.
Open the cash drawer device.
This operation should be used before other operations.
This operation should be used before other operations.
Line 14: Line 14:
   
   
=== close ===
=== close ===
   int moneybox_close()
   <syntaxhighlight lang="c">int moneybox_close()</syntaxhighlight >
Close the cash drawer device.
Close the cash drawer device.
The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device.
The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device.
Line 28: Line 28:
   
   
=== kick_out ===
=== kick_out ===
   int moneybox_ctrl()
   <syntaxhighlight lang="c">int moneybox_ctrl()</syntaxhighlight >
Kick out the cash drawer.
Kick out the cash drawer.


Line 39: Line 39:
   
   
=== setEnable ===
=== setEnable ===
   int moneybox_setEnable(unsigned int nEnable)
   <syntaxhighlight lang="c">int moneybox_setEnable(unsigned int nEnable)</syntaxhighlight >
Enable or disable hardware
Enable or disable hardware



Revision as of 07:53, 28 April 2018

Interface

The calling sequence is open>kick_out>close

open

int moneybox_open()

Open the cash drawer device. This operation should be used before other operations.

Returns
The result code, >= 0, success; <0 error code.

close

int moneybox_close()

Close the cash drawer device. The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device.

Returns
The result code, >= 0, success; <0 error code.

The result code, >= 0, success; <0 error code.

kick_out

int moneybox_ctrl()

Kick out the cash drawer.

Returns
The result code, >= 0, success; <0 error code.

setEnable

int moneybox_setEnable(unsigned int nEnable)

Enable or disable hardware

Parameters
nEnable unsigned int 1 : enable, 0 : disable.
Returns
The result code, >= 0, success; <0 error code.