The text of a manual · part 4 of 11
PSM20i Bar Code Scanner Attachment Programmer's Guide: Chapter 2 Function Definitions, pages 15 to 24
Pages 15 to 24 of 80, from PSM20i Bar Code Scanner Attachment Programmer's Guide
The original document is the PDF (773 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Symbol PSM20i
Page 15
Chapter 2 Function Definitions Introduction This chapter details all of the available function calls and their descriptions (see Table 2-1 for a complete list). All CSP functions listed are broken down by functional group. Table 2-1. Available Function Calls Function Name
Description
Page
Basic Function Commands disable
Terminates a connection with the scanner.
2-5 enable
Establishes a connection with the scanner.
2-6 getCodeType
Returns the code type of barcode scanned.
2-7 isEnabled
Determines if the scanner is currently enabled and ready for use.
2-9 resetScanner
Reconfigures the scanner to the factory default settings.
2-10 setDataTransFormat
Determines the format of the decoded data which is returned to the application.
2-11 setLaserOnTime
Sets the amount of time the decoder will try to decode a barcode.
2-12 setLinearSecurity
Determines which linear code types and lengths must be read, 2-13 depending on the security level.
setPrefix
Set the hex value of the character to be used as the prefix to any decoded data.
2-15
2-1
Page 16
PSM20i Bar Code Scanner Attachment Programmer’s Guide
Table 2-1. Available Function Calls Function Name
Description
Page setSuffix1
Set the hex value of the character to be used as the first suffix 2-16 to any decoded data.
setSuffix2
Set the hex value of the character to be used as the second suffix to any decoded data.
2-17 startDecode
Returns a string containing the decoded text.
2-18 transmitCodeId
Returns an ID character along with the decoded barcode data. 2-19
Decode Configuration Commands booklandEAN
Enable or disable decoding of Bookland-EAN barcodes and set label options.
2-20 codabar
Enable or disables decoding of Codabar bar codes and options.
2-21 code128
Enable or disables decoding of USS-128 bar codes.
2-23 code39
Enable or disables decoding of Code 39 bar codes and options.
2-24 code39Trioptic
Enable or disables decoding of Trioptic Code 39 bar codes.
2-26 code93
Enable or disables decoding of Code 93 bar codes and lengths.
2-27 discrete2of5
Enable or disables decoding of Discrete 2 Of 5 bar codes and 2-28 lengths.
ean128
Enable or disables decoding of UCC/EAN-128 bar codes.
ean13
Enable or disable decoding of EAN-13 barcodes and set label 2-31 options.
ean8
Enable or disable decoding of EAN-8 barcodes and set label options.
2-32 interleaved2of5
Enable or disables decoding of Interleaved 2 Of 5 bar codes and options.
2-33 isbt128
Enable or disables decoding of ISBT-128 bar codes.
2-35 msiPlessey
Enable or disables decoding of MSI Plessey bar codes and options.
2-36
2-2
2-30
Page 17
Function Definitions
Table 2-1. Available Function Calls Function Name
Description
Page upcA
Enable or disable decoding of UPC-A barcodes and set label options.
2-38 upcE
Enable or disable decoding of UPC-E barcodes and set label options.
2-39 upcE1
Enable or disable decoding of UPC-E1 barcodes and set label 2-40 options.
upcEANCouponCode
Enable or disables decoding of UPC-A, UPC-A with 2 supplemental characters, UPC-A with 5 supplemental characters, and UPC-A/EAN-128 bar codes.
2-41 upcEANSecurity
Set the level of security for decoding UPC/EAN bar codes.
2-42 upcEANSupplemental
Set supplemental mode for UPC/EAN labels.
2-43 upcEANSupplRedundancy Adjust the number of times a symbol without supplementals will be decoded before transmission.
2-44
Miscellaneous getSDKVersion
Returns the version of the SDK that was used in creating the midlet.
2-45
Please note, the returned data from each function, if false, indicates an error condition in executing the function, except for errors reported from Windows file operations. A true indicates success and/or returned data as detailed by each function description.
2-3
Page 18
PSM20i Bar Code Scanner Attachment Programmer’s Guide
Supported Barcode Type The following bar codes types can be scanned with the PSM20i Bar Code Scanner Attachment:
2-4
Barcode Type
Default Setting on Scanner
UPC-A
Enable
UPC-E
Enable
UPC-E1
Disable
EAN-8
Enable
EAN-13
Enable
EAN-128
Enable
Code 39
Enable
Trioptic Code 39
Disable
Code 93
Disable
Code 128
Enable
ISBT-128
Enable
Bookland EAN
Disable
Interleave 2 of 5
Enable
Discrete 2 of 5
Disable
MSI Plessey
Disable
Codabar
Disable
Coupon Code
Disable
Page 19
Function Definitions
Basic Function Commands disable Class BarCodeReader
Description Terminates a connection with the scanner.
Invocation boolean disable()
Return Value true if connection to scanner was successfully disabled.
false if connection to scanner failed.
Example import com.symbol.j2me.midlets.ascanner.BarCodeReader; BarCodeReader barCodeReader = new BarCodeReader(); boolean response = barCodeReader.disable();
2-5
Page 20
PSM20i Bar Code Scanner Attachment Programmer’s Guide enable Class BarCodeReader
Description Establishes a connection with the scanner. This function must be successfully executed prior to calling any other function calls. Note: To guarantee an accurate decode, ensure that the enable function is not called while the phone is transmitting.
Invocation boolean enable()
Return Value true if connection to scanner was successfully enabled.
false if connection to scanner failed.
Example import com.symbol.j2me.midlets.ascanner.BarCodeReader; BarCodeReader barCodeReader = new BarCodeReader(); boolean response = barCodeReader.enable();
2-6
Page 21
Function Definitions getCodeType Class BarCodeReader
Description Returns the code type of barcode scanned.
Invocation byte getCodeType()
2-7
Page 22
PSM20i Bar Code Scanner Attachment Programmer’s Guide
Return Value Returns a byte representing the type of barcode scanned. Below is a list of associated hex values for each supported code type: Barcode Type
Hex Value
Barcode Type
Hex Value
Not Applicable
0x00
EAN-8 + 5 Supps.
0x8A
Bookland EAN
0x16
Interleave 2 of 5
0x06
Codabar
0x02
ISBT 128 Concat.
0x21
Code 128
0x03
ISBT-128
0x19
Code 39
0x01
MSI Plessey
0x0E
Code 39 Full ASCII
0x13
Trioptic Code 39
0x15
Code 93
0x07
UPC-A
0x08
Coupon Code
0x17
UPC-A + 2 Supps.
0x48
Discrete 2 of 5
0x04
UPC-A + 5 Supps.
0x88
EAN-128
0x0F
UPC-E
0x09
EAN-13
0x0B
UPC-E + 2 Supps.
0x49
EAN-13 + 2 Supps.
0x4B
UPC-E + 5 Supps.
0x89
EAN-13 + 5 Supps.
0x8B
UPC-E1
0x10
EAN-8
0x0A
UPC-E1 + 2 Supps.
0x50
EAN-8 + 2 Supps.
0x4A
UPC-E1 + 5 Supps.
0x90
Value is 0x00 if the scanner is disabled or no barcode has been scanned.
Example import com.symbol.j2me.midlets.ascanner.BarCodeReader; BarCodeReader barCodeReader = new BarCodeReader(); byte codeType = barCodeReader.getCodeType();
2-8
Page 23
Function Definitions isEnabled Class BarCodeReader
Description Determines if the scanner is currently enabled and ready for use.
Invocation boolean isEnabled()
Return Value true if scanner is enabled false if scanner is not enabled
Example import com.symbol.j2me.midlets.ascanner.BarCodeReader; BarCodeReader barCodeReader = new BarCodeReader(); boolean response = barCodeReader.isEnabled();
2-9
Page 24
PSM20i Bar Code Scanner Attachment Programmer’s Guide resetScanner Class BarCodeReader
Description Reconfigures the scanner to the factory default settings. Any application applied configurations will be lost.
Invocation boolean resetScanner()
Return Value true scanner was reset successfully.
false failed to reset scanner.
Example import com.symbol.j2me.midlets.ascanner.BarCodeReader; BarCodeReader barCodeReader = new BarCodeReader(); boolean response = barCodeReader.resetScanner(); Sets the scanner back to its factory configuration.
2-10