AsReaderBarcodeDevice

sharedInstance

Gets the singleton instance of AsReaderBarcodeDevice.
Use this to share a single instance across the entire app.

+ (instancetype)sharedInstance;

Return Value

Type

Description

instancetype

Instance object of the AsReaderBarcodeDevice class

Sample Code

AsReaderBarcodeDevice *asReaderBarcodeDevice = [AsReaderBarcodeDevice sharedInstance];

startScan

Starts barcode scanning.
Specify the maximum number of barcodes to read and the maximum scan duration (in seconds) to start scanning.
After calling this method, the results are returned via the following callback methods:

- (BOOL)startScan:(uint8_t)numberOfTags readUntilInSec:(uint8_t)readUntilInSec;

Parameters

Name

Type

Description

numberOfTags

uint8_t

Maximum number of barcodes to read.
0x00: Scan one barcode and stop.
0x01 to 0xFE: Read the specified number of barcodes
(e.g., 0x05 → 5 barcodes).
0xFF: Continuous scanning until manually stopped.

Recommended usage is typically up to 10-20 barcodes. Specifying too many may take longer.

readUntilInSec

uint8_t

Maximum scan duration (seconds).
0x00: Stop scan immediately according to numberOfTags.
0x01 to 0xFE: Scan for the specified number of seconds
(e.g., 0x10 → 16 seconds).
0xFF: Continuous scanning until manually stopped.

Typically, 5 to 30 seconds is recommended.

Notes

  • Normally, setting both numberOfTags and readUntilInSec to 0x00 will scan one barcode and stop immediately.

  • To scan more barcodes, it is recommended to change only one of the two parameters.

  • If 0xFF is specified, scanning continues until manually stopped.

Return Value

Type

Description

BOOL

YES: Scan started successfully.
NO: Failed to start scan.

Sample Code

BOOL status = [asReaderDevice startScan:0 readUntilInSec:0];
if (status) {
    // Scan started successfully
} else {
    // Failed to start scan
}

stopScan

Stops barcode scanning.
Use this to stop scanning started by startScan.

- (BOOL)stopScan;

Return Value

Type

Description

BOOL

YES: Successfully stopped scanning.
NO: Failed to stop scanning.

Sample Code

BOOL status = [asReaderDevice stopScan];
if (status) {
    // Successfully executed the method
} else {
    // Failed to execute the method
}

doFactoryReset

Resets the barcode module settings to factory defaults.
Use this when you want to restore initial settings.
After calling this method, the result is returned via the receiveFactoryReset callback.

⚠️ Note
This method is supported only on ASR-230D, ASR-0231D, ASR-0240D, ASR-022D models.

- (BOOL)doFactoryReset;

Return Value

Type

Description

BOOL

YES: Reset succeeded.
NO: Reset failed.

Usage Example

BOOL status = [asReaderDevice doFactoryReset];
if (status) {
    // Reset succeeded
} else {
    // Reset failed
}

sendBarcodeSettingData:

Sends barcode setting commands to the device.
Mainly used when changing scanner settings.

- (BOOL)sendBarcodeSettingData:(NSData*)sendData;

Parameters

Name

Type

Description

sendData

NSData *

Barcode setting data to send

Return Value

Type

Description

BOOL

YES: Send succeeded.
NO: Send failed.

Usage Example

BOOL status = [asReaderDevice sendBarcodeSettingData:data];
if (status) {
    // Setting sent successfully
} else {
    // Failed to send setting
}

getSymbologies

Gets the barcode symbologies supported for reading.
After calling this method, the status of barcode symbologies is returned via the callback receivedSymbologies.

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

- (BOOL)getSymbologies;

Return Value

Type

Description

BOOL

YES: Method succeeded.
NO: Method failed.

Sample Code

BOOL status = [asReaderDevice getSymbologies];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

setSymbologyPrefix

Adds a prefix to all read barcodes based on the symbology type.
Use this when you want to identify the barcode type.

⚠️ Note
This feature is supported only on some models such as ASR-0230D, ASR-0240D, ASR-022D.
Calling on unsupported models returns NO.

- (BOOL)setSymbologyPrefix;

Return Value

Type

Description

BOOL

YES: Setting succeeded.
NO: Unsupported model or failed because scanning is in progress.

Usage Example

BOOL status = [asReaderDevice setSymbologyPrefix];
if (status) {
    // Prefix setting succeeded
} else {
    // Unsupported model or scan in progress, failed to set
}

setDisableSymbologyPrefix

Disables the prefix added to barcodes.
Use this to cancel the prefix set by setSymbologyPrefix.

