3. Callback List¶
3.1. ON_CONNECT¶
Returns the connection result via callback.
Parameters¶
Argument Name |
Type |
Description |
result |
bool |
Connection result |
Sample Code¶
// (Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class)
if(asreaderSdk4Plugin.ON_CONNECT==methodCall.method){
bool isConnected = methodCall.arguments['result'];
}
3.2. ON_BATTERY_STATE_RECEIVED¶
Returns the battery level via callback.
Parameters¶
Argument Name |
Type |
Description |
result |
int |
Battery level (in %) |
Sample Code¶
// (Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class)
if(asreaderM24DPlugin.ON_BATTERY_STATE_RECEIVED==methodCall.method){
int battery = methodCall.arguments['result'];
}
3.3. ON_TRIGGER_EVENT_RECEIVED¶
Callback for trigger key press events.
Parameters¶
Argument Name |
Type |
Description |
result |
int |
Sample Code¶
// 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)
}
3.4. ON_READER_INFO_RECEIVED¶
Callback for AsReader connection information.
When calling the getReaderInfo method, this callback method receives the AsReader connection information.
Parameters¶
Argument Name |
Type |
Description |
KeyInfo_ModelName |
String |
AsReader model name |
KeyInfo_HardwareVersion |
String |
AsReader hardware version |
KeyInfo_FirmwareVersion |
String |
AsReader firmware version |
Sample Code¶
// 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'];
}
3.5. ON_SET_READER_SETTING_SUCCESS¶
Callback for the information of the connected AsReader.
When calling the setReaderSettings method,
this callback method receives the AsReader connection information.
Sample Code¶
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_SET_READER_SETTING_SUCCESS==methodCall.method){
}
3.6. ON_READER_SETTING_RECEIVED¶
Callback for the settings information of the connected AsReader.
When calling the getReaderSettings method,
this callback method receives the AsReader connection information.
Sample Code¶
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_READER_SETTING_RECEIVED==methodCall.method){
}
3.7. ON_SLEEP_SETTING_RECEIVED¶
Callback for the AsReader sleep settings.
When calling the getSleepTimeAndBeep,
getSleepTime, or
getSleepBeep methods, this callback method receives the AsReader sleep information.
Parameters¶
Argument Name |
Type |
Description |
KeyParameter_SleepTime |
String |
Sleep time |
KeyParameter_SleepBeep |
String |
Sleep function On/Off true:On false:Off |
Sample Code¶
//(注:asreaderM24DPluginはAsreaderM24dPluginクラスのインスタンスオブジェクト)
if(asreaderM24DPlugin.ONSLEEPSETTINGRECEIVED==methodCall.method){
StringsleepTime=methodCall.arguments['KeyParameter_SleepTime'];
StringsleepBeep=methodCall.arguments['KeyParameter_SleepBeep'];
}
3.8. ON_HID_MODE_RECEIVED¶
Callback for HID mode information.
When calling the getHIDMode method,
this callback method receives the HID mode information.
Parameters¶
Argument Name |
Type |
Description |
result |
int |
See HIDType |
Sample Code¶
// 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)
}
3.9. ON_DEVICE_MANAGER_ERROR¶
Callback for AsReader error information.
Parameters¶
Argument Name |
Type |
Description |
result |
int |
See ErrorCode |
Sample Code¶
// 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)
}
3.10. ON_RECEIVED_BARCODE_DECODE_DATA¶
Callback for barcode decoding results.
This callback method receives the barcode decoding results when calling
startDecode or
startDecodeWithCountTime.
Parameters¶
Argument Name |
Type |
Description |
Key_ParameterSymbol |
String |
CodeID |
decodeData |
String |
Barcode data |
Sample Code¶
// 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<String,String> parameter = {};
Map<Object?,Object?> objectMap = methodCall.arguments;
Iterable<Object?> keys = objectMap.keys;
for(Object? key in keys){
parameter[key.toString()] = objectMap[key]!.toString();
}
String codeID = "";
if(parameter.containsKey('Key_ParameterSymbol')){
codeID = parameter['Key_ParameterSymbol']!; // CodeID
}
}
3.11. ON_RECEIVED_BARCODE_DECODE_DATABYTE¶
Callback for barcode decoding results.
This callback method receives the barcode decoding results when calling
startDecode or startDecodeWithCountTime.
Parameters¶
Argument Name |
Type |
Description |
result |
Uint8List |
Barcode data |
Sample Code¶
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_RECEIVED_BARCODE_DECODE_DATABYTE==methodCall.method){
Uint8List byteData = methodCall.arguments['result']; // Barcode data
}
3.12. ON_RECEIVED_RESPONSE¶
Callbacks the result of a command execution.
When calling the following methods, this callback method receives the result of the command sent:
getStopCondition
factoryDefault
setBarcodeSettings
getBarcodeSettings
setSymbologyAllEnable
setSymbologySettings
setSymbologyListSettings
setOCRListSettings
getSymbologySettings
getSymbologySettingsList
getOCRSettings
getOCRSettingsList
getNotisEditing
getPresentationMode
Parameters¶
Name |
Type |
Description |
type |
int |
|
result |
BarcodeResult object |
See BarcodeResult |
Sample Code¶
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderM24DPlugin.ON_RECEIVED_RESPONSE==methodCall.method){
int type = methodCall.arguments['type'];
BarcodeCommandAction barcodeCommandAction = BarcodeCommandAction.values[type]; // See [BarcodeCommandAction](enum.md#barcodecommandaction)
Map<String?, Object?> barcodeResultMap = {};
Map<Object?, Object?> objectMap = methodCall.arguments['result'];
Iterable<Object?> keys = objectMap.keys;
for(Object? key in keys){
barcodeResultMap[key.toString()] = objectMap[key];
}
int statusInt = barcodeResultMap['getStatus'] as int;
Status status = Status.values[statusInt];
int resultInt = barcodeResultMap['getResult'] as int;
Result result = Result.values[resultInt];
String message = barcodeResultMap['getMessage'] as String;
List<SymbologyInfoModel> symbologyInfoModelList = [];
if(barcodeResultMap['getSymbologyInfoArray'] is List<Object?>){
List<Object?> array = barcodeResultMap['getSymbologyInfoArray'] as List<Object?>;
for(Object? object in array){
Map<String?, Object?> symbologyInfoModelMap = {};
Map<Object?, Object?> map = object as Map<Object?, Object?>;
Iterable<Object?> keys = map.keys;
for(Object? key in keys){
symbologyInfoModelMap[key.toString()] = map[key];
}
int symbologInt = symbologyInfoModelMap["symbology"] as int;
Symbology symbology = Symbology.values[symbologInt];
bool isEnableStatus = symbologyInfoModelMap["isEnableStatus"] as bool;
SymbologyInfoModel symbologyInfoModel = SymbologyInfoModel(symbology, isEnableStatus);
symbologyInfoModelList.add(symbologyInfoModel);
}
}
BarcodeResult barcodeResult = BarcodeResult(status, result, message, symbologyInfoModelList); // See BarcodeResult(5)
}
3.13. ON_BARCODE_MANAGER_STAND_BY_READY¶
Callbacks AsReader information.
This method is called when the connection to AsReader is established and the information retrieval is completed.
Sample Code¶
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderSdk4Plugin.ON_BARCODE_MANAGER_STAND_BY_READY==methodCall.method){
}
3.14. ON_BARCODE_MANAGER_ERROR¶
Callbacks error information.
Parameters¶
Parameter Name |
Type |
Description |
result |
String |
Error information |
Sample Code¶
// Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class
if(asreaderSdk4Plugin.ON_BARCODE_MANAGER_ERROR==methodCall.method){
String error = methodCall.arguments['result'];
}