DeviceManagerCallback

onConnect

Method Signature

void onConnect(boolean isConnect) 

Parameters

Parameter

Type

Description

isConnect

boolean

Connection result
true: connected
false: disconnected

Description

Callback for the connection result.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onConnect(boolean isConnect) { 
         // isConnect: true if the device is connected, false if disconnected.
     } 
});

onBatteryStateReceived

Method Signature

void onBatteryStateReceived(final int battery) 

Parameters

Parameter

Type

Description

battery

int

Battery level in percentage

Description

Callback for the battery level.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onBatteryStateReceived(final int battery){ 
        // battery: Battery level as a percentage.
     }  
});

onTriggerEventReceived

Method Signature

void onTriggerEventReceived(DeviceConst.DeviceTriggerEvent event) 

Parameters

Parameter

Type

Description

event

DeviceConst.DeviceTriggerEvent

DeviceConst.DeviceTriggerEvent

Description

Callback for hardware trigger key events.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onTriggerEventReceived(DeviceConst.DeviceTriggerEvent event) { 
         // event: Trigger action event.  
     } 
});

onReaderInfoReceived

Method Signature

default void onReaderInfoReceived(Map<String, String> info) 

Parameters

Parameter

Type

Description

info

Map<String, String>

AsReader information

Description

Callback for AsReader connection information. Invoked after successful call to getReaderInfo.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onReaderInfoReceived(Map<String, String> info){ 
         // info: Map containing each retrieved value.
     } 
});

onSetReaderSettingSuccess

Method Signature

default void onSetReaderSettingSuccess() 

Description

Callback invoked after successfully setting AsReader configuration via setReaderSettings.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onSetReaderSettingSuccess() { 
         // Settings applied successfully
     } 
});

onReaderSettingReceived

Method Signature

default void onReaderSettingReceived(Map<String, Boolean> settingParamMap) 

Parameters

Parameter

Type

Description

settingParamMap

Map<String, Boolean>

AsReader configuration information

Description

Callback for the connected AsReader’s configuration. Invoked after successful call to getReaderSettings.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onReaderSettingReceived(Map<String, Boolean> settingParamMap){ 
         // settingParamMap: Map containing each configuration value.
     } 
});

onSleepSettingReceived

Method Signature

default void onSleepSettingReceived(Map<String, String> sleepParamMap) 

Parameters

Parameter

Type

Description

sleepParamMap

Map<String, String>

AsReader sleep information

Description

Callback for AsReader sleep settings. Invoked after successful sleep-related commands.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onSleepSettingReceived(Map<String, String> sleepParamMap) { 
         // sleepParamMap: Map containing sleep settings.
     } 
});

onHIDModeReceived

Method Signature

default void onHIDModeReceived(DeviceConst.HIDType hidType) 

Parameters

Parameter

Type

Description

hidType

DeviceConst.HIDType

DeviceConst.HIDType

Description

Callback for HID mode information. Invoked after successful call to getHIDMode.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onHIDModeReceived(DeviceConst.HIDType hidType){ 
         // hidType: HID_ON if on, HID_OFF if off, NOT_APPLICABLE if device does not support HID.
     } 
});

onDeviceManagerError

Method Signature

void onDeviceManagerError(AsReaderError.ErrorCode code) 

Parameters

Parameter

Type

Description

code

AsReaderError.ErrorCode

AsReaderError.ErrorCode

Description

Callback for AsReader error information.

Sample Code

DeviceManager.getInstance().setCallback(new DeviceManagerCallback() { 
     @Override 
     public void onDeviceManagerError(AsReaderError.ErrorCode code){ 
         // code: Error code. 
     } 
});