AsReader¶
setEventListener¶
Sets the AsReaderEventListener.
⚠️ Warning
Before calling the methodconnectDevice(Device device), you must
callsetEventListener(AsReaderEventListener listener).
public void setEventListener (AsReaderEventListener listener);
Parameter Name |
In/Out |
Type |
Description |
listener |
In |
AsReaderEventListener |
AsReaderEventListener object |
Sample Code:
private AsReaderEventListener mAsReaderEventListener = new AsReaderEventListener() {
@Override
public void onStateChanged(AsReader asReader, ConnectionState connectionState) {
}
@Override
public void onReadBarcode(AsReader asReader, BarcodeType barcodeType, String codeId, String barcode) {
}
@Override
public void onActionChanged(AsReader asReader, ActionState actionState) {
}
@Override
public void onCommandComplete(AsReader asReader, CommandType commandType) {
}
@Override
public void onKeyEvent(AsReader asReader, KeyType keyType, KeyState keyState) {
}
@Override
public void onExceptionOccurred(AsReader asReader, int code) {
}
@Override
public void onReadTag(AsReader reader, ActionState action, String tag, float rssi, float phase, float frequency) {
}
@Override
public void onAccessResult(AsReader reader, ResultCode code, ActionState action,
String epc, String data, float rssi, float phase, float frequency) {
}
};
reader.setEventListener(mAsReaderEventListener);
removeEventListener¶
Removes the AsReaderEventListener.
public void removeEventListener(AsReaderEventListener listener);
Parameter Name |
In/Out |
Type |
Description |
listener |
In |
AsReaderEventListener |
AsReaderEventListener object |
Sample Code:
reader.removeEventListener(mAsReaderEventListener);
connectDevice¶
Connects to the ASR-L251G.
When this method is called, the connection status of the ASR-L251G is notified via the callback method onStateChanged.
public void connectDevice(Device device);
Parameter Name |
In/Out |
Type |
Description |
device |
In |
Device |
Device object |
Sample Code:
Device device = new DeviceUsbCdc(Context);
reader.connectDevice(device);
disconnectDevice¶
Disconnects from the ASR-L251G.
When this method is called, the connection status of the ASR-L251G is notified via the callback method onStateChanged.
public void disconnectDevice();
Sample Code:
reader.disconnectDevice();
getState¶
Gets the connection status of the ASR-L251G.
public ConnectionState getState();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Connection status |
Sample Code:
ConnectionState state = reader.getState();
getAction¶
Gets the action status of the ASR-L251G.
public ActionState getAction();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Action status |
Sample Code:
ActionState actionState = reader.getAction();
getFirmwareVersion¶
Gets the firmware version of the ASR-L251G.
public String getFirmwareVersion();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
String |
Firmware version |
Sample Code:
String firmwareVersion = reader.getFirmwareVersion();
getBatteryStatus¶
Gets the battery level of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public int getBatteryStatus() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
int |
Battery level |
Sample Code:
try {
int battery = reader.getBatteryStatus();
} catch (AsReaderException e) {
}
getSerialNumber¶
Gets the serial number of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public String getSerialNumber() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
String |
Serial number |
Sample Code:
try {
String serialNumber = reader.getSerialNumber();
} catch (AsReaderException e) {
}
getVersion¶
Gets the SDK version.
public String getVersion();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
String |
SDK version |
Sample Code:
String version = reader.getVersion();
getRFModuleVersion¶
Gets the firmware version of the RFID module.
public String getRFModuleVersion();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
String |
Firmware version of the RFID module |
Sample Code:
String moduleVersion = reader.getRFModuleVersion();
getGlobalBand¶
Gets the region information of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public GlobalBandType getGlobalBand() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Region information |
Sample Code:
try {
GlobalBandType globalBandType = reader.getGlobalBand();
} catch (AsReaderException e) {
}
getSDKMessage¶
Gets the message returned by the SDK.
If the ASR-L251G enters a sleep state during connection and an error occurs on the device side,
calling this method getSDKMessage() will return a message based on the error content.
public String getSDKMessage();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
String |
Message returned from the SDK |
Sample Code:
String message = reader.getSDKMessage();
startDecode¶
Starts barcode scanning.
When this method is called,
the callback method onReadBarcode receives the scanned barcode data,
and the callback method onActionChanged notifies the change in action status of the ASR-L251G.
public ResultCode startDecode();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
The result of the method call, an enumeration type ResultCode |
Sample Code:
ResultCode code = reader.startDecode();
stopDecode¶
Barcodeスキャンを停止します。
本メソッドを呼び出すと、コールバックメソッド onActionChanged でASR-L251Gのアクションステータスの変更が通知されます。
stopDecode¶
Stops barcode scanning.
public ResultCode stopDecode();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
The result of the method call, an enumeration type ResultCode |
Sample Code:
ResultCode code = reader.stopDecode();
getBuzzer¶
Gets the buzzer status of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public BuzzerState getBuzzer() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Buzzer Status BuzzerState |
Sample Code:
try {
BuzzerState buzzerState = reader.getBuzzer();
} catch (AsReaderException e) {
}
setBuzzer¶
Sets the buzzer status of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public void setBuzzer(BuzzerState state) throws AsReaderException
Parameter Name |
In/Out |
Type |
Description |
state |
In |
Buzzer status, enumeration type BuzzerState |
Sample Code:
try {
reader.setBuzzer(BuzzerState.Off);
} catch (AsReaderException e) {
}
startBuzzer¶
Starts buzzer playback.
The buzzer sound will play for the specified buzzer time and then stop.
public ResultCode startBuzzer(int milliseconds);
Parameter Name |
In/Out |
Type |
Description |
milliseconds |
In |
int |
Buzzer time |
Return Value |
Out |
The result of the method call, an enumeration type ResultCode |
Sample Code:
int milliseconds = 300;
ResultCode code = reader.startBuzzer(milliseconds);
getVibratorState¶
Gets the vibration status of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public VibratorState getVibratorState() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Vibration status, enumeration type VibratorState |
Sample Code:
try {
VibratorState vibratorState = reader.getVibratorState();
} catch (AsReaderException e) {
}
setVibratorState¶
Sets the vibration status of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public void setVibratorState(VibratorState state) throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
state |
In |
Vibrator status, enumeration type VibratorState |
Sample Code:
try {
reader.setVibratorState(VibratorState.Off);
} catch (AsReaderException e) {
}
startVibrator¶
Starts vibration.
The vibration will operate for the specified time and then stop.
public ResultCode startVibrator(int milliseconds);
Parameter Name |
In/Out |
Type |
Description |
milliseconds |
In |
int |
Vibration time |
Return Value |
Out |
The result of the method call, an enumeration type ResultCode |
Sample Code:
int milliseconds = 500;
ResultCode code = reader.startVibrator(milliseconds);
setAutoOffTime¶
Sets the auto off time of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public void setAutoOffTime(int time) throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
time |
In |
int |
Auto off time |
Sample Code:
try {
reader.setAutoOffTime(5);
} catch (AsReaderException e) {
}
getAutoOffTime¶
Gets the auto off time of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public int getAutoOffTime() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
int |
Auto off time |
Sample Code:
try {
int seconds = reader.getAutoOffTime();
} catch (AsReaderException e) {
}
setSleepTime¶
Sets the automatic sleep time of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
⚠️ Warning
When connected and not executing inventory, the countdown for sleep time begins.
public void setSleepTime(int time) throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
time |
In |
int |
Automatic sleep time |
Sample Code:
try {
reader.setSleepTime(5);
} catch (AsReaderException e) {
}
getSleepTime¶
Gets the automatic sleep time of the ASR-L251G.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public int getSleepTime() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
int |
Automatic sleep time |
Sample Code:
try {
int seconds = reader.getSleepTime();
} catch (AsReaderException e) {
}
setBarcodeParam¶
Sets the on/off of barcode types.
public boolean setBarcodeParam(ParamValue value);
Parameter Name |
In/Out |
Type |
Description |
value |
In |
On/off information of barcode types, ParamValue object |
|
Return Value |
Out |
boolean |
true: Setting succeeded, false: Setting failed |
Sample Code:
boolean isBarcodeParam = reader.setBarcodeParam(paramValue);
getBarcodeParam¶
Gets the configuration information of the corresponding barcode type by barcode type name.
public ParamValue getBarcodeParam(ParamName name);
Parameter Name |
In/Out |
Type |
Description |
name |
In |
Barcode type, enumeration type ParamName |
|
Return Value |
Out |
On/off information of barcode types, ParamValue object |
Sample Code:
ParamValue value = reader.getBarcodeParam(ParamName.Code39);
setBarcodeParam¶
Sets the on/off of multiple barcode types.
public boolean setBarcodeParam(ParamValueList params);
Parameter Name |
In/Out |
Type |
Description |
params |
In |
On/off list of barcode types, ParamValueList object |
|
Return Value |
Out |
boolean |
true: Setting succeeded, false: Setting failed |
Sample Code:
ParamValueList valueList = new ParamValueList();
int mVideoReverse = reader.getBarcodeParam(ParamName.VideoReverse).getValue();
ParamValue value = new ParamValue(ParamName.VideoReverse, mVideoReverse);
valueList.add(value)
boolean isBarcodeParam = reader.setBarcodeParam(valueList);
getBarcodeParam¶
Gets the configurable barcode types and whether the corresponding barcode types can be scanned.
public ParamValueList getBarcodeParam(ParamName[] names);
Parameter Name |
In/Out |
Type |
Description |
names |
In |
ParamName[] |
Barcode type array |
Return Value |
Out |
Scannable barcode type list, ParamValueList object |
Sample Code:
ParamName[] names = new ParamName[]{aramName.UPCA, ParamName.UPCE0, ParamName.UPCE1};
ParamValueList valueList = reader.getBarcodeParam(names);
setCharset¶
Sets the character set of the SDK.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public void setCharset(Charset charset) throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
charset |
In |
Charset |
Character set |
Sample Code:
try {
Charset charset = Charset.forName("UTF-8");
reader.setCharset(charset);
} catch (AsReaderException e) {
}
getCharset¶
Gets the character set of the SDK.
If an error occurs when setting or retrieving data, AsReaderException will be thrown.
public Charset getCharset() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Charset |
Character set |
Sample Code:
try {
Charset charset = reader.getCharset();
} catch (AsReaderException e) {
}
resetReader¶
Resets the ASR-L251G device.
public ResultCode resetReader();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
The command execution result of ASR-L251G, enumeration type ResultCode |
Sample Code:
ResultCode code = reader.resetReader();
getResultCode¶
Gets the command execution result of ASR-L251G.
public ResultCode getResultCode();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Command execution result, enumeration type ResultCode |
Sample Code:
ResultCode code = reader.getResultCode();
stop¶
Stops the inventory of ASR-L251G.
public ResultCode stop();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Command execution result, enumeration type ResultCode |
Sample Code:
ResultCode code = reader.stop();
defaultParameter¶
Resets all parameter values of ASR-L251G to their default values.
When this method is called, the running operation will be notified via the callback method onCommandComplete.
public ResultCode defaultParameter();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Command execution result, enumeration type ResultCode |
Sample Code:
ResultCode code = reader.defaultParameter();
saveParameter¶
Saves all parameters to ASR-L251G.
When this method is called, the running operation will be notified via the callback method onCommandComplete.
public ResultCode saveParameter();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
The command execution result of ASR-L251G, enumeration type ResultCode |
Sample Code:
ResultCode code = reader.saveParameter();
isBarcodeEnabled¶
Gets whether the Barcode module is available.
public boolean isBarcodeEnabled();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
boolean |
true: module available / false: module unavailable |
Sample Code:
boolean enable = reader.isBarcodeEnabled();
getPowerGainRange¶
Gets the power output range of the RFID UHF module.
public PowerRange getPowerGainRange();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Power output range, PowerRange object |
Sample Code:
PowerRange powerGainRange = reader.getPowerGainRange();
isRfidEnabled¶
Gets whether the RFID module is available.
public boolean isRfidEnabled();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
boolean |
true: module available / false: module unavailable |
Sample Code:
boolean enable = reader.isRfidEnabled();
inventory¶
Starts RFID tag inventory.
When this method is called,
the callback method onReadTag will receive the data inventoried by ASR-L251G,
and the callback method onActionChange
will notify the action change of ASR-L251G.
public ResultCode inventory();
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
Method execution result, enumeration type ResultCode |
Sample Code:
ResultCode resultcode = reader.inventory();
getContinuousMode¶
Gets whether the RFID module of ASR-L251G performs continuous reading.
If an error occurs during setting or retrieval, AsReaderException will be thrown.
public boolean getContinuousMode() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
boolean |
true: continuous reading / false: non-continuous reading |
Sample Code:
try {
boolean continuous = reader.getContinuousMode();
} catch (AsReaderException e) {
}
setContinuousMode¶
Sets whether the RFID module of ASR-L251G performs continuous reading.
If an error occurs during setting or retrieval, AsReaderException will be thrown.
public void setContinuousMode(boolean enabled) throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
enabled |
In |
boolean |
true: continuous reading / false: non-continuous reading |
Sample Code:
try {
reader.setContinuousMode(true);
} catch (AsReaderException e) {
}
getPowerGain¶
Gets the Power value used by ASR-L251G when reading with the RFID module.
If an error occurs during setting or retrieval, AsReaderException will be thrown.
public int getPowerGain() throws AsReaderException;
Parameter Name |
In/Out |
Type |
Description |
Return Value |
Out |
int |
Power value |
Sample Code:
try {
int power = reader.getPowerGain();
} catch (AsReaderException e) {
}
setPowerGain¶
Sets the Power value used by the ASR-L251G RFID module when reading tags.
If an error occurs during setting or retrieval, an AsReaderException will be thrown.
public void setPowerGain(int power) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
power |
In |
int |
Power value |
Sample Code:
try {
reader.setPowerGain(10);
} catch (AsReaderException e) {
}
getReportRSSI¶
Retrieves whether the ASR-L251G RFID module obtains RSSI data when reading tags.
If an error occurs during setting or retrieval, an AsReaderException will be thrown.
public boolean getReportRSSI() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
boolean |
|
Sample Code:
try {
boolean report = reader.getReportRSSI();
} catch (AsReaderException e) {
}
setReportRSSI¶
Specifies whether the ASR-L251G RFID module should obtain RSSI data when reading tags.
If an error occurs during setting or retrieval, an AsReaderException will be thrown.
public void setReportRSSI (boolean enabled) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
enabled |
In |
bool |
|
Sample Code:
try {
reader.setReportRSSI(true);
} catch (AsReaderException e) {
}
getQuerySession¶
Retrieves the Session value of the RFID module.
If an error occurs during setting or retrieval, an AsReaderException will be thrown.
public QuerySession getQuerySession() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
A |
Sample Code:
try {
QuerySession mQuerySession = reader.getQuerySession();
} catch (AsReaderException e) {
}
setQuerySession¶
Sets the Session value of the RFID module.
If an error occurs during setting or retrieval, an AsReaderException will be thrown.
public void setQuerySession(QuerySession session) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
session |
In |
A |
Sample Code:
try {
reader.setQuerySession(QuerySession.S0);
} catch (AsReaderException e) {
}
getQueryTarget¶
Retrieves the Session Flag of the ASR-L251G RFID module.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public QueryTarget getQueryTarget() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
|
Sample code:
try {
QueryTarget mQueryTarget = reader.getQueryTarget();
} catch (AsReaderException e) {
}
setQueryTarget¶
Sets the Session Flag of the ASR-L251G RFID module.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public void setQueryTarget(QueryTarget target) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
target |
In |
|
Sample code:
try {
reader.setQueryTarget(QueryTarget.A);
} catch (AsReaderException e) {
}
getLinkProfile¶
Retrieves the Link Profile value of the ASR-L251G RFID module.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public int getLinkProfile() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
int |
Link Profile value |
Sample code:
try {
int mLinkProfile = reader.getLinkProfile();
} catch (AsReaderException e) {
}
setLinkProfile¶
Sets the Link Profile value of the ASR-L251G RFID module.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public void setLinkProfile(int value) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
value |
In |
int |
Link Profile value |
Sample code:
try {
reader.setLinkProfile(1);
} catch (AsReaderException e) {
}
getMaskType¶
Retrieves the Mask type of the ASR-L251G RFID module.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public MaskType getMaskType () throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
|
Sample code:
try {
MaskType mMaskType = reader.getMaskType();
} catch (AsReaderException e) {
}
setMaskType¶
Sets the Mask type of the ASR-L251G RFID module.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public void setMaskType(MaskType type) throws AsReaderException;
Sample code:
try {
reader.setMaskType(MaskType.NoMask);
} catch (AsReaderException e) {
}
getOperationTime¶
Retrieves the operation time value (in milliseconds) of the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public int getOperationTime() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
int |
Operation time (ms) |
Sample code:
try {
int operationTime = reader.getOperationTime();
} catch (AsReaderException e) {
}
setOperationTime¶
Sets the operation time value (in milliseconds) for the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public void setOperationTime(int time) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
time |
In |
int |
Operation time (ms) |
Sample code:
try {
reader.setOperationTime(300);
} catch (AsReaderException e) {
}
getIdleTime¶
Retrieves the idle time value (in milliseconds) of the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public int getIdleTime() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
int |
Idle time (ms) |
Sample code:
try {
int idleTime = reader.getIdleTime();
} catch (AsReaderException e) {
}
setIdleTime¶
Sets the idle time value (in milliseconds) for the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public void setIdleTime(int time) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
time |
In |
int |
Idle time (ms) |
Sample code:
try {
reader.setIdleTime(100);
} catch (AsReaderException e) {
}
getSessionTargetInventory¶
Retrieves whether the Session Target Inventory is enabled on the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public boolean getSessionTargetInventory() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
boolean |
|
Sample code:
try {
boolean enabled = reader.getSessionTargetInventory();
} catch (AsReaderException e) {
}
setSessionTargetInventory¶
Sets whether to enable Session Target Inventory on the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public void setSessionTargetInventory(boolean enabled) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
enabled |
In |
boolean |
|
Sample code:
try {
reader.setSessionTargetInventory(true);
} catch (AsReaderException e) {
}
getEpcMaskMatchMode¶
Retrieves the EPC mask match mode used by the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public EpcMaskMatchMode getEpcMaskMatchMode() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
EPC mask matching mode (enumeration type) |
Sample code:
try {
EpcMaskMatchMode mode = reader.getEpcMaskMatchMode();
} catch (AsReaderException e) {
}
setEpcMaskMatchMode¶
Sets the EPC mask match mode for the ASR-L251G RFID module.
If an error occurs during setting or retrieval, an AsReaderException is thrown.
public void setEpcMaskMatchMode(EpcMaskMatchMode mode) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
mode |
In |
EPC mask matching mode (enumeration type) |
Sample code:
try {
reader.setEpcMaskMatchMode(EpcMaskMatchMode.Normal);
} catch (AsReaderException e) {
}
getModeLeftLedOn¶
Retrieves whether the LED of the left Mode key on the ASR-L251G is turned on.
public boolean getModeLeftLedOn();
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
boolean |
true: LED is on |
Sample Code:
boolean mode = reader.getModeLeftLedOn();
setModeLeftLedOn¶
Sets whether the LED of the left Mode key on the ASR-L251G is turned on.
public void setModeLeftLedOn(boolean isLeftOn);
Parameter |
In/Out |
Type |
Description |
isLeftOn |
In |
boolean |
true: LED on |
Sample Code:
reader.setModeLeftLedOn(true);
getModeRightLedOn¶
Retrieves whether the LED of the right Mode key on the ASR-L251G is turned on.
public boolean getModeRightLedOn();
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
boolean |
true: LED is on |
Sample Code:
boolean mode = reader.getModeRightLedOn();
setModeRightLedOn¶
Sets whether the LED of the right Mode key on the ASR-L251G is turned on.
public void setModeRightLedOn(boolean isRightOn);
Parameter |
In/Out |
Type |
Description |
isRightOn |
In |
boolean |
true: LED on |
Sample Code:
reader.setModeRightLedOn(true);
readMemory¶
Reads data from a specific memory bank of a tag.
When this method is called,
the callback method onAccessResult receives the data read by the ASR-L251G, and
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
public ResultCode readMemory(MemoryBank bank, int offset, int length);
Parameter |
In/Out |
Type |
Description |
bank |
In |
Tag memory bank (enum |
|
offset |
In |
int |
Start address of the tag (unit: word) |
length |
In |
int |
Length of the tag data (unit: word) |
Return value |
Out |
Execution result of the method (enum |
Sample Code:
int offset = 0;
int length = 5;
ResultCode resultCode = reader.readMemory(MemoryBank.EPC, offset, length);
writeMemory¶
Writes data to a specific memory bank of a tag.
When this method is called,
the callback method onAccessResult receives the data written by the ASR-L251G, and
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
public ResultCode writeMemory(MemoryBank bank, int offset, String data);
Parameter |
In/Out |
Type |
Description |
bank |
In |
Tag memory bank (enum |
|
offset |
In |
int |
Start address of the tag (unit: word) |
data |
In |
String |
Data to write (hexadecimal string) |
Return value |
Out |
Execution result of the method (enum ResultCode) |
Sample Code:
int offset = 0;
String data = "3333";
ResultCode resultCode = reader.writeMemory(MemoryBank.EPC, offset, data);
lock¶
Locks data in a specific area of the tag.
When this method is called,
the callback method onAccessResult receives the locked tag data, and
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
public ResultCode lock(LockParam param);
Parameter |
In/Out |
Type |
Description |
param |
In |
|
|
Return value |
Out |
Execution result of the method (enum ResultCode) |
Sample Code:
boolean killPassword = true;
boolean accessPassword = true;
boolean epc = true;
boolean tid = true;
boolean user = true;
LockParam param = new LockParam(killPassword, accessPassword, epc, tid, user);
ResultCode resultCode = reader.lock(param);
unlock¶
Unlocks a previously locked memory bank of a tag.
After unlocking, the tag data can be modified using the default password.
When this method is called,
the callback method onAccessResult receives the unlocked tag data, and
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
public ResultCode unlock(LockParam param);
Parameter |
In/Out |
Type |
Description |
param |
In |
|
|
Return value |
Out |
Execution result of the method (enum ResultCode) |
Sample Code:
boolean killPassword = true;
boolean accessPassword = true;
boolean epc = true;
boolean tid = true;
boolean user = true;
LockParam param = new LockParam(killPassword, accessPassword, epc, tid, user);
ResultCode resultCode = reader.unlock(param);
permaLock¶
Permanently locks data in a specific memory bank of a tag.
Once permanently locked, the tag data cannot be changed or unlocked.
When this method is called,
the callback method onAccessResult receives the permanently locked tag data, and
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
public ResultCode permaLock(LockParam param);
Parameter |
In/Out |
Type |
Description |
param |
In |
|
|
Return value |
Out |
Execution result of the method (enum ResultCode) |
Sample Code:
boolean killPassword = true;
boolean accessPassword = true;
boolean epc = true;
boolean tid = true;
boolean user = true;
LockParam param = new LockParam(killPassword, accessPassword, epc, tid, user);
ResultCode resultCode = reader.permaLock(param);
kill¶
Permanently disables a tag.
Killed tags cannot be used anymore.
When this method is called,
the callback method onAccessResult receives the killed tag data, and
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
public ResultCode kill(String killPassword);
Parameter |
In/Out |
Type |
Description |
killPassword |
In |
String |
Kill password |
Return value |
Out |
Execution result of the method (enum ResultCode) |
Sample Code:
String killPassword = "12345678";
ResultCode resultCode = reader.kill(killPassword);
setBarcodeMode¶
Sets the ASR-L251G to barcode mode.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
⚠️ Note
When barcode mode is enabled, RFID commands cannot be executed.
When barcode mode is disabled, only RFID commands can be executed.
public ResultCode setBarcodeMode(boolean isBarcodeMode) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
isBarcodeMode |
In |
boolean |
true: enable barcode mode, false: disable barcode mode |
Return value |
Out |
Execution result of the method (enum ResultCode) |
Sample Code:
try {
ResultCode resultCode = reader.setBarcodeMode(true);
} catch (AsReaderException e) {
}
startScanHW¶
Activates the ASR-L251G laser.
When this method is called,
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
⚠️ Note
Use this if a barcode scan fails due to a barcode configuration error.
public void startScanHW();
Sample Code:
reader.startScanHW();
stopScanHW¶
Deactivates the ASR-L251G laser.
When this method is called,
the callback method onActionChange notifies changes in the ASR-L251G’s actions.
public void stopScanHW();
Sample Code:
reader.stopScanHW();
destroy¶
Destroys the AsReader class instance and releases resources.
public void destroy();
Sample Code:
reader.destroy();
readRFMSensorTag¶
Inventories temperature and humidity tags.
When this method is called,
the callback method onReadTagWithRFM notifies the inventoried sensor tag data.
ResultCode readRFMSensorTag();
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
Execution result of the method (enum ResultCode) |
Sample Code:
reader.readRFMSensorTag();
usedSelectionMask¶
Checks whether the mask at a specified position is used.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public boolean usedSelectionMask(int index) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
index |
In |
int |
Mask index |
Return value |
Out |
boolean |
true: mask used, false: mask not used |
Sample Code:
try {
boolean isUsed = reader.usedSelectionMask(1);
} catch (AsReaderException e) {
}
removeSelectionMask¶
Removes the selection mask at the specified index.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public void removeSelectionMask(int index) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
index |
In |
int |
Mask index |
Sample Code:
try {
reader.removeSelectionMask(1);
} catch (AsReaderException e) {
}
clearSelectionMask¶
Removes all selection mask information.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public void clearSelectionMask() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Sample Code:
try {
reader.clearSelectionMask();
} catch (AsReaderException e) {
}
getDefaultLinkProfile¶
Gets the default link profile value of the ASR-L251G RFID module.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public int getDefaultLinkProfile() throws AsReaderException
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
int |
Default link profile value |
Sample Code:
try {
int mLinkProfile = reader.getDefaultLinkProfile();
} catch (AsReaderException e) {
}
setDefaultLinkProfile¶
Sets the default link profile value of the ASR-L251G RFID module.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public void setDefaultLinkProfile(int value) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
value |
In |
int |
Default link profile value |
Sample Code:
try {
reader.setDefaultLinkProfile(1);
} catch (AsReaderException e) {
}
clearEpcMask¶
Clears EPC mask data stored in the ASR-L251G memory bank.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public void clearEpcMask() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Sample Code:
try {
reader.clearEpcMask();
} catch (AsReaderException e) {
}
getEpcMaskCount¶
Gets the number of EPC masks stored in the ASR-L251G memory bank.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
int getEpcMaskCount() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return value |
Out |
int |
Number of EPC masks |
Sample Code:
try {
int count = reader.getEpcMaskCount();
} catch (AsReaderException e) {
}
addEpcMask¶
Adds an EPC mask.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public void addEpcMask(int offset, int length, String mask) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
offset |
In |
int |
Start address of the mask (unit: bit) |
length |
In |
int |
Length of the mask (unit: bit) |
mask |
In |
String |
Mask value (hexadecimal string) |
Sample Code:
try {
int offset = 0;
int length = 5;
String mask = "3333";
reader.addEpcMask(offset, length, mask);
} catch (AsReaderException e) {
}
addEpcMask¶
Adds an EPC mask in the form of a SelectMaskEpcParam object.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public void addEpcMask(SelectMaskEpcParam param) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
param |
In |
SelectMaskEpcParam |
|
Sample Code:
try {
int offset = 0;
int length = 5;
String mask = "3333";
SelectMaskEpcParam param = new SelectMaskEpcParam(offset, length, mask);
reader.addEpcMask(param);
} catch (AsReaderException e) {
}
getEpcMask¶
Gets an EPC mask in the form of a SelectMaskEpcParam object.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public SelectMaskEpcParam getEpcMask(int index) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
index |
In |
int |
EPC mask index |
Return value |
Out |
|
Sample Code:
try {
SelectMaskEpcParam param = reader.getEpcMask(1);
} catch (AsReaderException e) {
}
setEpcMaskMatchMode¶
Configures whether the ASR-L251G RFID module uses the EPC mask.
An AsReaderException is thrown if an error occurs when setting or retrieving data.
public void setEpcMaskMatchMode(boolean enabled) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
enabled |
In |
boolean |
true: use EPC mask |
Sample Code:
try {
reader.setEpcMaskMatchMode(true);
} catch (AsReaderException e) {
}
getEpcMaskMatchMode¶
Retrieves whether the ASR-L251G RFID module uses the EPC MASK.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public boolean getEpcMaskMatchMode() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return |
Out |
boolean |
true: EPC Mask is used |
Sample Code:
try {
boolean mode = reader.getEpcMaskMatchMode();
} catch (AsReaderException e) {
}
getLbtMask¶
Retrieves the mask array of the frequency table information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public int[] getLbtMask() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return |
Out |
int[] |
Mask array |
Sample Code:
try {
int[] array = reader.getLbtMask();
} catch (AsReaderException e) {
}
getLbt¶
Retrieves the frequency table information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public LbtItem[] getLbt() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return |
Out |
LbtItem[] |
Array of |
Sample Code:
try {
LbtItem[] array = reader.getLbt();
} catch (AsReaderException e) {
}
setLbt¶
Sets the frequency table information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public void setLbt(LbtItem[] table) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
table |
In |
LbtItem[] |
Array of |
Sample Code:
try {
LbtItem[] table= new LbtItem[3];
reader.setLbt(table);
} catch (AsReaderException e) {
}
getLbtFreq¶
Retrieves frequency information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public String getLbtFreq(int slot) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
slot |
In |
int |
Position in the LBT frequency table |
Return |
Out |
String |
Frequency information |
Sample Code:
try {
String lbtFreq = reader.getLbtFreq(1);
} catch (AsReaderException e) {
}
getEpcMaskMatchMode¶
Retrieves whether the ASR-L251G RFID module uses the EPC MASK.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public boolean getEpcMaskMatchMode() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return |
Out |
boolean |
true: EPC Mask is used |
Sample Code:
try {
boolean mode = reader.getEpcMaskMatchMode();
} catch (AsReaderException e) {
}
getLbtMask¶
Retrieves the mask array of the frequency table information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public int[] getLbtMask() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return |
Out |
int[] |
Mask array |
Sample Code:
try {
int[] array = reader.getLbtMask();
} catch (AsReaderException e) {
}
getLbt¶
Retrieves the frequency table information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public LbtItem[] getLbt() throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
Return |
Out |
LbtItem[] |
Array of |
Sample Code:
try {
LbtItem[] array = reader.getLbt();
} catch (AsReaderException e) {
}
setLbt¶
Sets the frequency table information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public void setLbt(LbtItem[] table) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
table |
In |
LbtItem[] |
Array of |
Sample Code:
try {
LbtItem[] table= new LbtItem[3];
reader.setLbt(table);
} catch (AsReaderException e) {
}
getLbtFreq¶
Retrieves frequency information.
If an error occurs during data setting or retrieval, an AsReaderException is thrown.
public String getLbtFreq(int slot) throws AsReaderException;
Parameter |
In/Out |
Type |
Description |
slot |
In |
int |
Position in the LBT frequency table |
Return |
Out |
String |
Frequency information |
Sample Code:
try {
String lbtFreq = reader.getLbtFreq(1);
} catch (AsReaderException e) {
}