API description: Difference between revisions

From wizarPOS
 
(43 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Printer API ==
== API Overview==
   There are three layers of printer API, the lower layer is C, the device provid C interface, and the third app to write their own JNI source by calling the C interface.
   This document provides an introduction to the C APIs. C API is the lowest API, it is provided by the POS driver, packags all the API implement in a so file, named "libwizarposDriver.so".
  The middle layer is JNI interface, wizarPOS write JNI source and generate the device so files, so the third app just use the JNIInterface to finish the calling.
   The third-party app should open this so file then call this API in its' C source code according as the corresponding head file. Here get the [ftp://sdkuser:wizsdkar@ftp.wizarpos.com/jnidemo_forC.zip jni demo]
   The upper layer is Java interface, wizarPOS provide Java interface for the third app, the third app only need to import the .aar pakcage to their libs.
=== [[API|Print]] ===  
=== C interface ===
  Introduces the [[API]] of the printer device. The head file name is [[printer_interface.h]]. The POS printer device can print text, picture and [[ESC Commands]].
==== Functions ====
The calling sequence is open>query_status>begin>write>end>close.
===== open =====
  int printer_open()


Open the printer device.This operation should be used before other operations.  
=== [[Contactless API| Contactless Reader]] ===
  Introduces the [[Contactless API| API]] of the contactless reader device. The head file name is [[contactless_card_interface.h]]. The contactless reader supports CPU Card, Mifare Card, E-Wallet Card, and also it can support some card emulation, includes Apply Pay.


'''Parameters'''
=== [[CashDrawer API|Cash Drawer]] ===
  Introduces the [[CashDrawer API|API]] about hwo to interaction with the external cash Drawder device. The head file name is [[moneybox_interface.h]].


'''Returns'''
=== [[FingerPrint API|Fingerprint]] ===
  Introduces the [[FingerPrint API|API]] of the fingerprinter device. The head file name is [[fingerprint_interface.h]].


The result code, >= 0, success; <0 [[Error_code|error code]].
=== [[LED API|LED]] ===
Introduces the [[LED API|API]] of the LED device. The head file name is [[led_service_interface.h]].
===== begin =====
  int printer_begin()
Prepare to print, the app should print data after this funciton.


'''Parameters'''
=== [[MSR API|MSR Reader]] ===
  Introduces the [[MSR API|API]] of the MSR reader device. The head file name is [[msr_interface.h]].


'''Returns'''
=== [[PINPAD API|PINPAD]] ===
  Introduces the [[PINPAD API|API]] of the PINPAD device. The head file name is [[pinpad_interface.h]].


The result code, >= 0, success; <0 [[Error_code|error code]].
=== [[Secondary display API|Second Display]] ===
Introduces the [[Secondary display API|API]] about hwo to interaction with the external secondary display device. The head file name is [[customer_display_interface.h]].


===== end =====
=== [[Serial port API|Serial Port]] ===
  int printer_end()
Introduces the [[Serial port API|API]] of the serial port device.The head file name is [[serial_port_interface.h]].
End to print,the begin and end apis are pair operations.


'''Parameters'''
=== [[Smart Card API|Smart Card reader]] ===
 
   Introduces the [[Smart Card API|API]] of the smart card reader device. The smart card reader supports IC card, PSAM card.The head file name is [[smart_card_interface.h]].
'''Returns'''
 
The result code, >= 0, success; <0 [[Error_code|error code]].
 
===== close =====
  int printer_close()
Close the device.The open and close apis are pair operations. If you don’t want to use the device, you should call close to release the device.
 
'''Parameters'''
 
'''Returns'''
 
The result code, >= 0, success; <0 [[Error_code|error code]].
 
===== query_status =====
   int printer_query_status()
Query the status of the printer.This api should be used inner open and close, but not inner begin and end.
 
 
'''Parameters'''
 
'''Returns'''
 
The result code, == 1, has paper; == 0, success; <0 [[Error_code|error code]].
 
===== write =====
  int printer_write(unsigned char* pData, int nDataLength)
Write data to the device. The data can be String, Bitmap data or [[ESC command]].
 
 
'''Parameters'''
{|
|-
| ''pData'' || data or ESC command
|-
| ''nDataLength''|| Length of data
|}
'''Returns'''
 
The result code, >= 0, success; <0 [[Error_code|error code]].
===== read =====
===== query_voltage =====
 
=== JNI interface ===
==== Functions ====
===== open =====
==== Sample ====
 
=== Java interface ===
==== Functions ====
===== open =====
==== Sample ====

Latest revision as of 03:01, 19 November 2018

API Overview

 This document provides an introduction to the C APIs. C API is the lowest API, it is provided by the POS driver, packags all the API implement in a so file, named "libwizarposDriver.so".
 The third-party app should open this so file then call this API in its' C source code according as the corresponding head file. Here get the jni demo

Print

 Introduces the API of the printer device. The head file name is printer_interface.h. The POS printer device can print text, picture and ESC Commands.

Contactless Reader

 Introduces the  API of the contactless reader device. The head file name is contactless_card_interface.h. The contactless reader supports CPU Card, Mifare Card, E-Wallet Card, and also it can support some card emulation, includes Apply Pay.

Cash Drawer

 Introduces the API about hwo to interaction with the external cash Drawder device. The head file name is moneybox_interface.h.

Fingerprint

 Introduces the API of the fingerprinter device. The head file name is fingerprint_interface.h.

LED

Introduces the API of the LED device. The head file name is led_service_interface.h.

MSR Reader

 Introduces the API of the MSR reader device. The head file name is msr_interface.h.

PINPAD

 Introduces the API of the PINPAD device. The head file name is pinpad_interface.h.

Second Display

Introduces the API about hwo to interaction with the external secondary display device. The head file name is customer_display_interface.h.

Serial Port

Introduces the API of the serial port device.The head file name is serial_port_interface.h.

Smart Card reader

 Introduces the API of the smart card reader device. The smart card reader supports IC card, PSAM card.The head file name is smart_card_interface.h.