1. USI Communication ................................................................................................................................................... 2
1.7. Close scan service .............................................................................................................................................. 4
1.8. Enable Scan Service .......................................................................................................................................... 4
1.9. Set Preamble ...................................................................................................................................................... 4
1.10. Set Postamble .................................................................................................................................................... 4
1.11. Set Terminator .................................................................................................................................................... 4
1.12. Set Vibration ....................................................................................................................................................... 5
1.13. Set Sound ........................................................................................................................................................... 5
1.14. Set EAN128 Field Separator .............................................................................................................................. 5
1.15. Set Intercharacter Delay ..................................................................................................................................... 5
1.16. Set Keep Scan Timeout ...................................................................................................................................... 5
1.17. Set Intercharacter Delay ..................................................................................................................................... 5
2.2. Receive scanned data ...................................................................................................................................... 26
2.3. Programming example ...................................................................................................................................... 26
3. Tips using Scan2Key ............................................................................................................................................... 26
3.1. Want to know the barcode symbology ? ........................................................................................................... 26
3.2. The received data is longer the barcode data .................................................................................................. 26
3.3. Enable/Disable barcode scanning through HTML5 .......................................................................................... 26
4. Simple Data Editing ................................................................................................................................................. 26
4.1. Enable data editing ........................................................................................................................................... 26
All USI cross application communications are done by broadcast intent between USI and user applications.
The below schematic sketches the scanner integration.
ScanServer V1.95 and above (as integrated in OS Built 3230 and above)
unitech.scanservice.start
unitech.scanservice.close
unitech.scanservice.init
Barcode Scanner
&
Decoder
Data
Unitech
Scan
Service
(V1.95 and above)
Data
Settings
Trigger keys left/right
unitech.scanservice.
software_scankey
unitech.scanservice.save_setting
unitech.scanservice.load_setting
com.unitech.scanservice.adapter
unitech.scanservice.scan
Unitech
Scan2Key
unitech.scanservice.datatype
unitech.scanservice.data
Keyboard buffer
1.1. Enable/disable Scan2Key
Description: Enable/Disable the Scan2Key which supports keyboard emulation features.
Action: “unitech.scanservice.scan2key_setting”
Extended data: Name: “scan2key”
Note: PA700 1D engine INDEX = 1; 2D engine INDEX = 2.
If parameter number is bigger than 0xEF, set EXTEND to true; else set EXTEND to false.
If EXTEND is true, set EXT to extended parameter code. And NUM to param_num offset.
If EXTEND is false, set NUM to param_num.
And for each parameter, please check out the following JSON data.
“Parameter” is human readable name of the parameter.
“Hex” is the <param_num> or <extended parameter code><param_num offset>.
To get the <value>, please check the “Type”.
If type is 1, that means this parameter only has enable(1)/disable(0) or true(1)/false(0) option.
If type is 2, that means this parameter has multiple options, and the values are listed in “Tag”.
If type is 3, that means this parameter has a range of options, and the range values are between “Min” and “Max”.
Open the ScanService
Select the tab “Settings”
Select “Data Options”
Select “Transmit Code ID character” and select “AIM Code ID character”
The Barcode symbology will be transmitted as in
For example and code visit http://portal.unitech.eu/tools/android.aspx#
PA700 26 UNITECH
to know the barcode symbology ?
]C0
097050214112
4. Simple Data editing
ScanService V2.30 or above
4.1. Enable data editings
To enable data editing, first generate a text file called rule.txt at /sdcard/ folder. ScanService will read this file when it
starts, and apply rules in the file to the final output of the data when using Scan2Key feature. The rule will not apply
when data is sent out via intent.
If you want to stop using the data editing feature, just remove rule.txt from /sdcard/ folder.
4.2. rule.txt
Currently, ScanService will supports max of 10 sets of rules. It goes from 0 to 9, and if it matches qualifier for rule 0,
then it will stop at rule 0. Otherwise it will keep going unit rule 9. If all rules are failed, then empty string will be
outputted.
Each rule requires at least one qualifier. You can have multiple qualifiers in the same set. Only when all qualifiers are
passed, then it will proceed to the modifier. If there is no modifier, then the original data will be outputted.
Each line rule consists of at least 4 sections. And each section is separate by comma.
The first section indicate if this line of rule is a (q)qualifier or (m)modifier.
The second section indicate this line of rule belong to which set of rules. It should be from 0 to 9.
The third section will have different options depends on if this line of rule is qualifier or modifier.
In the case of qualifier:
(t)target symbology: This will be followed by how many symbologies will be in this qualifier, and
then the symbologies which you want to use as qualifier.
In the example, we have 3 symbologies we want to check, and they are
1(code 39), 19(code 39 full ASCII), and 28(QR code). You can find the
number for each symbology in Table A-8. Currently the rule can only take
decimal number, so please convert the hex number in Table A-8 to decimal
first.
To select all symbologies, have the number of symbologies set to 0.
(s)size of barcode: This will be followed by the condition, 0 means equal, 1 means less then, 2
means greater then. And then followed by the size you want to compare to.
(e)regular expression: This will be followed by java regular expression.
In the case of modifier:
(s)selection: This will be followed by start position, and then by length of the selection.
You can put 0 for the length to mean all remaining characters.