
PA700
27
UNITECH
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.
rule.txt example:
q,1,t,3,1,19,28
q,1,e,^i.*
m,1,s,1,0
q,2,s,2,10
q,3,t,0
m,3,s,0,0