
23
Programming Concepts
3.5
Symbol Decoding
The primary function of the OHV300 is scanning, decoding, and processing one-
dimensional and two-dimensional barcodes. The reader can read a wide range of code
types, or symbologies, and provide access to the data after decoding. The reader decodes
in one of two ways:
Pressing the read key on the key pad.
A decode command from the
reader.processCommand
method.
The
reader.onDecode
defines an event that allows the application to access data.
To program the OHV300 to scan and transmit data, follow the below commands.
function onDecode(decode)
{
// Processing
}
reader.onDecode = onDecode;
There are four basic options for decoding scanned data:
Process the data in the script, such as fill in form fields, and return null.
Let the data be further processed by the handheld firmware, typically for sending
and/or storing, by returning decode.
Transform the data and let the handheld firmware process the changed data by
setting decode.data as necessary and returning decode.
Invalidate the decode by returning false. The handheld will act as though the decode
never occurred.
The following pseudocode presents an example of decode processing addressing the four
options. The example transforms decode data based on certain symbologies. Then the
example checks the format of the decode data to determine the next processing steps.
Subsections following the pseudocode discuss the processing steps in the following
example.