Sunmi L2 User manual

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
Sunmi Scanner User Guide

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 1 -
Document Update Description
Number
Update date
Version
Update content
Author
1.0.0
2018/04/24
v1.1.6
Original Version.
Darren、Arthur
1.0.1
2018/06/07
v1.1.19
Increase access to sweep dock
type interface.
Darren、Arthur
1.0.2
2018/11/23
v2.1.x
Add code system detail settings.
Increase suffix settings.
Add advanced formatting.
Increase virtual button settings.
Add clear configuration menu.
Increase no direct output.
Increase output code type ID.
Correction section description.
Darren、Arthur
1.0.3
2019/03/09
v2.3.x
Add suffixes to support "\xxx"
escaping.
Add advanced format support
"\xxx" escaping.
Add broadcast output to support
raw byte array.
Modify some descriptions and
captions.
Darren、Arthur

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 2 -
1. Introduction
Sunmi L2, P2Lite and other scan code special equipment, can be used for commercial
super, industrial, medical, agricultural trade, law enforcement, etc., L2 has two kinds of scan
specs:
NewLand:New NewLand Sweeping Pier, support code see Schedule 1;
Zebra:Zebra Sweeping Pier, support code see Schedule 1;
Honeywell: Honeywell Sweeping Pier, support code see Schedule 1;
Scan Engine is a development-free scanning device. By default, the side key triggers the
scan code function. There are three scan code output results. The default is the analog
keyboard output. The user opens any edit box. After the scan is successful, the scan result is
automatically entered in the edit box.
If the user needs the software to trigger the scan code or needs to customize the scan
code button, it can be set through the interface provided by the scan code service.
The following describes the interface documentation related to the scan code service
(currently support Aidl way and service connection).

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 3 -
2. Connect Service(AIDL)
2.1. AIDL
AIDL is the abbreviation of Android Interface Definition language. It is a description
language of Android's internal process communication interface. Through it, we can define the
communication interface between processes.
2.2. Use AIDL
Establishing a connection can be divided into the following 5 steps:
1. Add the AIDL file included in the resource file to your project.
2. Implement ServiceConnection in the code class that controls scan code.
3. Call ApplicationContext.bindService() and pass it in the ServiceConnection
implementation. Note: bindservice is a non-blocking call, meaning that the call is not
completed immediately after the call is completed. ServiceConnected must prevail.
4. In the ServiceConnection.onServiceConnected() implementation, you receive an IBinder
instance (the invoked Service). Call IScanInterface.Stub.asInterface(service) to convert
the argument to IScanInterface type.
5. Now you can call the methods defined in the IScanInterface interface.
Binding service example:
private static ServiceConnection conn = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
scanInterface = IScanInterface.Stub.asInterface(service);
Log.i("setting", "Scanner Service Connected!");
}
@Override
public void onServiceDisconnected(ComponentName name) {
Log.e("setting", "Scanner Service Disconnected!");
scanInterface = null;
}
};
public void bindScannerService() {

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 4 -
Intent intent = new Intent();
intent.setPackage("com.sunmi.scanner");
intent.setAction("com.sunmi.scanner.IScanInterface");
bindService(intent, conn, Service.BIND_AUTO_CREATE);
}

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 5 -
2.3. AIDL Interface
No.
Fuction
1
void sendKeyEvent(KeyEvent key)
Custom the trigger key
2
void scan()
start scan
3
void stop()
stop scan
4
int getScannerModel()
Get scanner type
Custom the trigger key
fuction:void sendKeyEvent(KeyEvent key)
parameter:
key →KeyEvent
action=KeyEvent.ACTION_UP:start scan
action=KeyEvent.ACTION_DOWN:stop scan
Example:
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
// Example: Use the X key value as the trigger sweep key.
if (event.getKeyCode() == x) {
scanInterface.sendKeyEvent(event);
}
return super.dispatchKeyEvent(event);
}
Start scan
fuction:void scan( )
Note:Need to work with the stop() method to start identifying scan codes.
Example:
scanInterface.scan();

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 6 -
Stop scan
fuction:void stop( )
Note:Need to work with the scan() method to stop identifying scan codes.
Example:
scanInterface.stop();
Get scan type
fuction:int getScannerModel( )
Return:Type:
100 →NONE
101 →P2Lite/V2Pro/P2Pro(em1365/BSM1825)
102 →L2-newland(EM2096)
103 →L2-zabra(SE4710)
104 →L2-HoneyWell(N3601)
105 →L2-HoneyWell(N6603)
106 →L2-Zabra(SE4750)
107 →L2-Zabra(EM1350)
Example:
scanInterface.getScannerModel();

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 7 -
3. Setting
3.1. Clear configuration
Click the menu icon in the top right corner, then click "Clear Config", as shown below:

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 8 -
3.2. Character set selection
Default:UTF-8
Options:UTF-8,GBK,ISO-8859-1,SHITF-JIS
3.3. Prompt mode
Acoustic and vibration alerts are turned on by default.
3.4. Data Output mode
1. Setting
Simulated keyboard output is selected by default.
Broadcast output is turned on by default.
Barcode type is not output by default. Refer to CodeID for details.

Shanghai Sunmi Technology Co., Ltd. Sweeping Development
- 9 -
Fill in EditText directly, select the “character to button”(output the end character as an
analog button)
This manual suits for next models
1
Table of contents
Other Sunmi Scanner manuals


















