# AsreaderBarcodeDeviceDelegate > **⚠️ Note:** > These delegate methods are called only when the AsReader device is properly connected and the corresponding methods (e.g., `getCodeID`, `getOCR`, etc.) have been invoked. > Callbacks will not occur if the device is unsupported or not connected. --- ## `receivedBarcodeData` Called when barcode data is received. This is called after executing [`startScan`](./3_AsReaderBarcodeDevice.md#startscan-numberoftags-readuntilinsec). ```objectivec - (void)receivedBarcodeData:(NSData *)data; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `data` - NSData - Barcode data ``` --- ## `receiveFactoryReset` Receives the result of the barcode module factory reset. Called after executing [`doFactoryReset`](3_AsReaderBarcodeDevice.md#dofactoryreset). ```objectivec - (void)receiveFactoryReset:(int)status; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `status` - int - Reset start (0x00), reset complete (0xFF) ``` --- ## `receivedBypassPayload` Callback for results of certain bypass configuration commands. Called in response to the following methods: - [`setCustomPrefix`](./3_AsReaderBarcodeDevice.md#setcustomprefix) - [`setDisableCustomPrefix`](./3_AsReaderBarcodeDevice.md#setdisablecustomprefix) - [`setCustomSuffix:`](./3_AsReaderBarcodeDevice.md#setcustomsuffix) - [`setDisableCustomSuffix`](./3_AsReaderBarcodeDevice.md#setdisablecustomsuffix) - [`setDisableSymbologyPrefix`](./3_AsReaderBarcodeDevice.md#setdisablesymbologyprefix) - [`setBarcodeEngineUserCommand:`](./3_AsReaderBarcodeDevice.md#setbarcodeengineusercommand) ```objectivec - (void)receivedBypassPayload:(NSData *)rawData; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `rawData` - NSData - The command response data returned from the device. ``` ### Notes - The contents of the received data (`rawData`) depend on the command sent. - Binary parsing according to each method's specification is required for analysis. ### Sample Code ```objectivec - (void)receivedBypassPayload:(NSData *)rawData { const uint8_t *bytes = (const uint8_t *)[rawData bytes]; NSUInteger length = rawData.length; NSLog(@"Received Bypass Payload (%lu bytes):", (unsigned long)length); for (NSUInteger i = 0; i < length; i++) { NSLog(@"Byte %lu: 0x%02X", (unsigned long)i, bytes[i]); } // Add data parsing here as needed } ``` --- ## `receivedCodeID` Returns the CodeID type. Called after executing [`getCodeID`](3_AsReaderBarcodeDevice.md#getcodeid). ```objectivec - (void)receivedCodeID:(int)codeID; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `codeID` - int - The CodeID data ``` --- ## `receivedOCR` Returns the OCR type status. Called after executing [`getOCR`](3_AsReaderBarcodeDevice.md#getocr). ```objectivec - (void)receivedOCR:(BOOL)isNone isOCRAon:(BOOL)isOCRAon isOCRBon:(BOOL)isOCRBon; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `isNone` - BOOL - No OCR function (YES) / has OCR (NO) * - `isOCRAon` - BOOL - OCR-A enabled (YES) / disabled (NO) * - `isOCRBon` - BOOL - OCR-B enabled (YES) / disabled (NO) ``` --- ## `receivedHID` Returns the HID mode status. Called after executing [`getHID`](3_AsReaderBarcodeDevice.md#gethid). ```objectivec - (void)receivedHID:(BOOL)hidOn iOShidOn:(BOOL)iOShidOn; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `hidOn` - BOOL - HID mode status (YES: On, NO: Off) * - `iOShidOn` - BOOL - Supported platform (YES: iOS, NO: Android) ``` --- ## `receivedPresentationMode` Returns the presentation mode status. Called after executing [`getPresentationMode`](3_AsReaderBarcodeDevice.md#getpresentationmode). ```objectivec - (void)receivedPresentationMode:(BOOL)isOn; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `isOn` - BOOL - Presentation mode status (YES: On, NO: Off) ``` --- ## `receivedSleepBeep` Returns sleep setting data. Called after executing [`setSleepBeep`](../common/common/2_AsReaderDevice.md#setsleepbeep) and [`setSleepTime`](../common/common/2_AsReaderDevice.md#setsleeptime). ```objectivec - (void)receivedSleepBeep:(NSData *)data; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `data` - NSData - Sleep setting data ``` --- ## `receivedSymbologies` Returns the barcode symbology settings status. Called after executing [`getSymbologies`](3_AsReaderBarcodeDevice.md#getsymbologies). ```objectivec - (void)receivedSymbologies:(NSDictionary *)symbols; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `symbols` - NSDictionary - Barcode symbology settings status ``` --- ## `receivedGetAutoLaunch` Returns the auto-launch status of the presentation app. Called after executing [`getAutoLaunch`](../common/common/2_AsReaderDevice.md#getautolaunch). ```objectivec - (void)receivedGetAutoLaunch:(BOOL)isOn data:(NSString *)data; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `isOn` - BOOL - Auto-launch status (YES: On, NO: Off) * - `data` - NSString - Target bundleId for launch ``` --- ## `receivedBarcodeSecurity` Returns the barcode security level. Called after executing [`getSecurity`](3_AsReaderBarcodeDevice.md#getsecurity). ```objectivec - (void)receivedBarcodeSecurity:(NSDictionary *)security; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `security` - NSDictionary - Security setting data ``` --- ## `didGetSleepBuzzerReceived:` Returns the result via callback after executing [`getSleepBuzzer`](./3_AsReaderBarcodeDevice.md#getsleepbuzzer). > ⚠️ **Note** > This method is supported only on **ASR-025S**. ```objectivec - (void)didGetSleepBuzzerReceived:(int)sleepBuzzer; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - sleepBuzzer - int - The buzzer status of automatic shutdown 0: On, Except for 0: Off ``` ### Sample Code ```objectivec - (void)didGetSleepBuzzerReceived:(int)sleepBuzzer{ //sleepBuzzer: The buzzer status of automatic shutdown } ``` --- ## `didSetSleepBuzzer:` Returns the result via callback after executing [`setSleepBuzzer`](./3_AsReaderBarcodeDevice.md#setsleepbuzzer). > ⚠️ **Note** > This method is supported only on **ASR-025S**. ```objectivec - (void)didSetSleepBuzzer:(int)status; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - status - int - Setting result 0: Success Non-zero: Failure ``` ### Sample Code ```objectivec - (void)didSetSleepBuzzer:(int)status{ // status: 0 = success, non-zero = failure } ``` --- ## `didGetAutoOffTimeReceived:` Returns the result via callback after executing [`getAutoOffTime`](./3_AsReaderBarcodeDevice.md#getautoofftime). > ⚠️ **Note** > This method is supported only on **ASR-025S**. ```objectivec - (void)didGetAutoOffTimeReceived:(int)time; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - time - int - The auto off time of AsReader ``` ### Sample Code ```objectivec - (void)didGetAutoOffTimeReceived:(int)time{ // time: The auto off time of AsReader } ``` --- ## `didSetAutoOffTime:` Returns the result via callback after executing [`setAutoOffTime`](./3_AsReaderBarcodeDevice.md#setautoofftime). > ⚠️ **Note** > This method is supported only on **ASR-025S**. ```objectivec - (void)didSetAutoOffTime:(int)status; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - status - int - Setting result 0: Success Non-zero: Failure ``` ### Sample Code ```objectivec - (void)didSetAutoOffTime:(int)status{ // status: 0 = success, non-zero = failure } ``` --- ## `didGetBarcodeTimeOutReceived:` Returns the result via callback after executing [`getBarcodeTimeOut`](./3_AsReaderBarcodeDevice.md#getbarcodetimeout). > ⚠️ **Note** > This method is supported only on **ASR-025S**. ```objectivec - (void)didGetBarcodeTimeOutReceived:(int)barcodeTimeOut; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - barcodeTimeOut - int - Scanning timeout ``` ### Sample Code ```objectivec - (void)didGetBarcodeTimeOutReceived:(int)barcodeTimeOut{ //barcodeTimeOut: Scanning timeout } ``` --- ## `didSetBarcodeTimeOut:` Returns the result via callback after executing [`setBarcodeTimeOut`](./3_AsReaderBarcodeDevice.md#setbarcodetimeout). > ⚠️ **Note** > This method is supported only on **ASR-025S**. ```objectivec - (void)didSetBarcodeTimeOut:(int)status; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - status - int - Setting result 0: Success Non-zero: Failure ``` ### Sample Code ```objectivec - (void)didSetBarcodeTimeOut:(int)status{ // status: 0 = success, non-zero = failure } ``` --- ## `receivedScanBarcodeData:` Receives the scanned barcode data. Called after executing [`startScan`](./3_AsReaderBarcodeDevice.md#startscan). > ⚠️ **Note** > This method is supported only on **ASR-025S**. ```objectivec - (void)receivedScanBarcodeData:(NSData *)barcodeData barcodeType:(AsReader025SBarcodeType)barcodeType; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - barcodeData - NSData - The scanned barcode data * - barcodeType - AsReader025SBarcodeType - The scanned barcode type [`AsReader025SBarcodeType`](../common/enum/12_AsReaderInfoDefine.md#asreader025sbarcodetype) ``` ### Sample Code ```objectivec - (void)receivedScanBarcodeData:(NSData *)barcodeData barcodeType:(AsReader025SBarcodeType)barcodeType{ //barcodeData: The scanned barcode data //barcodeType: The scanned barcode type } ``` ## Deprecated Methods List The following methods are currently deprecated. **They may be removed in the future, so please avoid using them in new development.** Use alternatives if available. --- ### ⚠️ `barcodeDataReceived` [Deprecated] Sets the trigger mode. Alternative: [`receivedBarcodeData`](#receivedbarcodedata) ```objectivec - (void)barcodeDataReceived:(NSData *)data; ``` ```