webduino.module.Barcode
The Barcode class.
Table of Contents
Constructor
webduino.module.Barcode
-
board -
rxPin -
txPin
Parameters:
-
boardwebduino.BoardThe board the barcode scanner is attached to.
-
rxPinwebduino.Pin | NumberReceivin pin (number) the barcode scanner is connected to.
-
txPinwebduino.Pin | NumberTransmitting pin (number) the barcode scanner is connected to.
Methods
addListener
-
type -
listener
Add a listener for a certain type of event.
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
emit
-
type -
object,...
Emit an event of certain type.
Parameters:
-
typeStringEvent type.
-
[object,...]Object optionalEvent object(s).
listeners
-
type
Return the listener list bound to certain type of event.
Parameters:
-
typeStringEvnet type.
off
()
Stop scanning.
on
-
callback
Start scanning.
Parameters:
-
[callback]Function optionalScanning callback.
once
-
type -
listener
Add a one-time listener for a certain type of event.
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
removeAllListeners
-
type
Remove all listeners of certain type.
Parameters:
-
typeStringEvent type.
removeListener
-
type -
listener
Remove a listener for certain type of event.
Parameters:
-
typeStringEvent type.
-
listenerFunctionEvent listener.
scan
-
callback
Start scanning.
Parameters:
-
[callback]Function optionalScanning callback.
setMaxListeners
-
n
Set maximum number of listeners that is allow to bind on an emitter.
Parameters:
-
nNumberNumber of listeners.
Attributes
Events
BarcodeEvent.MESSAGE
Fires when the barcode scanner scans a code.