Methods
(static) this.monitorStatus(scannerStatus)
Sets a callback function to receive updates on the scanner's status
Parameters:
| Name | Type | Description |
|---|---|---|
scannerStatus |
function | Callback function that updates the scanner status in realtime. Parameters: info(object) - info.connected(boolean) - indicates if supported reader is connected - info.name(string) - reader name - info.version(string) - reader firmware version |
- Source:
Example
// Example callback function
function BarcodeStatus(info)
{
if (info.connected)
document.body.innerHTML += "Connected barcode reader <b>" + info.name + " " + info.version + "</b>";
else
document.body.innerHTML += "Barcode reader disconnected<br/>";
}
(static) this.simulate(barcode, type)
Helper function to simulate a barcode scan for testing purposes. The simulated barcode is sent just like normal a scanned one will be.
Parameters:
| Name | Type | Description |
|---|---|---|
barcode |
string | Optional barcode string, you can pass null for default one |
type |
number | Optional barcode type or null for EAN-13 |
- Source:
(static) this.startScan()
Starts the hardware scanner
- Source:
(static) this.stopScan()
Stops the hardware scanner
- Source: