ACS AMR220-C1 User manual

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 2 of 69
Revision History
Release Date Revision Description V e rsi o n Number
2018-02-08 ●Initial Release 1.00
2018-03-02
●Updated Section 2.00: Features
●Updated Section 3.1.2 photos
●Added Section 3.1.2.3: Device Reset
Pinhole
1.01
2018-07-19 ●Updated Section 3.1.1.2 Battery Life 1.02

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 3 of 69
Table of Contents
1.0. Introduction ..................................................................................................................5
1.1. Symbols and Abbreviations ...........................................................................................5
2.0. Features ........................................................................................................................7
3.0. Architecture ..................................................................................................................9
3.1. Hardware Design ..........................................................................................................9
3.1.1. Battery .................................................................................................................9
3.1.2. User Interface..................................................................................................... 10
3.2. Software Design ......................................................................................................... 12
3.2.1. USB Interface ..................................................................................................... 12
3.2.2. Bluetooth Interface.............................................................................................. 12
4.0. Host Programming.....................................................................................................13
4.1. PCSC API .................................................................................................................. 13
4.1.1. SCardEstablishCont ext ....................................................................................... 13
4.1.2. SCardListReaders .............................................................................................. 13
4.1.3. SCardConnect .................................................................................................... 13
4.1.4. SCardControl ..................................................................................................... 13
4.1.5. ScardTransmit .................................................................................................... 13
4.1.6. ScardDisconnect ................................................................................................ 13
4.1.7. APDU Flow ........................................................................................................ 14
4.1.8. Escape Comm and Flow ...................................................................................... 15
4.2. Bluetooth Library ........................................................................................................ 16
4.2.1. Setting Up BLE ................................................................................................... 16
4.2.2. Initializing Java Sm art Card I/O API ..................................................................... 17
4.2.3. Finding BLE Card Terminals ................................................................................ 18
4.2.4. Connecting to a Card .......................................................................................... 19
4.2.5. Disconnecting from the Card ............................................................................... 20
4.2.6. Transmitting AP DUs ........................................................................................... 20
4.2.7. Transmitting Control Commands .......................................................................... 20
4.2.8. Disconnecting from BLE Card Terminal ................................................................ 20
5.0. Command Set.............................................................................................................21
5.1. API between Tabl et and AMR220-C1 ........................................................................... 21
5.1.1. BT Communication Frame format ........................................................................ 21
5.1.2. Data Field Format – Command ............................................................................ 22
5.1.3. Data Field Format – Response ............................................................................ 23
5.1.4. BT Commands and Responses ........................................................................... 24
5.2. Cont actless Smart Card Protocol ................................................................................. 35
5.2.1. ATR Generation.................................................................................................. 35
5.2.2. Pseudo APDUs for Contactless Interface ............................................................. 37
5.3. Escape Command ...................................................................................................... 62
5.3.1. Get Firmware Version ......................................................................................... 62
5.3.2. Shut Down Tim e Configure.................................................................................. 63
5.3.3. Antenna Control.................................................................................................. 63
5.3.4. Automatic PICC Polling Parameter ...................................................................... 64
5.3.5. PICC Polling Detect Card Type............................................................................ 66
5.3.6. Buzzer Control .................................................................................................... 67
5.3.7. LEDs Control ...................................................................................................... 68
List of Figures
Figure 1 : Hardware Architecture................................................................................................... 9
Figure 2 : Software Architecture – USB Interface.......................................................................... 12

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 4 of 69
Figure 3 : Software Architecture – Bluetooth Interface .................................................................. 12
Figure 4 : APDU Flow................................................................................................................. 14
Figure 5 : Escape Command Flow .............................................................................................. 15
List of Tables
Table 1 : Symbols and Abbreviations ............................................................................................. 6
Table 2 : Estimated Battery Lifespan ............................................................................................. 9
Table 3 : BT Comm ands From Smart Device to AMR220-C1 ........................................................ 24
Table 4 : BT Responses From AMR220-C1 to Smart Device ......................................................... 30

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 5 of 69
1.0. Introduction
AMR220-C1 Secure Bluetooth® mPOS Reader comm unicates with smart devices via Bluetooth®
technology. With its compliance to ISO 7816 and ISO 14443, it supports both contact and c ontactless
smart cards. Moreover, it further extends card support and strengthens the m obile reader product
line’s salability in t he payment industry, with the additional compliance to EMV® Levels 1 & 2,
Mastercard® Contactless (formerly MasterCard PayPass), and Visa® Contactless.
Target customers include micro merchants, mobile merchants (exampl e: catering, food trucks,
express delivery companies), and retail merchants.
1.1. Symbols and Abbreviations
Abbreviation Description
AC Application Cryptogram
AID Application Identifier
AIP Application Interchange Profile
AOSA Available Offline Spending Amount
APDU Application Protocol Data Unit
ATC Application Transaction Counter
BT Bluetooth
BLE Bluetooth Low Energy
CA Certification Authority
CED Customer Exclusive Data
CID Cryptogram Information Data
CVM Cardholder Verification Method
CVR Card Verification Results
DD Discretionary Data
DF Dedicated File
FFI Form Factor Indicator
FW Firmware
IAD Issuer Application Data
IFD Interface Device
JCB Japan Credit Bureau
PAN Primary Account Number

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 6 of 69
Abbreviation Description
PBOC People’s Bank of China specifications
PCD Proximity Coupling Device
PIN Personal Identification Number
POS Point of Sale
PSN Application PAN Sequence Number
RID Registered Application Provider Identifier
QPBOC Quick PBOC (The Chinese counterpart of contact-less EMV)
TAC Terminal Action Code
TTQ Terminal Transaction Qualifiers
TVR Terminal Verification Results
Table 1: Symbols and Abbreviations

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 7 of 69
2.0.Features
•USB Full Speed Interface
•Bluetooth®Interface
•Plug and Play – CCID support brings utmost mobility
•Smart Card Reader:
oContactless Interface:
Read/Write speed of up to 848 Kbps
Built-in antenna for contactless tag access, with reading distance of up to 60 mm
(depending on tag type)
Supports ISO 14443 Part 4 Type A and B cards, MIFARE®, FeliCa, and all 4 types of
NFC (ISO/IEC 18092) tags
Supports Mastercard®Contactless and Visa payWave®compliant cards
Built-in anti-collision feature (only one tag is accessed at any time)
NFC Mode Supported:
Card reader/writer mode
oContact Interface:
Read/Write speed of up to 600 Kbps
Supports ISO 7816 Class A, B, and C (5 V, 3 V, 1.8 V) full-sized cards
Supports microprocessor cards with T=0 or T=1 protocol
Supports PPS (Protocol and Parameters Selection)
Features Short Circuit Protection
●Application Programming Interface:
oSupports PC/SC
oSupports CT-API (through wrapper on top of PC/SC)
●Built-in Peripherals:
oLEDs:
Four User-controllable single-color LED (Green)
One Charging Status LED (Red)
One Bluetooth Status LED (Blue)
oButtons:
Power Switch
Bluetooth Switch
oUser-controllable speaker (audio tone indication)
●Supports several cryptographic algorithms (Upon Request) such as AES, DES, and 3DES
●USB Firmware Upgradeability1
●Supports Android™ 4.4 and later2
●Supports iOS 8.0 and later3
●Compliant with the following standards:
oEN 60950/IEC 60950
1Applicable under PC-linked mode
2Uses an ACS-defined Android Library
3Uses an ACS-defined iOS Library

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 8 of 69
oISO 7816
oISO 14443
oISO 18092
oEMV®Levels 1 and 2
oMastercard® Contactless
oVisa payWave®
oBluetooth®
oPC/SC
oCCID
oCE
oFCC
oRoHS 2
oREACH
oTELEC (Japan)
oMicrosoft®WHQL

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 9 of 69
3.0.Architecture
3.1. HardwareDesign
The Cortex M3 grade main processor is used for communication with tablet or PC via B T interface or
USB interface. It also controls the peripherals and ICC communication. The NFC chip acts as a
Transceiver to build an RF channel between contactless tag and the main processor.
Figure 1: Hardware Architecture
3.1.1. Battery
AMR220-C1 uses a rechargeable Lithium-ion battery, which has the capacity of 450 mAh.
3.1.1.1. Battery Charging
The battery of AMR220-C1 may be charged by connecting it to a power outlet.
3.1.1.2. Battery Life
The battery life is dependent on t he us age of the device. Below is an estimate of the battery life
depending on the various work conditions:
Mode Estimated Battery Life
Working Mode:
Contact Interface 9 days*(1)
Working Mode:
Contactless Interface 7 days*(1)
OFF Mode 2 years
Table 2: Estimated Battery Lifespan
*Note: Results may vary as it depends on the smart card used.
(1) In Bluetooth mode, 10 operations per day with 1 minute operation run
Hos t
wi th BT
NFC Chi p
Built-in
Antenna
Conta ctl e s s
Tag
Carrier Freq
= 13.56MHz
I CC So ck e t
Con ta ct Ca rd
Peripherals
LED, Buzzer, etc
Bl uetooth
Module
Li -Ion Ba ttery
Carrier Freq
= 2.4GHz
Hos t
wi th USB
USB 2 .0
BLE 4.1
Main
Processor

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 10 of 69
3.1.2. User Interface
3.1.2.1. LED Behaviors
Charging LED
LED Status Description
Charging LED On
Charging
Charging LED Off
Fully Charged
Bluetooth LED
LED Status Description
Slow Blinking (0.5 sec - ON, 4.5 sec - OFF) Paired
Slow Blinking (0.5 sec - ON, 1.5 sec - OFF) Pairing
OFF Bluetooth is Inactive
LED Status
BT LED ON
BT LED Off
EMV Contactless LEDs Behaviors
Note: For more information, refer to EMV Contactless Specification: https://www.em vco.com /wp-
content/uploads/2017/05/Book_A_Architecture_and_General_Rqmts_v2_6_Final_20160422011856105.pdf.

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 11 of 69
3.1.2.2. Switch Behaviors
3.1.2.2.1. Power Switch Behaviors
•To turn on the device, press and hold the power switch for about 1-2 seconds.
•To turn off the device, press and hold the power switch until a beep sound is heard, then
release the switch.
3.1.2.2.2. Bluetooth Switch Behaviors
To activate/deactivate Bluetooth paring:
•To activate Bluetooth pairing, press Bluetooth switch once.
•To deactivate Bluetooth pairing, press twice within 2 seconds.
To set device into Firmware Update Mode:
•If the device is turned on, press and hold Bluetooth switch for about 10 seconds.
•If the device is turned off, press Bluetooth switch together with the power switch.
3.1.2.3. Device Reset Pinhole
To reset the device:
•To reset the device, locate the pinhole beside the Bluetooth button, then press the reset
button using a pin.

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 12 of 69
3.2. Software Design
3.2.1. USB Interface
By using an MS-CCID driver, only a single slot device may be supported, and only the P ICC int erface
may be used. In order to use both interfaces, the ACS dri ver is needed. AMR220-C1 USB int erface
follows CCID protocol with two defined slots; one for ICC interface and one for PICC interface.
Since AMR220-C1 is a CCID device, the host application is fully compatible with PCSC standard.
Note: For more details, please refer to Microsoft MSDN Library or PCSC work group.
Some usually used PCSC API will be described in PCSC API.
Figure 2: Software Architecture – USB Interface
3.2.2. Bluetooth Interface
The Bluetooth interface of AMR220-C1 follows the BLE 4.1 standard. ACS offers a high level
Android/IOS library to simplify application programming. The BT API is described in Bluetooth
Library.
Below is the BLE architecture for reference.
Figure 3: Software Architecture – Bluetooth Interface
AMR220-C1 PCSC Application
Command Dispatch
ISO7816 1-4
ISO14443 1-4 /
ISO18092
ICC
PICC
USB
CCID
AMR220-C
Phys ical

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 13 of 69
4.0.Host Programming
4.1. PCSC API
This section describes some of the PCSC API for application programming using USB interface. For
more details, please refer to Microsoft MSDN Library or PCSC workgroup.
4.1.1. SCardEstablishContext
The SCardEstablishContext function establishes the resource m anager context within which database
operations are performed.
Refer to: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379479%28v= vs.85%29.aspx
4.1.2. SCardListReaders
The SCardListReaders function provi des the list of readers within a set of named reader groups,
eliminating duplicates.
The caller supplies a list of reader groups, and receives the list of readers within the named groups.
Unrecognized group names are ignored. This function only returns readers within the named groups
that are currently attached to the system and available for use.
Refer to: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379793%28v= vs.85%29.aspx
4.1.3. SCardConnect
The S CardConnect function establishes a c onnection (using a specific resource manager context)
between the calling application and a smart card contained by a specific reader. If no card exists in
the specified reader, an error is returned.
Refer to: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379473%28v= vs.85%29.aspx
4.1.4. SCardControl
The S CardControl function gives you direct control of the reader. You can call it any time after a
successful call to SCardConnect and before a successful call to SCardDisconnect. The effect on the
state of the reader depends on the control code.
Refer to: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379474%28v= vs.85%29.aspx
Note: Commands from Escape Command are using this API for sending.
4.1.5. ScardTransmit
The S CardTransmit function sends a service request to the smart card and ex pects to receive data
back from the card.
Refer to: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379804%28v= vs.85%29.aspx
Note:APDU Comm ands (i.e. the commands sent to connected card in Pseudo A PDUs for
Contactless Interface) are using this API for sending.
4.1.6. ScardDisconnect
The SCardDisconnect function terminates a connection previously opened between the calling
application and a smart card in the target reader.
Refer to: http://msdn.microsoft.com/en-us/library/windows/desktop/aa379475%28v= vs.85%29.aspx

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 14 of 69
4.1.7. APDU Flow
Figure 4: APDU Flow
SCardEstablishContext
SCardListReaders
Reader
present?
SCardConnect
Connection
successful?
SCardTransmit
SCardDisconnect
Start
End
Yes
No
Yes
No

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 15 of 69
4.1.8. Escape Command Flow
Figure 5: Escape Command Flow
SCardEstablishContext
SCardListReaders
Reader
present?
SCardConnect
SCardControl
SCardDisconnect
Start
End
Yes
No

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 16 of 69
4.2. Bluetooth Library
This section describes the ACS B T libra ry for develop er use. For m ore details, please refer to the
Library package documents.
4.2.1. Setting Up BLE
If BLE is supported on the device, enable Bluetoot h in order to connect card terminals. To enable
Bluetooth, get the instance of BluetoothAdapter from BluetoothManager.
private BluetoothAdapter mBluetoothAdapter;
...
// Initializes Bluetooth adapter.
final BluetoothManager bluetoothManager = (BluetoothManager)
getSystemService(Context.BLUETOOTH_SERVICE);
mBluetoothAdapter = bluetoothManager.getAdapter();
To check whether Bluet ooth is enabled or not, call isEnabled() from Bluet oothAdapter. Th en, call
startActivityForResult() to request user permission to enabl e Bluet ooth. The result will be returned
from onActivityResult() implementation.
// Ensures Bluetooth is available on the device and it is enabled. If not,
// displays a dialog requesting user permission to enable Bluetooth.
if (mBluetoothAdapter == null || !mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new
Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 17 of 69
4.2.2. Initializing Java Smart Card I/O API
To use Java Smart Card I/O API with B LE card terminals, call getInstance() from BluetoothSmartCard.
This class is a singleton and takes a Context as a parameter. If this method is called within Activity,
they can pass this to the parameter.
private BluetoothTerminalManager mManager;
private TerminalFactory mFactory;
...
// Get the Bluetooth terminal manager.
mManager = BluetoothSmartCard.getInstance(this).getManager();
if (mManager == null) {
Toast.makeText(this, R.string.error_bluetooth_not_supported,
Toast.LENGTH_SHORT).show();
finish();
return;
}
// Get the terminal factory.
mFactory = BluetoothSmartCard.getInstance(this).getFactory();
if (mFactory == null) {
Toast.makeText(this, R.string.error_bluetooth_provider_not_found,
Toast.LENGTH_SHORT).show();
finish();
return;
}

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 18 of 69
4.2.3. Finding BLE Card Terminals
To find BLE card terminals, use startScan() method from BluetoothTerminalManager. Supply a
terminal type and a callback for returning CardTerminal object.
Once the card termi nal is found, stopScan() must be called to stop the scanning. This is to avoid the
smart device battery from draining quickly, which will affect the operation.
For Android 6.0 or later, developers must request either ACCESS_COARSE_LOCA TION or
ACCESS_FINE_LOCA TION permission at run-time in order to scan BLE devices.
private Handler mHandler;
private Button mScanButton;
private TerminalAdapter mTerminalAdapter;
...
// Initialize Scan button.
mHandler = new Handler();
mScanButton = (Button) findViewById(R.id.activity_main_button_scan);
mScanButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// Request access coarse location permission.
if (ContextCompat.checkSelfPermission(MainActivity.this,
Manifest.permission.ACCESS_COARSE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.ACCESS_COARSE_LOCATION},
REQUEST_ACCESS_COARSE_LOCATION);
} else {
mScanButton.setEnabled(false);
mTerminalAdapter.clear();
// Start the scan.
mManager.startScan(BluetoothTerminalManager.TERMINAL_TYPE_AMR220_C,
new BluetoothTerminalManager.TerminalScanCallback() {
@Override
public void onScan(final CardTerminal terminal) {
runOnUiThread(new Runnable() {
@Override
public void run() {
mTerminalAdapter.addTerminal(terminal);
}
});
}
});
// Stop the scan.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mManager.stopScan();
mScanButton.setEnabled(true);
}
}, SCAN_PERIOD);
}
}
});

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 19 of 69
The result will be returned from onRequestPermissions Result(). After the permission is granted, the
application can start the scan.
@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions,
@NonNull int[] grantResults) {
if (requestCode == REQUEST_ACCESS_COARSE_LOCATION) {
if ((grantResults.length > 0)
&& (grantResults[0] == PackageManager.PERMISSION_GRANTED)) {
mScanButton.setEnabled(false);
mTerminalAdapter.clear();
// Start the scan.
mManager.startScan(BluetoothTerminalManager.TERMINAL_TYPE_AMR220_C,
new BluetoothTerminalManager.TerminalScanCallback() {
@Override
public void onScan(final CardTerminal terminal) {
runOnUiThread(new Runnable() {
@Override
public void run() {
mTerminalAdapter.addTerminal(terminal);
}
});
}
});
// Stop the scan.
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
mManager.stopScan();
mScanButton.setEnabled(true);
}
}, SCAN_PERIOD);
}
} else {
super.onRequestPermissionsResult(requestCode, permissions,
grantResults);
}
}
4.2.4. Connecting to a Card
To connect a card, call connect() from CardTermi nal object to return a Card object. The available
protocols are T=0, T=1, T=0 or T=1 and direct.
// Protocol:
// "T=0" - T=0
// "T=1" - T=1
// "*" - T=0 or T=1
// "direct" - Direct mode
try {
Card card = terminal.connect("*");
} catch (CardException e) {
e.printStackTrace();
}

