Contactless API

From wizarPOS
Revision as of 08:45, 12 April 2018 by Mahong (talk | contribs)

Functions

open

 void* contactless_card_open(CONTACTLESS_CARD_NOTIFIER fNotifier, void* pUserData, int* pErrorCode)

Initialize the contactless card reader.

Parameters

fNotifier Notifier of contactless card
pUserData User data
pErrorCode error code if return value is equals to 0

Returns

The result code, != 0, success, value is the handle of contactless card device; <0 failed.

search_target_begin

 int contactless_card_search_target_begin(int nHandle, int nCardMode, int nFlagSearchAll, int nTimeout_MS)

Start searching the contactless card. If you set the nCardMode is auto, reader will try to activate card in type A, type B and type successively; If you set the nCardMode is type A, type B, or type C, reader only try to activate card in the specified way. Possible value of nCardMode :

  • define CONTACTLESS_CARD_MODE_AUTO 0
  • define CONTACTLESS_CARD_MODE_TYPE_A 1
  • define CONTACTLESS_CARD_MODE_TYPE_B 2
  • define CONTACTLESS_CARD_MODE_TYPE_C 3

You can terminate it using function search_target_end.


Parameters

nHandle Handle of this device, returned from open
nCardMode Mode to search
nFlagSearchAll Not used
nTimeout_MS Time out in millseconds. If it is less than 0, then wait forever.

Returns

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


search_target_end

 int contactless_card_search_target_end(int nHandle)

Stop the process of searching card.

The search_target_begin and search_target_end apis are pair operations.

Parameters

nHandle Handle of this device, returned from open

Returns

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

close

 int contactless_card_close(int nHandle)

Close the contactless card reader. Open and close are pair operations. If you don’t want to use the device, you should call close to release the device.

Parameters

nHandle Handle of this device, returned from open

Returns

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

query_info

attach_target

detach_target

transmit

verify

read

write

write_value

read_value

increment

decrement

restore

transfer