AsReaderBarcodeDevice¶
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 |
|
|
Maximum number of barcodes to read. |
|
|
Maximum scan duration (seconds). |
Notes¶
Normally, setting both
numberOfTagsandreadUntilInSecto0x00will scan one barcode and stop immediately.To scan more barcodes, it is recommended to change only one of the two parameters.
If
0xFFis specified, scanning continues until manually stopped.
Return Value¶
Type |
Description |
|
YES: Scan started successfully. |
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 |
|
YES: Successfully stopped 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 |
|
YES: Reset succeeded. |
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 |
|
|
Barcode setting data to send |
Return Value¶
Type |
Description |
|
YES: Send succeeded. |
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 |
|
YES: Method succeeded. |
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 returnsNO.
- (BOOL)setSymbologyPrefix;
Return Value¶
Type |
Description |
|
YES: Setting succeeded. |
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 returnNO.
- (BOOL)setDisableSymbologyPrefix;
Return Value¶
Type |
Description |
|
YES: Disabled prefix successfully. |
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 |
|
|
The prefix string to set |
Return Value¶
Type |
Description |
|
YES: Setting succeeded. |
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 |
|
YES: Successfully disabled. |
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 |
|
|
The suffix string to set |
Return Value¶
Type |
Description |
|
YES: Setting succeeded. |
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 |
|
YES: Successfully cleared. |
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 code string (e.g., |
Return Value¶
Type |
Description |
|
YES: Success |
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 |
|
|
|
|
|
YES: Beep on, NO: Beep off |
Return Value¶
Type |
Description |
|
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 |
|
|
|
|
|
YES: Beep on, NO: Beep off |
Return Value¶
Type |
Description |
|
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 |
|
|
YES: Enable, NO: Disable |
Return Value¶
Type |
Description |
|
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 |
|
|
Presentation mode on/off (YES: On, NO: Off) |
|
|
Beep sound on/off (YES: On, NO: Off) |
Return Value¶
Type |
Description |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
BOOL |
YES: On, NO: Off |
Return Value¶
Type |
Description |
|
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 |
|
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 |
|
int |
Auto off time (Second) Range: 0〜1800s 0 indicates that it will not shutdown automatically. |
Return Value¶
Type |
Description |
|
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 |
|
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 |
|
int |
Scanning timeout (4~300s) |
Return Value¶
Type |
Description |
|
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;