# Barcode ## Overview This chapter explains how to operate the barcode reader function using ``AsReaderBarcodeDevice``. You can connect to the device, start and stop reading, and receive reading results. ## Supported Devices `ASX-510R`, `ASX-520R`, `ASR-010D`, `ASR-020D`, `ASR-022D`, `ASR-0230D`, `ASR-0231D`, `ASR-0240D`, `ASR-M24D`, `ASR-025S` ## Used Classes and Protocols ```{list-table} List of Used Classes and Protocols :header-rows: 1 :widths: 25 18 57 * - Name - Type - Description * - [`AsReaderBarcodeDevice`](./3_AsReaderBarcodeDevice.md) - Class - Main class for controlling the barcode reader * - [`AsreaderBarcodeDeviceDelegate`](./10_AsReaderBarcodeProtocol.md) - Protocol - Delegate used to receive reading results and others ``` ## Initialization and Connection ```objectivec AsReaderBarcodeDevice *device = [AsReaderBarcodeDevice sharedInstance]; device.delegateDevice = self; ``` - ``delegateBarcode``: Set this to receive barcode reading events. ## Start and Stop Reading ```objectivec [device startScan:0 readUntilInSec:0]; // Start reading [device stopScan]; // Stop reading ``` ## Receiving Reading Results ```objectivec - (void)receivedBarcodeData:(NSData *)data { NSLog(@"Read barcode: %@", data); } ``` *Implement this as a method of the ``AsreaderBarcodeDeviceDelegate`` protocol.* --- ```{toctree} :maxdepth: 1 :hidden: 3_AsReaderBarcodeDevice.md Delegate <10_AsReaderBarcodeProtocol.md> ```