⚠️ Note
This feature is supported only on some models such as ASR-0230D, ASR-0240D, ASR-022D.
Unsupported models or scanning states return NO.

- (BOOL)setDisableSymbologyPrefix;

Return Value

Type

Description

BOOL

YES: Disabled prefix successfully.
NO: Unsupported model or failed due to scanning.

Usage Example

BOOL status = [asReaderDevice setDisableSymbologyPrefix];
if (status) {
    // Prefix disabled successfully
} else {
    // Unsupported model or scan in progress, failed to disable
}

setCustomPrefix:

Sets the same custom prefix for all barcodes.
For details on prefix strings, refer to Lower ASCII Reference Table.

⚠️ Note
This feature is supported only on some models such as ASR-0230D, ASR-0240D, ASR-022D.

- (BOOL)setCustomPrefix:(NSString *)prefix;

Parameters

Name

Type

Description

prefix

NSString *

The prefix string to set

Return Value

Type

Description

BOOL

YES: Setting succeeded.
NO: Setting failed.

Usage Example

BOOL status = [asReaderDevice setCustomPrefix:@"01"];
if (status) {
    // Prefix set successfully
} else {
    // Failed to set prefix
}

setDisableCustomPrefix

Disables (clears) the custom prefix added to barcodes.
Use this to cancel the prefix set by setCustomPrefix:.

⚠️ Note
This feature is supported only on some models such as ASR-0230D, ASR-0240D, ASR-022D.

- (BOOL)setDisableCustomPrefix;

Return Value

Type

Description

BOOL

YES: Successfully disabled.
NO: Failed to disable.

Usage Example

BOOL status = [asReaderDevice setDisableCustomPrefix];
if (status) {
    // Prefix disabled successfully
} else {
    // Failed to disable prefix
}

setCustomSuffix:

Sets the same custom suffix for all barcodes.
For details on suffix strings, refer to Lower ASCII Reference Table.

⚠️ Note
This feature is supported only on some models such as ASR-0230D, ASR-0240D, ASR-022D.

- (BOOL)setCustomSuffix:(NSString *)suffix;

Parameters

Name

Type

Description

suffix

NSString *

The suffix string to set

Return Value

Type

Description

BOOL

YES: Setting succeeded.
NO: Setting failed.

Usage Example

BOOL status = [asReaderDevice setCustomSuffix:@"01"];
if (status) {
    // Suffix set successfully
} else {
    // Failed to set suffix
}

setDisableCustomSuffix

Clears the set suffix.
Use this to cancel the suffix added by setCustomSuffix:.

⚠️ Note
This feature is supported only on some models such as ASR-0230D, ASR-0240D, ASR-022D.

- (BOOL)setDisableCustomSuffix;

Return Value

Type

Description

BOOL

YES: Successfully cleared.
NO: Failed to clear.

Usage Example

BOOL status = [asReaderDevice setDisableCustomSuffix];
if (status) {
    // Suffix cleared successfully
} else {
    // Failed to clear suffix
}

setBarcodeEngineUserCommand:

Sets the barcode module operation via command.
For detailed command specifications, please refer to the barcode setting manual corresponding to your device model.

⚠️ Note
This feature is supported only on some models such as ASR-0230D, 0240D, 022D.

- (BOOL)setBarcodeEngineUserCommand:(NSString *)command;

Parameters

Name

Type

Description

command

NSString *

Command code string (e.g., "BEPPWR1.")

Return Value

Type

Description

BOOL

YES: Success
NO: Failure

Sample Code

BOOL status = [asReaderDevice setBarcodeEngineUserCommand:@"BEPPWR1."];
if (status) {
    // Command sent successfully
} else {
    // Failed to send command
}

setCodeID:isBeepOn:

Sets the Code ID type and beep sound on/off during scanning.

⚠️ Note
This method is supported only on ASR-M24D. It cannot be used on other models.

+ (NSData*)setCodeID:(int)codeID beepOn:(BOOL)isBeepOn;

Parameters

Name

Type

Description

codeID

int

CodeID type (enum)

isBeepOn

BOOL

YES: Beep on, NO: Beep off

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice setCodeID:CODEID_NONE isBeepOn:YES];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

setOCRType:isBeepOn:

Sets the OCR type and beep sound on/off.

⚠️ Note
This method is supported only on ASR-M24D. It cannot be used on other models.

- (BOOL)setOCRType:(OCRType)type isBeepOn:(BOOL)isBeepOn;

Parameters

Name

Type

Description

type

OCRType

OCR type (enum)

