# Callback List
## ON_CONNECT
Returns the connection result via callback.
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - result
- bool
- Connection result
true: Connected
false: Disconnected
```
### Sample Code
```dart
// (Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class)
if(asreaderSdk4Plugin.ON_CONNECT==methodCall.method){
bool isConnected = methodCall.arguments['result'];
}
```
## ON_BATTERY_STATE_RECEIVED
Returns the battery level via callback.
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - result
- int
- Battery level (in %)
```
### Sample Code
```dart
// (Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class)
if(asreaderM24DPlugin.ON_BATTERY_STATE_RECEIVED==methodCall.method){
int battery = methodCall.arguments['result'];
}
```
## ON_TRIGGER_EVENT_RECEIVED
Callback for trigger key press events.
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - result
- int
- See [DeviceTriggerEvent](enum.md#devicetriggerevent)
```
### Sample Code
```dart
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderSdk4Plugin.ON_TRIGGER_EVENT_RECEIVED==methodCall.method){
int event = methodCall.arguments['result'];
DeviceTriggerEvent deviceTriggerEvent = DeviceTriggerEvent.values[event];
// See [DeviceTriggerEvent](enum.md#devicetriggerevent)
}
```
## ON_READER_INFO_RECEIVED
Callback for AsReader connection information.
When calling the [getReaderInfo](methods.md#getreaderinfo) method, this callback method receives the AsReader connection information.
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - KeyInfo_ModelName
- String
- AsReader model name
* - KeyInfo_HardwareVersion
- String
- AsReader hardware version
* - KeyInfo_FirmwareVersion
- String
- AsReader firmware version
```
### Sample Code
```dart
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_READER_INFO_RECEIVED==methodCall.method){
String model = methodCall.arguments['KeyInfo_ModelName'];
String hwv = methodCall.arguments['KeyInfo_HardwareVersion'];
String fwv = methodCall.arguments['KeyInfo_FirmwareVersion'];
}
```
## ON_SET_READER_SETTING_SUCCESS
Callback for the information of the connected AsReader.
When calling the [setReaderSettings](methods.md#setreadersettings) method,
this callback method receives the AsReader connection information.
### Sample Code
```dart
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_SET_READER_SETTING_SUCCESS==methodCall.method){
}
```
## ON_READER_SETTING_RECEIVED
Callback for the settings information of the connected AsReader.
When calling the [getReaderSettings](methods.md#getreadersettings) method,
this callback method receives the AsReader connection information.
### Sample Code
```dart
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_READER_SETTING_RECEIVED==methodCall.method){
}
```
## ON_SLEEP_SETTING_RECEIVED
Callback for the AsReader sleep settings.
When calling the [getSleepTimeAndBeep](methods.md#getsleeptimeandbeep),
[getSleepTime](methods.md#getsleeptime), or
[getSleepBeep](methods.md#getsleepbeep) methods, this callback method receives the AsReader sleep information.
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - KeyParameter_SleepTime
- String
- Sleep time
* - KeyParameter_SleepBeep
- String
- Sleep function On/Off true:On false:Off
```
### Sample Code
```dart
//(注:asreaderM24DPluginはAsreaderM24dPluginクラスのインスタンスオブジェクト)
if(asreaderM24DPlugin.ONSLEEPSETTINGRECEIVED==methodCall.method){
StringsleepTime=methodCall.arguments['KeyParameter_SleepTime'];
StringsleepBeep=methodCall.arguments['KeyParameter_SleepBeep'];
}
```
## ON_HID_MODE_RECEIVED
Callback for HID mode information.
When calling the [getHIDMode](methods.md#gethidmode) method,
this callback method receives the HID mode information.
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - result
- int
- See [HIDType](enum.md#hidtype)
```
### Sample Code
```dart
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_HID_MODE_RECEIVED==methodCall.method){
int result = methodCall.arguments[result];
HIDType hidType = HIDType.values[result]; // See [HIDType](enum.md#hidtype)
}
```
## ON_DEVICE_MANAGER_ERROR
Callback for AsReader error information.
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - result
- int
- See [ErrorCode](enum.md#errorcode)
```
### Sample Code
```dart
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_DEVICE_MANAGER_ERROR==methodCall.method){
int result = methodCall.arguments['result'];
ErrorCode errorCode = ErrorCode.values[result]; // See [ErrorCode](enum.md#errorcode)
}
```
## ON_RECEIVED_BARCODE_DECODE_DATA
Callback for barcode decoding results.
This callback method receives the barcode decoding results when calling
[startDecode](methods.md#startdecode) or
[startDecodeWithCountTime](methods.md#startdecodewithcounttime).
### Parameters
```{list-table}
:align: left
:class: list-table
* - Argument Name
- Type
- Description
* - Key_ParameterSymbol
- String
- CodeID
* - decodeData
- String
- Barcode data
```
### Sample Code
```dart
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_RECEIVED_BARCODE_DECODE_DATA==methodCall.method){
String decodeData = methodCall.arguments['decodeData']; // Barcode data
Map parameter = {};
Map