public final class StBarcodeScanner
extends java.lang.Object
getInstance()| Modifier and Type | Class and Description |
|---|---|
static class |
StBarcodeScanner.BarcodeInfo
barcode info
|
static class |
StBarcodeScanner.BarcodeScannerModel
module information
|
static class |
StBarcodeScanner.BarcodeScannerModelK |
static class |
StBarcodeScanner.BarcodeScannerModelUnknown |
| Modifier and Type | Method and Description |
|---|---|
<BarcodeScannerModelX> |
getBarcodeScannerInterfaceAs(java.lang.Class<BarcodeScannerModelX> model) |
StBarcodeScanner.BarcodeScannerModel |
getBarcodeScannerModel() |
static StBarcodeScanner |
getInstance()
Get a bar code scanner object.
|
static StBarcodeScanner |
getInstance(StBarcodeScanner.BarcodeScannerModel barcodeScannerModel) |
boolean |
init()
initialize the device, it takes time to initialize
|
boolean |
isInited()
judge initialized
|
java.lang.String |
scan()
Conduct a barcode scanning
Blocking implementation of a bar code scan, till get a bar code,or timeout. |
java.lang.String |
scan(java.lang.String charsetName)
Conduct a barcode scanning
Blocking implementation of a bar code scan, till get a bar code,or timeout. |
StBarcodeScanner.BarcodeInfo |
scanBarcodeInfo()
Conduct a barcode scanning
Blocking implementation of a bar code scan, till get a bar code,or timeout. |
void |
setOnBarcodeScannedLisener(StBarcodeScanner.BarcodeScannerModelUnknown.BsmUnknownOnNewBarcodeScannedListener lisener)
set listener
|
void |
stopScan()
stop scan
|
void |
trigScan()
trigger scanning, asynchronous implementation way
|
void |
uninit()
close device,clear lisener
|
public void trigScan()
public static StBarcodeScanner getInstance()
StBarcodeScanner instance,or null if
failedscan()public static StBarcodeScanner getInstance(StBarcodeScanner.BarcodeScannerModel barcodeScannerModel)
public StBarcodeScanner.BarcodeScannerModel getBarcodeScannerModel()
public final <BarcodeScannerModelX> BarcodeScannerModelX getBarcodeScannerInterfaceAs(java.lang.Class<BarcodeScannerModelX> model)
public boolean init()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionscan()public void stopScan()
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionpublic void uninit()
public void setOnBarcodeScannedLisener(StBarcodeScanner.BarcodeScannerModelUnknown.BsmUnknownOnNewBarcodeScannedListener lisener)
public boolean isInited()
scan()public java.lang.String scan()
throws java.lang.InterruptedException,
java.lang.IllegalStateException,
java.io.UnsupportedEncodingException
java.lang.InterruptedException - :java.lang.IllegalStateException - java.io.UnsupportedEncodingExceptionpublic java.lang.String scan(java.lang.String charsetName)
throws java.lang.InterruptedException,
java.lang.IllegalStateException,
java.io.UnsupportedEncodingException
charsetName -
charset namejava.lang.InterruptedException - :java.lang.IllegalStateException - java.io.UnsupportedEncodingExceptionpublic StBarcodeScanner.BarcodeInfo scanBarcodeInfo() throws java.lang.InterruptedException, java.lang.IllegalStateException
StBarcodeScanner.BarcodeInfo, failed:return to nulljava.lang.InterruptedException - :java.lang.IllegalStateException -