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.

- (void)receivedBarcodeData:(NSData *)data;

Parameters

Name

Type

Description

data

NSData

Barcode data


receiveFactoryReset

Receives the result of the barcode module factory reset.
Called after executing doFactoryReset.

- (void)receiveFactoryReset:(int)status;

Parameters

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:

- (void)receivedBypassPayload:(NSData *)rawData;

Parameters

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

- (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.

- (void)receivedCodeID:(int)codeID;

Parameters

Name

Type

Description

codeID

int

The CodeID data


receivedOCR

Returns the OCR type status.
Called after executing getOCR.

- (void)receivedOCR:(BOOL)isNone isOCRAon:(BOOL)isOCRAon isOCRBon:(BOOL)isOCRBon;

Parameters

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.

- (void)receivedHID:(BOOL)hidOn iOShidOn:(BOOL)iOShidOn;

Parameters

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.

- (void)receivedPresentationMode:(BOOL)isOn;

Parameters

Name

Type

Description

isOn

BOOL

Presentation mode status (YES: On, NO: Off)


receivedSleepBeep

Returns sleep setting data.
Called after executing setSleepBeep and setSleepTime.

- (void)receivedSleepBeep:(NSData *)data;

Parameters

Name

Type

Description

data

NSData

Sleep setting data


receivedSymbologies

Returns the barcode symbology settings status.
Called after executing getSymbologies.

- (void)receivedSymbologies:(NSDictionary *)symbols;

Parameters

Name

Type

Description

symbols

NSDictionary

Barcode symbology settings status


receivedGetAutoLaunch

Returns the auto-launch status of the presentation app.
Called after executing getAutoLaunch.

- (void)receivedGetAutoLaunch:(BOOL)isOn data:(NSString *)data;

Parameters

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.

- (void)receivedBarcodeSecurity:(NSDictionary *)security;

Parameters

Name

Type

Description

security

NSDictionary

Security setting data


didGetSleepBuzzerReceived:

Returns the result via callback after executing getSleepBuzzer.

⚠️ Note This method is supported only on ASR-025S.

- (void)didGetSleepBuzzerReceived:(int)sleepBuzzer;

Parameters

Name

Type

Description

sleepBuzzer

int

The buzzer status of automatic shutdown 0: On, Except for 0: Off

Sample Code

- (void)didGetSleepBuzzerReceived:(int)sleepBuzzer{
    //sleepBuzzer: The buzzer status of automatic shutdown
}

didSetSleepBuzzer:

Returns the result via callback after executing setSleepBuzzer.

⚠️ Note This method is supported only on ASR-025S.

- (void)didSetSleepBuzzer:(int)status;

Parameters

Name

Type

Description

status

int

Setting result
0: Success
Non-zero: Failure

Sample Code

- (void)didSetSleepBuzzer:(int)status{
    // status: 0 = success, non-zero = failure
}

didGetAutoOffTimeReceived:

Returns the result via callback after executing getAutoOffTime.

⚠️ Note This method is supported only on ASR-025S.

- (void)didGetAutoOffTimeReceived:(int)time;

Parameters

Name

Type

Description

time

int

The auto off time of AsReader

Sample Code

- (void)didGetAutoOffTimeReceived:(int)time{
    // time: The auto off time of AsReader
}

didSetAutoOffTime:

Returns the result via callback after executing setAutoOffTime.

⚠️ Note This method is supported only on ASR-025S.

- (void)didSetAutoOffTime:(int)status;

Parameters

Name

Type

Description

status

int

Setting result 0: Success Non-zero: Failure

Sample Code

- (void)didSetAutoOffTime:(int)status{
    // status: 0 = success, non-zero = failure
}

didGetBarcodeTimeOutReceived:

Returns the result via callback after executing getBarcodeTimeOut.

⚠️ Note This method is supported only on ASR-025S.

- (void)didGetBarcodeTimeOutReceived:(int)barcodeTimeOut;

Parameters

Name

Type

Description

barcodeTimeOut

int

Scanning timeout

Sample Code

- (void)didGetBarcodeTimeOutReceived:(int)barcodeTimeOut{
    //barcodeTimeOut: Scanning timeout
}

didSetBarcodeTimeOut:

Returns the result via callback after executing setBarcodeTimeOut.

⚠️ Note This method is supported only on ASR-025S.

- (void)didSetBarcodeTimeOut:(int)status;

Parameters

Name

Type

Description

status

int

Setting result
0: Success
Non-zero: Failure

Sample Code

- (void)didSetBarcodeTimeOut:(int)status{
    // status: 0 = success, non-zero = failure
}

receivedScanBarcodeData:

Receives the scanned barcode data. Called after executing startScan.

⚠️ Note This method is supported only on ASR-025S.

- (void)receivedScanBarcodeData:(NSData *)barcodeData barcodeType:(AsReader025SBarcodeType)barcodeType;

Parameters

Name

Type

Description

barcodeData

NSData

The scanned barcode data

barcodeType

AsReader025SBarcodeType

The scanned barcode type AsReader025SBarcodeType

Sample Code

- (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

- (void)barcodeDataReceived:(NSData *)data;