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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
BOOL |
No OCR function (YES) / has OCR (NO) |
|
BOOL |
OCR-A enabled (YES) / disabled (NO) |
|
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 |
|
BOOL |
HID mode status (YES: On, NO: Off) |
|
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 |
|
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 |
|
NSData |
Sleep setting data |
receivedSymbologies¶
Returns the barcode symbology settings status.
Called after executing getSymbologies.
- (void)receivedSymbologies:(NSDictionary *)symbols;
Parameters¶
Name |
Type |
Description |
|
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 |
|
BOOL |
Auto-launch status (YES: On, NO: Off) |
|
NSString |
Target bundleId for launch |
receivedBarcodeSecurity¶
Returns the barcode security level.
Called after executing getSecurity.
- (void)receivedBarcodeSecurity:(NSDictionary *)security;
Parameters¶
Name |
Type |
Description |
|
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 |
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 |
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 |
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;