isBeepOn

BOOL

YES: Beep on, NO: Beep off

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice setOCRType:OCR_TYPENONE isBeepOn:YES];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

setiOSHIDEnable:

Enables or disables HID mode.

⚠️ Note
This method is supported only on ASR-M24D. It cannot be used on other models.

- (BOOL)setiOSHIDEnable:(BOOL)isOn;

Parameters

Name

Type

Description

isOn

BOOL

YES: Enable, NO: Disable

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice setiOSHIDEnable:YES];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

setPresentationMode:isBeepOn:

Enables or disables presentation mode.
When enabled, scanning automatically starts when a barcode enters the reading area.

⚠️ Note
This method is supported only on ASR-M24D. It cannot be used on other models.

- (BOOL)setPresentationMode:(BOOL)isOn isBeepOn:(BOOL)isBeepOn;

Parameters

Name

Type

Description

isOn

BOOL

Presentation mode on/off (YES: On, NO: Off)

isBeepOn

BOOL

Beep sound on/off (YES: On, NO: Off)

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice setPresentationMode:YES isBeepOn:YES];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getCodeID

Gets the current CodeID.
After calling this method, the CodeID is returned via the callback receivedCodeID.

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

- (BOOL)getCodeID;

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice getCodeID];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getOCR

Gets the OCR status (OCR-A, OCR-B).
After calling this method, the OCR status is returned via the callback receivedOCR.

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

- (BOOL)getOCR;

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice getOCR];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getHID

Gets the current HID mode status.
After calling this method, the HID mode status is returned via the callback receivedHID.

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

- (BOOL)getHID;

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice getHID];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getPresentationMode

Gets the current presentation (demo) mode status.
After calling this method, the demo mode status is returned via the callback receivedPresentationMode.

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

- (BOOL)getPresentationMode;

Return Value

Type

Description

BOOL

YES: Successfully obtained demo mode status, NO: Failed

Sample Code

BOOL status = [asReaderDevice getPresentationMode];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getSecurity

Retrieves the barcode security level.
After calling this method, the security level is returned via the callback method receivedBarcodeSecurity.

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

- (BOOL)getSecurity;

Return Value

Type

Description

BOOL

YES: Successfully obtained barcode security level, NO: Failure

Sample Code

BOOL status = [asReaderDevice getSecurity];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getSleepBuzzer

Gets the buzzer status for automatic shutdown.
After calling this method, the execution result is returned via the callback didGetSleepBuzzerReceived.

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

- (BOOL)getSleepBuzzer;

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice getSleepBuzzer];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

setSleepBuzzer

Sets the buzzer status for automatic shutdown.
After calling this method, the execution result is returned via the callback didSetSleepBuzzer.

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

- (BOOL)setSleepBuzzer:(BOOL)sleepBuzzer;

Parameters

Name

Type

Description

sleepBuzzer

BOOL

YES: On, NO: Off

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice setSleepBuzzer:YES];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getAutoOffTime

Gets the auto off time of AsReader.
After calling this method, the execution result is returned via the callback didGetAutoOffTimeReceived.

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

- (BOOL)getAutoOffTime;

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice getAutoOffTime];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

setAutoOffTime

Sets the auto off time of AsReader.
After calling this method, the execution result is returned via the callback didSetAutoOffTime.

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

- (BOOL)setAutoOffTime:(int)time;

Parameters

Name

Type

Description

time

int

Auto off time (Second) Range: 0〜1800s 0 indicates that it will not shutdown automatically.

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice setAutoOffTime:0];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

getBarcodeTimeOut

Gets the barcode scanning timeout of AsReader.
After calling this method, the execution result is returned via the callback didGetBarcodeTimeOutReceived.

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

- (BOOL)getBarcodeTimeOut;

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice getBarcodeTimeOut];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

setBarcodeTimeOut

Sets the barcode scanning timeout of AsReader.
After calling this method, the execution result is returned via the callback didSetBarcodeTimeOut.

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

- (BOOL)setBarcodeTimeOut:(int)timeout;

Parameters

Name

Type

Description

timeout

int

Scanning timeout (4~300s)

Return Value

Type

Description

BOOL

YES: Success, NO: Failure

Sample Code

BOOL status = [asReaderDevice setBarcodeTimeOut:4];
if (status) {
    // Method executed successfully
} else {
    // Method execution failed
}

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 alternative methods if available.


⚠️ startScan [Deprecated]

Starts barcode scanning.
Alternative: startScan

- (void)setTriggerModeDefault:(BOOL)isDefault;