DeviceManager¶
getInstance¶
Method Signature¶
public static DeviceManager getInstance()
Return Value¶
Type |
Description |
DeviceManager |
Singleton object |
Description¶
Creates a DeviceManager object as a singleton.
Sample Code¶
DeviceManager deviceManager = DeviceManager.getInstance();
setPackageName¶
Method Signature¶
public void setPackageName(String name)
Parameters¶
Parameter |
Type |
Description |
name |
String |
Package name |
Description¶
Sets the package name.
Sample Code¶
DeviceManager.getInstance().setPackageName(getPackageName())
setCallback¶
Method Signature¶
public void setCallback(DeviceManagerCallback callback)
Parameters¶
Parameter |
Type |
Description |
callback |
DeviceManagerCallback |
Description¶
Sets the callback.
Sample Code¶
DeviceManager.getInstance().setCallback(this);
isConnected¶
Method Signature¶
public boolean isConnected()
Return Value¶
Type |
Description |
boolean |
Connection status |
Description¶
Retrieves the connection status.
Sample Code¶
boolean connected = DeviceManager.getInstance().isConnected();
setTriggerMode¶
Method Signature¶
public void setTriggerMode(DeviceConst.TriggerMode mode)
Parameters¶
Parameter |
Type |
Description |
mode |
DeviceConst.TriggerMode |
Description¶
Sets the trigger mode.
Sample Code¶
DeviceManager.getInstance().setTriggerMode(DeviceConst.TriggerMode.AUTO);
getTriggerMode¶
Method Signature¶
public DeviceConst.TriggerMode getTriggerMode()
Return Value¶
Type |
Description |
DeviceConst.TriggerMode |
Description¶
Retrieves the trigger mode.
Sample Code¶
DeviceConst.TriggerMode mode = DeviceManager.getInstance().getTriggerMode();
setBackgroundRead¶
Method Signature¶
public void setBackgroundRead(boolean enable)
Parameters¶
Parameter |
Type |
Description |
enable |
boolean |
Enable or disable background reading |
Description¶
Sets whether reading occurs in the background.
Sample Code¶
DeviceManager.getInstance().setBackgroundRead(true);
getBackgroundRead¶
Method Signature¶
public boolean getBackgroundRead()
Return Value¶
Type |
Description |
boolean |
Background read status |
Description¶
Retrieves whether reading occurs in the background.
Sample Code¶
boolean canRead = DeviceManager.getInstance().getBackgroundRead();
initialize¶
Method Signature¶
public void initialize(Context context, ConnectionType selectConnection)
Parameters¶
Parameter |
Type |
Description |
context |
Context |
Context |
selectConnection |
ConnectionType |
ConnectionType |
Description¶
Automatically called when initializing the AsReader class; no need to call explicitly.
isOpen¶
Method Signature¶
public boolean isOpen()
Return Value¶
Type |
Description |
boolean |
Connection session status |
Description¶
Retrieves the connection session status.
Sample Code¶
boolean isOpen = DeviceManager.getInstance().isOpen();
open¶
Method Signature¶
public void open()
Description¶
Opens the connection session.
Sample Code¶
DeviceManager.getInstance().open();
close¶
Method Signature¶
public void close()
Description¶
Closes the connection session.
Sample Code¶
DeviceManager.getInstance().close();
setReaderSettings¶
Method Signature¶
public void setReaderSettings(boolean beep, boolean vib, boolean aimer, boolean led, boolean powerOnBeep)
Parameters¶
Parameter |
Type |
Description |
beep |
boolean |
Beep |
vib |
boolean |
Vibration |
aimer |
boolean |
Aiming |
led |
boolean |
Light |
powerOnBeep |
boolean |
Power-on beep |
Description¶
Configures the AsReader settings.
Sample Code¶
DeviceManager.getInstance().setReaderSettings(true,true,true,true,true);
getReaderSettings¶
Method Signature¶
public void getReaderSettings()
Description¶
Retrieves AsReader settings. Result is returned via DeviceManagerCallback onReaderSettingReceived.
Sample Code¶
DeviceManager.getInstance().getReaderSettings();
getReaderInfo¶
Method Signature¶
public void getReaderInfo()
Description¶
Retrieves AsReader information. Result is returned via DeviceManagerCallback onReaderInfoReceived.
Sample Code¶
DeviceManager.getInstance().getReaderInfo();
getSleepTime¶
Method Signature¶
public void getSleepTime()
Description¶
Retrieves sleep time. Result is returned via DeviceManagerCallback onSleepSettingReceived.
Sample Code¶
DeviceManager.getInstance().getSleepTime();
setSleepTime¶
Method Signature¶
public void setSleepTime(@IntRange(from = 0, to = 255)int sleepTime)
Parameters¶
Parameter |
Type |
Description |
sleepTime |
int |
Sleep time |
Description¶
Sets the sleep time.
Sample Code¶
DeviceManager.getInstance().setSleepTime(60);
getSleepBeep¶
Method Signature¶
public void getSleepBeep()
Description¶
Retrieves whether sleep function is enabled. Result is returned via DeviceManagerCallback onSleepSettingReceived.
Sample Code¶
DeviceManager.getInstance().getSleepBeep();
setSleepBeep¶
Method Signature¶
public void setSleepBeep(boolean isSleepBeepOn)
Parameters¶
Parameter |
Type |
Description |
isSleepBeepOn |
boolean |
Sleep function On/Off |
Description¶
Sets whether the sleep function is enabled.
Sample Code¶
DeviceManager.getInstance().setSleepBeep(true);
getSleepTimeAndBeep¶
Method Signature¶
public void getSleepTimeAndBeep()
Description¶
Retrieves both sleep time and sleep function setting. Result is returned via DeviceManagerCallback onSleepSettingReceived.
Sample Code¶
DeviceManager.getInstance().getSleepTimeAndBeep();
setSleepTimeAndBeep¶
Method Signature¶
public void setSleepTimeAndBeep(@IntRange(from = 0, to = 255)int sleepTime, boolean isSleepBeepOn)
Parameters¶
Parameter |
Type |
Description |
sleepTime |
int |
Sleep time |
isSleepBeepOn |
boolean |
Sleep function On/Off |
Description¶
Sets both sleep time and sleep function.
Sample Code¶
DeviceManager.getInstance().setSleepTimeAndBeep(60,true);
setHIDMode¶
Method Signature¶
public void setHIDMode(boolean enable)
Parameters¶
Parameter |
Type |
Description |
enable |
boolean |
HID mode setting |
Description¶
Sets whether HID mode is used.
Sample Code¶
DeviceManager.getInstance().setHIDMode(false);
getHIDMode¶
Method Signature¶
public void getHIDMode()
Parameters¶
Parameter |
Type |
Description |
enable |
boolean |
HID mode |
Description¶
Retrieves whether HID mode is used. Result is returned via DeviceManagerCallback onHIDModeReceived.
Sample Code¶
DeviceManager.getInstance().setHIDMode(false);