# 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 objectMap = methodCall.arguments; Iterable 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 } } ```
## ON_RECEIVED_BARCODE_DECODE_DATABYTE 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 * - result - Uint8List - Barcode data ``` ### Sample Code ```dart // 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 } ```
## 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](methods.md#getstopcondition) [factoryDefault](methods.md#factorydefault) [setBarcodeSettings](methods.md#setbarcodesettings) [getBarcodeSettings](methods.md#getbarcodesettings) [setSymbologyAllEnable](methods.md#setsymbologyallenable) [setSymbologySettings](methods.md#setsymbologysettings) [setSymbologyListSettings](methods.md#setsymbologylistsettings) [setOCRListSettings](methods.md#setocrlistsettings) [getSymbologySettings](methods.md#getsymbologysettings) [getSymbologySettingsList](methods.md#getsymbologysettingslist) [getOCRSettings](methods.md#getocrsettings) [getOCRSettingsList](methods.md#getocrsettingslist) [getNotisEditing](methods.md#getnotisediting) [getPresentationMode](methods.md#getpresentationmode) ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - type - int - See [BarcodeCommandAction](enum.md#barcodecommandaction) * - result - BarcodeResult object - See [BarcodeResult](barcode_result.md#id1) ``` ### Sample Code ```dart // 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 barcodeResultMap = {}; Map objectMap = methodCall.arguments['result']; Iterable 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 symbologyInfoModelList = []; if(barcodeResultMap['getSymbologyInfoArray'] is List){ List array = barcodeResultMap['getSymbologyInfoArray'] as List; for(Object? object in array){ Map symbologyInfoModelMap = {}; Map map = object as Map; Iterable 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) } ```
## 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 ```dart // Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class if(asreaderSdk4Plugin.ON_BARCODE_MANAGER_STAND_BY_READY==methodCall.method){ } ```
## ON_BARCODE_MANAGER_ERROR Callbacks error information. ### Parameters ```{list-table} :align: left :class: list-table * - Parameter Name - Type - Description * - result - String - Error information ``` ### Sample Code ```dart // Note: asreaderM24DPlugin is an instance object of the AsreaderM24dPlugin class if(asreaderSdk4Plugin.ON_BARCODE_MANAGER_ERROR==methodCall.method){ String error = methodCall.arguments['result']; } ```