public class LineaPro
extends java.lang.Object
All methods are internally synchronized with instance of current object.
Modifier and Type | Class and Description |
---|---|
static interface |
LineaPro.BarcodeListener
Interface definition for Barcode event callback.
|
static class |
LineaPro.BatteryInfo
Battery information.
|
static interface |
LineaPro.ButtonListener
Interface definition for button event callback.
|
static interface |
LineaPro.ConnectionListener
Interface definition for a Printer event callback.
|
Modifier and Type | Field and Description |
---|---|
static int |
BARCODE_MODE_MOTION_DETECT
Barcode engine into motion detect mode.
|
static int |
BARCODE_MODE_MULTI_SCAN
Barcode engine into multiple scan mode.
|
static int |
BARCODE_MODE_MULTI_SCAN_NO_DUPLICATE
Barcode engine into multiple scan mode with no duplicates.
|
static int |
BARCODE_MODE_SINGLE_SCAN
Barcode engine into single scan mode.
|
static int |
BARCODE_MODE_SINGLE_SCAN_ON_RELEASE
Barcode engine into single scan mode.
|
static int |
RFID_MODULE_CLRC663
CLRC663 RFID chip.
|
static int |
RFID_MODULE_MURATA
MURATA RFID chip.
|
Constructor and Description |
---|
LineaPro(java.io.InputStream inputStream,
java.io.OutputStream outputStream)
Constructs a new instance of this class from a given streams.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
bcGetEngine()
Get barcode engine.
|
int |
bcGetMode()
Get barcode scan mode.
|
int |
bcGetTimeout()
Get barcode timeout.
|
byte[] |
bcRead()
Read data from barcode module.
|
void |
bcRestoreDefaultMode()
Reset barcode scanner to default state.
|
void |
bcSetBeep(int volume,
int[] pattern)
Set the sound to play sounds on barcode scan.
|
void |
bcSetKeepAlive(boolean on)
Set barcode scanner to be always ready for scanning and do not go to sleep state.
|
void |
bcSetMode(int mode)
Set barcode scan mode.
|
void |
bcSetTimeout(int timeout)
Set barcode timeout.
|
void |
bcStartScan()
Start barcode scanning.
|
void |
bcStartUpdateMode(byte[] data)
Set barcode scanner in firmware update mode.
|
void |
bcStopBeep()
Stop play sounds on barcode scan.
|
void |
bcStopScan()
Stop barcode scanning.
|
void |
bcVendorInit(byte[] data)
Set vendor specific initialization command to barcode scanner.
|
void |
bcWrite(byte[] data)
Write data to barcode module.
|
void |
beep(int volume,
int[] pattern)
Play sounds on device speaker.
|
void |
beep(int volume,
int frequency,
int duration)
Play sounds on device speaker.
|
void |
close()
Close the streams and release all associated resources.
|
void |
enableBatteryCharge(boolean enable)
Enable mobile device battery charge when device is not powered.
|
void |
enableExternalSpeaker(boolean on)
Enable external speaker as default audio source.
|
void |
enableExternalSpeakerButton(boolean on)
Enable external speaker button.
|
void |
enableMaxCurrent(boolean on)
Enable max current throughput for the gang charger.
|
void |
enableScanButton(boolean enable)
Enable or disable device scan button.
|
void |
fwErase()
Erase current firmware.
|
void |
fwStart()
Start firmware update.
|
void |
fwStop()
End firmware update.
|
void |
fwUpdate(byte[] data)
Update firmware.
|
void |
fwWrite(int address,
byte[] data)
Write firmware chunk.
|
int |
getAutoOffTime(boolean connected)
Get the time after which the device shall automatically goes off.
|
LineaPro.BatteryInfo |
getBatteryInfo()
Get extended battery information.
|
int |
getBatteryLevel()
Return device battery level.
|
float |
getBatteryVoltage()
Return device battery voltage.
|
int |
getDeviceMode()
Get the device mode.
|
LineaProInformation |
getInformation()
Get device information.
|
java.util.Calendar |
getRTC()
Get real time clock.
|
boolean |
isBatteryChargeEnabled()
Return whether mobile device battery charge is enabled.
|
boolean |
isExternalSpeakerButtonEnabled()
Get whether external speaker button is enabled.
|
boolean |
isExternalSpeakerEnabled()
Get whether external speaker is enabled.
|
boolean |
isMaxCurrentEnabled()
Get whether max current is enabled.
|
boolean |
isScanButtonEnabled()
Return whether scan button is enabled.
|
RC663 |
rfidGetModule()
Returns instance to RFID module
|
byte[] |
rfidTransmit(int module,
byte[] data)
Transmit data to RFID module.
|
void |
saveSettings()
Force save settings.
|
void |
setAutoOffTime(boolean connected,
int autoOffTime)
Set the time after which the device shall automatically goes off.
|
void |
setBarcodeListener(LineaPro.BarcodeListener listener)
Set on barcode listener.
|
void |
setButtonListener(LineaPro.ButtonListener listener)
Set button switch listener.
|
void |
setConnectionListener(LineaPro.ConnectionListener listener)
Set a callback listener to notify the connection state is changed.
|
static void |
setDebug(boolean on)
Turn on/off debugging.
|
void |
setDeviceMode(int mode)
Set the device mode.
|
void |
setLED(boolean red,
boolean green,
boolean blue)
Turn on the LEDs.
|
void |
setRTC(java.util.Calendar clock)
Set real time clock.
|
void |
startVibrator(int duration)
Turn on the vibrator for a specified time.
|
void |
turnOff()
Turn off the device.
|
public static final int BARCODE_MODE_SINGLE_SCAN
public static final int BARCODE_MODE_MULTI_SCAN
public static final int BARCODE_MODE_MOTION_DETECT
public static final int BARCODE_MODE_SINGLE_SCAN_ON_RELEASE
public static final int BARCODE_MODE_MULTI_SCAN_NO_DUPLICATE
public static final int RFID_MODULE_MURATA
public static final int RFID_MODULE_CLRC663
public LineaPro(java.io.InputStream inputStream, java.io.OutputStream outputStream)
inputStream
- the input stream.outputStream
- the output stream.public void close() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.public static void setDebug(boolean on)
on
- the debugging state.public void setConnectionListener(LineaPro.ConnectionListener listener)
listener
- the listener.public void setBarcodeListener(LineaPro.BarcodeListener listener)
listener
- the listener.public void setButtonListener(LineaPro.ButtonListener listener)
listener
- the listener.public void turnOff() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void saveSettings() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void setRTC(java.util.Calendar clock) throws java.io.IOException, LineaProException
clock
- RTC value.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public java.util.Calendar getRTC() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public LineaProInformation getInformation() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public float getBatteryVoltage() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public int getBatteryLevel() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void beep(int volume, int[] pattern) throws java.io.IOException, LineaProException
The sounds are played in background.
Maximum 10 sounds can be set at once.
volume
- the volume in percents.pattern
- the array that contains patterns of frequency(Hz) and duration (milliseconds).java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void beep(int volume, int frequency, int duration) throws java.io.IOException, LineaProException
The sounds are played in background.
volume
- the volume in percents.frequency
- the sound frequency in Hertz.duration
- the sound duration in Milliseconds.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void setAutoOffTime(boolean connected, int autoOffTime) throws java.io.IOException, LineaProException
connected
- specify whether the time is related to device which is connected or not.autoOffTime
- the time value in milliseconds.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public int getAutoOffTime(boolean connected) throws java.io.IOException, LineaProException
connected
- Specify whether the time is related to device which is connected or not.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public int getDeviceMode() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void setDeviceMode(int mode) throws java.io.IOException, LineaProException
mode
- The device mode value: 1 - samsung s4, 2 - samsung s5java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcStartScan() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcStopScan() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcSetTimeout(int timeout) throws java.io.IOException, LineaProException
timeout
- the timeout in milliseconds.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public int bcGetTimeout() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcSetMode(int mode) throws java.io.IOException, LineaProException
mode
- the scan mode. The value can be one of BARCODE_MODE_* constant values.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public int bcGetMode() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void enableScanButton(boolean enable) throws java.io.IOException, LineaProException
enable
- true to enable scan button; otherwise false.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public boolean isScanButtonEnabled() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void enableBatteryCharge(boolean enable) throws java.io.IOException, LineaProException
enable
- true to enable battery charge; otherwise false.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public boolean isBatteryChargeEnabled() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public java.lang.Object bcGetEngine() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcSetBeep(int volume, int[] pattern) throws java.io.IOException, LineaProException
The sounds are played in background.
Maximum 10 sounds can be set at once.
volume
- the volume in percents.pattern
- the array that contains patterns of frequency(Hz) and duration (milliseconds).java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcStopBeep() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public byte[] bcRead() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcWrite(byte[] data) throws java.io.IOException, LineaProException
data
- the barcode data.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcSetKeepAlive(boolean on) throws java.io.IOException, LineaProException
on
- true to keep barcode on; otherwise false.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcVendorInit(byte[] data) throws java.io.IOException, LineaProException
data
- vendor specific initialization data, executed ones after a connection is
established.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcStartUpdateMode(byte[] data) throws java.io.IOException, LineaProException
data
- vendor specific data.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void bcRestoreDefaultMode() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void setLED(boolean red, boolean green, boolean blue) throws java.io.IOException, LineaProException
red
- turn on/off the red led.green
- turn on/off the green led.blue
- turn on/off the blue led.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void startVibrator(int duration) throws java.io.IOException, LineaProException
duration
- the vibration duration in milliseconds.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void enableExternalSpeaker(boolean on) throws java.io.IOException, LineaProException
on
- true to enable external speaker, otherwise disable it.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public boolean isExternalSpeakerEnabled() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void enableExternalSpeakerButton(boolean on) throws java.io.IOException, LineaProException
on
- true to enable external speaker, otherwise disable it.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public boolean isExternalSpeakerButtonEnabled() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void enableMaxCurrent(boolean on) throws java.io.IOException, LineaProException
on
- true to enable max current, otherwise disable it.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public boolean isMaxCurrentEnabled() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public LineaPro.BatteryInfo getBatteryInfo() throws java.io.IOException, LineaProException
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public byte[] rfidTransmit(int module, byte[] data) throws java.io.IOException, LineaProException
module
- module type. The parameter can be one of RFID_MODULE_* constant values.data
- data to be send.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public RC663 rfidGetModule() throws java.io.IOException
java.io.IOException
- If an I/O error occurs.public void fwStart() throws java.io.IOException, LineaProException
For AM devices authentication is need.
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void fwErase() throws java.io.IOException, LineaProException
This command can be executed only if start firmware update is executed.
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void fwWrite(int address, byte[] data) throws java.io.IOException, LineaProException
This command can be executed only if start firmware update is executed.
address
- the address to write data.data
- the data chunk. The data size can be maximum of 2044 bytes.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void fwStop() throws java.io.IOException, LineaProException
This command can be executed only if start firmware update is executed.
java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.public void fwUpdate(byte[] data) throws java.io.IOException, LineaProException
data
- the firmware data.java.io.IOException
- If an I/O error occurs.LineaProException
- if LineaPro error occurs.