AMR220-C1 – Reference Manual info@acs.com.hk
Version 1.02 www.acs.com.hk
Page 20 of 69
4.2.5. Disconnecting from the Card
After using the card, disconnect it by calling disconnect() from the Card object. To reset the card after
disconnecting, pass true to the parameter.
try {
card.disconnect(false);
} catch (CardException e) {
e.printStackTrace();
}
4.2.6. Transmitting APDUs
If the card is connected successfully, open a channel to transmit APDUs. Call either getBasicChannel()
or openLogicalChannel() from Card obj ect. After a CardChannel object is returned, transmit APDUs
using transmit(CommandAPDU) or transmit(ByteBuffer, ByteBuffer) from the CardChannel object.
byte[] command = { 0x00, (byte) 0x84, 0x00, 0x00, 0x08 };
try {
Card card = terminal.connect("*");
CardChannel channel = card.getBasicChannel();
CommandAPDU commandAPDU = new CommandAPDU(command);
ResponseAPDU responseAPDU = channel.transmit(commandAPDU);
} catch (CardException e) {
e.printStackTrace();
}
4.2.7. Transmitting Control Commands
If the card is connected successfully, call transmitControlCommand() from the Card object to transmit
control commands.
int controlCode = BluetoothTerminalManager.IOCTL_ESCAPE;
try {
Card card = terminal.connect("direct");
card.transmitControlCommand(controlCode, command);
} catch (CardException e) {
e.printStackTrace();
}
4.2.8. Disconnecting from BLE Card Terminal
The library connects BLE card terminal autom atically when calli ng connect() from the CardTerminal
object. To terminat e the Bluetoot h connection manually, call disconnect() from
BluetoothTerminalManager object.
mManager.disconnect(terminal);
Table of contents
Other ACS Card Reader manuals