Modifier and Type | Class and Description |
---|---|
class |
Device.EventDispatcher
Dispatch events to listeners.
|
Constructor and Description |
---|
Device(java.lang.String serialNumber)
Try to detect the desired device on each serial port available.
|
Device(java.lang.String serialNumber,
java.lang.String serialPortName)
Try to connect with a device on a specific serial port.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addBadgeReader(java.lang.String serialNumber,
java.lang.String serialPortName,
boolean isMaster)
Allows virtually "plugging-in" a Badge Reader to this Device.
|
boolean |
addFingerprintReader(java.lang.String serialNumber,
boolean isMaster)
Allows virtually "plugging-in" a Fingerprint Reader to this Device.
|
void |
addListener(DeviceEventHandler eventHandler)
Add a new listener (implementing at least DeviceEventHandler) to be informed of any new event.
|
boolean |
addScale(java.lang.String serialPortName,
ScaleSettings settings,
byte[] command)
Try to connect a scale using a custom configuration.
|
boolean |
addScale(java.lang.String serialPortName,
ScaleType type)
Allow connecting a scale using the configuration of a predefined model (see
ScaleType . |
boolean |
addTemperatureProbe(java.lang.String serialNumber,
int delay,
double eventDelta)
Try to connect and add a temperature probe with given serial number.
|
java.lang.Object |
adminQuery(java.lang.String query,
java.lang.Object... params)
Deprecated.
|
void |
disconnectTemperatureProbe()
Ask the current device to "release" its temperature probe(s) (if any has been added) and remove it.
|
boolean |
flashFirmware(java.util.List<java.lang.String> lines)
Deprecated.
|
double |
getCurrentTemperature() |
DeviceType |
getDeviceType()
Get information about the current device type.
|
java.lang.String |
getHardwareVersion() |
Inventory |
getLastInventory()
Get the inventory (if any) resulting from the last scan operation.
|
static java.util.Map<java.lang.String,PluggedDevice> |
getPluggedDevices()
Try to initialize a device on each serial port available.
|
java.lang.String |
getSerialNumber()
Mind that serial number can be set by user (constructor) or by RFID board (if set to null in constructor).
|
java.lang.String |
getSoftwareVersion() |
DeviceStatus |
getStatus()
See DeviceStatus enum for values.
|
java.util.Map<java.lang.String,java.lang.Byte> |
getTagToDrawerNumber()
Spacecode Devices equipped with many drawers memorize (for each tag) by which drawer a given UID has been
scanned for the last time.
|
UsersService |
getUsersService()
Provide access to the Users Management service.
|
void |
release()
Disconnect the device and release resources.
|
void |
removeListener(DeviceEventHandler eventHandler)
Remove an event listener.
|
void |
requestScan(ScanOption... options)
Order the RFID reader board to process a "MANUAL" scan operation.
|
RewriteUidResult |
rewriteUid(java.lang.String oldUid,
java.lang.String newUid)
Rewrite the UID of a tag (the tag must be from the E2 generation (or above)).
|
void |
setLastInventory(Inventory inventory)
Manually set "last inventory".
|
boolean |
setLightIntensity(int value)
Set the embedded LED's light intensity (for devices equipped with embedded LED's, like the SAS).
|
void |
setStatus(DeviceStatus status)
Update the device status.
|
boolean |
startLightingTagsLed(java.util.List<java.lang.String> tagsUid)
Send a "Lighting" order to the device.
An event LedEventHandler.lightingStarted(List) is raised when the operation successfully started.The status of the device must be "READY" (i.e. |
boolean |
stopLightingTagsLed()
Order the device to stop any lighting operation.
|
boolean |
stopScan()
Ask the RFID reader to stop the current scan (if any).
|
public Device(java.lang.String serialNumber) throws DeviceCreationException
serialNumber
- Device's serial number.DeviceCreationException
- If any error occurred or the device could not be found.public Device(java.lang.String serialNumber, java.lang.String serialPortName) throws DeviceCreationException
serialNumber
- Serial number of the desired device. If null, any device available will be connected.serialPortName
- Serial port used by the device.DeviceCreationException
- If any error occurred or no device could be found.public static java.util.Map<java.lang.String,PluggedDevice> getPluggedDevices()
PluggedDevice
structure (value).public java.lang.String getSerialNumber()
public void addListener(DeviceEventHandler eventHandler)
eventHandler
- An implementation of DeviceEventHandler, to be notified of any new event.public void removeListener(DeviceEventHandler eventHandler)
eventHandler
- Implementation of DeviceEventHandler to be removed.public void requestScan(ScanOption... options)
options
- List of ScanOption
(or none) to be used for the new scan operation.public boolean stopScan()
public DeviceStatus getStatus()
public void setStatus(DeviceStatus status)
status
- New value.public java.util.Map<java.lang.String,java.lang.Byte> getTagToDrawerNumber()
public void release()
public boolean startLightingTagsLed(java.util.List<java.lang.String> tagsUid)
LedEventHandler.lightingStarted(List)
is raised when the operation successfully started.tagsUid
- UID's of the tags to be lighted.public boolean stopLightingTagsLed()
public RewriteUidResult rewriteUid(java.lang.String oldUid, java.lang.String newUid)
oldUid
- UID of the tag to be rewritten.newUid
- New UID.public Inventory getLastInventory()
public void setLastInventory(Inventory inventory)
inventory
- Inventory to be set as "last inventory".public java.lang.String getSoftwareVersion()
public java.lang.String getHardwareVersion()
public DeviceType getDeviceType()
DeviceType
enumeration value.public UsersService getUsersService()
UsersService
instance.public boolean addFingerprintReader(java.lang.String serialNumber, boolean isMaster)
serialNumber
- Serial number of the Fingerprint Reader.isMaster
- If true, the reader will be considered as Master.public boolean addBadgeReader(java.lang.String serialNumber, java.lang.String serialPortName, boolean isMaster)
serialNumber
- Serial number of the Badge reader (can't be null nor empty, must be unique).serialPortName
- Serial port name to be used to connect to the Badge Reader (e.g. "COM7").isMaster
- If true, the reader will be considered as Master.public boolean addTemperatureProbe(java.lang.String serialNumber, int delay, double eventDelta)
serialNumber
- Serial number of the probe to be connected.
If empty, the first probe available will be used.delay
- Delay (seconds) between each measurement.
Minimum: ProbeModule.MIN_MEASURE_DELAYeventDelta
- Measure of next variation (°C) required to notify a new measure (event).
Minimum: ProbeModule.MIN_MEASURE_DELTApublic double getCurrentTemperature()
public void disconnectTemperatureProbe()
public boolean addScale(java.lang.String serialPortName, ScaleType type)
ScaleType
. ScaleEventHandler
.serialPortName
- Name of the serial port used by the scale.type
- Model (producer).public boolean addScale(java.lang.String serialPortName, ScaleSettings settings, byte[] command)
ScaleEventHandler
.serialPortName
- Name of the serial port used by the scale.settings
- ScaleSettings
attached to that scale.command
- Command to be sent over the serial port to query a new measure.public boolean flashFirmware(java.util.List<java.lang.String> lines)
lines
- Firmware lines (ordered) list.public boolean setLightIntensity(int value)
value
- [0;300] (0 - turn off, 300 - maximal intensity).public java.lang.Object adminQuery(java.lang.String query, java.lang.Object... params)
query
- Query code.params
- Query parameters.