11.0. Firmware APIs ....................... 40 11.1. Get firmware version ......................40 12.0. Thermal Printer APIs ..................... 41 12.1. Open the printer port ......................41 12.2. Close the printer port ......................42 Page 2 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Page 3
19.0. Power Management APIs ..................87 19.1. Set system sleep timeout ..................... 87 19.2. Get system sleep time ......................87 19.3. Enable or disable system auto sleep ................... 88 Page 3 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
This state-of-art product offers faster processing speed, large memory and portability. This Reference Manual describes the API (Application Programming Interface) calls developed specifically for the ACR890 terminal. Application software developers can make use of these APIs to develop their smart-card related applications.
Real-time Clock (RTC) with independent backup battery 4 LED Status Indicators Built-in Speaker • Compliant with the following standards: ISO 7816 ISO 14443 ISO 7811 USB Full Speed RoHS 2 Page 6 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
3.0. File and Directory Structure File Name Functional System Description acs_api.h Host API header acs_errno.h Host API returned error number defines libacs_api.so Target API shared library Page 7 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
To get the serial number of the connected PICC: UINT8 GET_UID[5]={FFh, CAh, 00h, 00h, 00h} Example 2: To get the ATS of the connected ISO 14443 A PICC UINT8 GET_ATS[5]={FFh, CAh, 01h, 00h, 00h}; Page 8 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Response Data Out Result Load Authentication Keys Response Codes Results SW1 SW2 Meaning Success 90 00h The operation is completed successfully. Error 63 00h The operation has failed. Page 10 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Response Data Out Result Value Block Operation Response Codes Results SW1 SW2 Meaning Success 90 00h The operation is completed successfully. Error 63 00h The operation has failed. Page 15 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Example 2: Decimal 1 = {00h, 00h, 00h, 01h} Value Read Value Block Response Codes Results SW1 SW2 Meaning Success 90 00h The operation is completed successfully. Error 63 00h The operation has failed. Page 16 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameters None. Return Values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 18 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The mode value to Input; Return Values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 19 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
= backlight_get(&state); //call api to get backlight state if(0 == ret) {//show out the backlight state you get just now. printf("brightness=%d.max_brightness=%d,fb_power=%d,actual_brightn ess=%d", state.brightness,state.max_brightness,state.fb_power,state.actual_bri ghtness); return ret; Page 22 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Library Use libacs_api.so Example Code int main(void) int ret; enum bl_level level = BACKLIGHT_LEVEL_4; ret = backlight_set(level); //call api to set the level of backlight brightness. return ret; Page 23 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The state of the specified LED Return value If successful, the return value is 0. If failed, the return value is -1 or -2. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 25 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
//call API to set blue led blink on for 100ms and blink off for 900ms periodically. ret = led_set_state(led, stat); if(0 != ret) printf( " Set led blink state failed !, ret = %d\n", ret); return ret; Page 26 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return Value If successful, the return value is EGPRS_SUCCEEDED. If failed, the return value is ENODEV or EGPRS_POWER_ON_FAILED. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 27 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameters None. Return Value If successful, the return value is EGPRS_SUCCEEDED. If failed, the return value is ENODEV or EGPRS_POWER_OFF_FAILED. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 28 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The proper netmask if needed Return Value If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 29 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The APN of mobile network operator support. Return Value If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 30 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
9.5. Start up pppd process This function starts the pppd dial process. void ppp_on(void). Parameters None. Return Value None. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 31 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The length of RecvBuffer Return Value If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 34 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
IMEI_SN Failed, ret = %d\n”,ret); gprs_power_off(); return -1; printf(“IMEI Serial Number = %s\n”, IMEI_Buf); ret = gprs_power_off(); if(ret != EGPRS_SUCCEEDED) printf(“gprs power off Failed!\n”); return -1; return 0; Page 35 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
{//print the volume state you get just now. printf("max volume is %ld\nmin volume is %ld\n, left volume is %ld\nright volume is %ld\n", stat.max_vol, state.min_vol, stat.left_vol, stat.right_vol); return ret; Page 36 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
18). Return value If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 37 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Example Code int main(void) int ret; ret = sound_play ("./Niose.wav");//call api to play a specified audio file return ret; Page 38 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Example Code int main(void) int ret; ret = speaker_onoff(1);//call api to sound on speaker. return ret; Page 39 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameters None. Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_OPEN_ERR. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 41 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_CLOSE_ERR. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 42 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_RESET_ERR. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 43 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The paper space to be fed (ranges from 0 to 255, space is equal to nr_len * 0.125, in Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_FPAPER_ERR. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 44 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Paper space to be fed, range from 0 to 255, space is equal to nr_len * 0.125 (in mm) Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_SETLINE_SPACE. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 45 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Null terminated string of characters to be printed Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_STRPRINT_SM. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 46 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
[in] data Pointer to the array of characters to be printed [in] size Size of the array of characters to be printed (range from 1 to 490 bytes) Page 47 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Page 48
Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_STRPRINT_PM. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 48 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Size of the array of characters to be printed in bytes Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_DATAPRINT_PM. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 49 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Size of the array of characters to be printed (range from 1 to 490 in bytes) Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_DATAPRINT_PM. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 50 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
1 and 384 (inclusive). Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_IMAGEPRINT. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 51 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
A path to the font file Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_INITFREE_ERR. Requirements Header Declared in lib_freetype.h. Library Use libacs_printer.so. Page 54 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The character height, in integer pixels. Valid range is 11-16. Return Values If successful, the return value is SUCCESS. If failed the return value is ETHP_SETSIZE_ERR. Requirements Header Declared in lib_freetype.h. Library Use libacs_printer.so. Page 55 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Size of the array of characters to be printed in bytes. Return Values If successful, the return value is SUCCESS. If failed, the return value is ETHP_IMAGEPRINT. Requirements Header Declared in lib_freetype.h. Library Use libacs_printer.so. Page 56 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
This function releases the freetype library. This function is designed to print non-English fonts. Note: Supported in firmware v1.1.5 and later only. void freetype_release(void) Parameters None. Return Values None. Requirements Header Declared in lib_freetype.h. Library Use libacs_printer.so. Page 57 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return Values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 58 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return Values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 59 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return values If successful, the return value is 0. If failed, the return value is -ENODEV. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 60 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return values If successful, the return value is 0. If failed, the return value is -ENODEV. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 61 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
If successful, the return value is 0 (card is present). If failed, the return value is ≠ 0 (card is not present). Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 62 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The returned ATR length Return values If successful, the return value is 0. If failed, the return value is ≠ 0. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 63 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The index ID of specified slot (IFD). Return values If successful, the return value is 0. If failed, the return value is ≠ 0. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 64 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
The fi and di value. Return Values If successful, the return value is 0. If failed, the return value is ≠ 0. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 65 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 68 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return Value If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 69 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Note: This function does not apply to FeliCa cards. You can use the FeliCa polling command to get the card info (see Example 2 in Contactless card reader antenna control). Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 70 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
This function does not apply to FeliCa cards. Return Values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h. Library Use libacs_api.so. Page 71 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Parameter None. Return Values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 72 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Note: Maximum size of response buffer is 272 bytes. Hence, the storage size of *resp string container MUST be greater than 272 bytes. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 73 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
*resp string container MUST be greater than 272 bytes (see Example 2 in Contactless card reader antenna control). Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 74 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Track #1 data End Byte Error Bit 1 Track #1 data Parity Error Bit 0 Track #1 data Start Byte Error Table 4: Track Data State Bits Table Page 79 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
*acs_err(const int errno_code) Parameters [in] errno_code The error number to parse Return values A parsed string for an error number. Requirements Header Declared in acs_api.h Library Use libacs_api.so Page 81 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
= get_a_ini_key_value (“lcd”, “brightness”, key_value); //call api to get brightness value if(0 == ret) {//show out the brighness you get from ini file just now. printf("[lcd]\nbrightness=%s\n”, key_value); return ret; Page 82 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Use libacs_api.so Example Code int main(void) int ret; ret = set_a_ini_key_value (“lcd”, “brightness”, 3); //call api to set brightness value to 3 in the ini file. return ret; Page 83 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
If failed, the return value is -1. Requirements Header Declared in acs_api.h Library Use libacs_api.so Example Code int main(void) int ret; ret = add_a_ini_key_value (“lcd”, “brightness”, 3); return ret; Page 84 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
This function sets all hardware according to all keyword value in .ini file (/etc/config.ini). void ini_init_hw_all(void); Parameters None. Return Value None. Requirements Header Declared in acs_api.h Library Use libacs_api.so Example Code int main(void) ini_init_hw_all(); return 0; Page 85 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Declared in acs_api.h Library Use libacs_api.so Example Code int main(void) int ret; ret = record_set_to_hw (“lcd”, “brightness”, 3); //call api to set brightness value to 3 return ret; Page 86 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
19.2. Get system sleep time This function gets the device idle time. Unsigned int pm_sleep_timeout_get(void) Return Values The value of the device’s idle time Requirements Header Declared in acs_api.h. Library Use libacs_api.so. Page 87 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
To resume the device to normal working status, short press the power button. Return Values If successful, the return value is 0. If failed, the return value is -1. Requirements Header Declared in acs_api.h. Library Use libacs_api.so. Page 88 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
*/ … wifi_pwr_off(); /* when wifi power off the device will switch to deep sleep mode, and auto sleep is reenable */ return 0; Page 89 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Page 90
/* disable device auto go to sleep mode, and you can short press power button make device go to sleep mode*/ pm_sleep_enable(0); return 0; Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries. Page 90 of 90 ACR890 – Reference Manual info@acs.com.hk www.acs.com.hk Version 1.03...
Need help?
Do you have a question about the ACR890 and is the answer not in the manual?
Questions and answers