# AsreaderBarcodeDeviceDelegate > **⚠️ 注意:** > 本 delegate メソッド群は、AsReader デバイスが正常に接続されており、かつ対応するメソッド(例:`getCodeID` や `getOCR` など)を呼び出した後にコールバックされます。 > 非対応モデルや接続されていない場合は、コールバックは発生しません。 --- ## `receivedBarcodeData` バーコードのデータを受信したときにコールバックされます。 [`startScan`](./3_AsReaderBarcodeDevice.md#startscan-numberoftags-readuntilinsec) 実行後にコールバックされます。 ```objectivec - (void)receivedBarcodeData:(NSData *)data; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `data` - NSData - バーコードデータ ``` --- ## `receiveFactoryReset` バーコードモジュールのリセット結果を受信します。 [`doFactoryReset`](3_AsReaderBarcodeDevice.md#dofactoryreset) 実行後にコールバックされます。 ```objectivec - (void)receiveFactoryReset:(int)status; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `status` - int - リセット開始(0x00)、リセット完了(0xFF) ``` --- ## `receivedBypassPayload` 一部のバイパス系設定メソッドの実行結果を受け取るコールバックです。 以下のメソッドを実行した後に、その応答が本メソッドで返されます。 対象メソッド: - [`setCustomPrefix`](./3_AsReaderBarcodeDevice.md#setcustomprefix) - [`setDisableCustomPrefix`](./3_AsReaderBarcodeDevice.md#setdisablecustomprefix) - [`setCustomSuffix:`](./3_AsReaderBarcodeDevice.md#setcustomsuffix) - [`setDisableCustomSuffix`](./3_AsReaderBarcodeDevice.md#setdisablecustomsuffix) - [`setDisableSymbologyPrefix`](./3_AsReaderBarcodeDevice.md#setdisablesymbologyprefix) - [`setBarcodeEngineUserCommand:`](./3_AsReaderBarcodeDevice.md#setbarcodeengineusercommand) ```objectivec - (void)receivedBypassPayload:(NSData *)rawData; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `rawData` - `NSData` - デバイスから返されたコマンドの実行結果データ。 ``` ### 補足 - 受信したデータ(`rawData`)の内容は、送信したコマンドに依存します。 - 解析には各メソッドの仕様に応じたバイナリ解析が必要です。 ### サンプルコード ```objectivec - (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]); } // 必要に応じてデータ解析をここに記述 } ``` --- ## `receivedCodeID` CodeID タイプを返します。 [`getCodeID`](3_AsReaderBarcodeDevice.md#getcodeid) 実行後にコールバックされます。 ```objectivec - (void)receivedCodeID:(int)codeID; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `codeID` - int - codeID データ ``` --- ## `receivedOCR` OCR タイプの状態を返します。 [`getOCR`](3_AsReaderBarcodeDevice.md#getocr) 実行後にコールバックされます。 ```objectivec - (void)receivedOCR:(BOOL)isNone isOCRAon:(BOOL)isOCRAon isOCRBon:(BOOL)isOCRBon; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `isNone` - BOOL - OCR機能なし(YES)/あり(NO) * - `isOCRAon` - BOOL - OCR-Aが有効(YES)/無効(NO) * - `isOCRBon` - BOOL - OCR-Bが有効(YES)/無効(NO) ``` --- ## `receivedHID` HIDモードの状態を返します。 [`getHID`](3_AsReaderBarcodeDevice.md#gethid) 実行後にコールバックされます。 ```objectivec - (void)receivedHID:(BOOL)hidOn iOShidOn:(BOOL)iOShidOn; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `hidOn` - BOOL - HIDモードの状態(YES:オン、NO:オフ) * - `iOShidOn` - BOOL - 対応プラットフォーム(YES:iOS、NO:Android) ``` --- ## `receivedPresentationMode` プレゼンテーションモードの状態を返します。 [`getPresentationMode`](3_AsReaderBarcodeDevice.md#getpresentationmode) 実行後にコールバックされます。 ```objectivec - (void)receivedPresentationMode:(BOOL)isOn; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `isOn` - BOOL - プレゼンテーションモードの状態(YES:オン、NO:オフ) ``` --- ## `receivedSleepBeep` スリープ設定関連のデータを返します。 [`setSleepBeep`](../common/common/2_AsReaderDevice.md#setsleepbeep)、[`setSleepTime`](../common/common/2_AsReaderDevice.md#setsleeptime) 実行後にコールバックされます。 ```objectivec - (void)receivedSleepBeep:(NSData *)data; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `data` - NSData - スリープ設定データ ``` --- ## `receivedSymbologies` バーコードタイプ(Symbology)の設定状態を返します。 [`getSymbologies`](3_AsReaderBarcodeDevice.md#getsymbologies) 実行後にコールバックされます。 ```objectivec - (void)receivedSymbologies:(NSDictionary *)symbols; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `symbols` - NSDictionary - バーコードタイプの設定状態 ``` --- ## `receivedGetAutoLaunch` プレゼンテーションアプリの自動起動状態を返します。 [`getAutoLaunch`](../common/common/2_AsReaderDevice.md#getautolaunch) 実行後にコールバックされます。 ```objectivec - (void)receivedGetAutoLaunch:(BOOL)isOn data:(NSString *)data; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `isOn` - BOOL - 自動起動の状態(YES:オン、NO:オフ) * - `data` - NSString - 起動対象の bundleId ``` --- ## `receivedBarcodeSecurity` バーコードのセキュリティレベルを返します。 [`getSecurity`](3_AsReaderBarcodeDevice.md#getsecurity) 実行後にコールバックされます。 ```objectivec - (void)receivedBarcodeSecurity:(NSDictionary *)security; ``` ### パラメータ ```{list-table} :align: left :class: list-table * - 項目名 - 型 - 説明 * - `security` - NSDictionary - セキュリティ設定データ ``` --- ## 非推奨メソッド一覧 以下のメソッドは現在非推奨です。 **将来的に削除される可能性がありますので、新規開発では使用しないでください。** 代替手段が用意されている場合はそちらをご利用ください。 --- ### ⚠️ `barcodeDataReceived`【非推奨】 トリガーモードを設定します。 代替: [`receivedBarcodeData`](#receivedbarcodedata) ```objectivec - (void)barcodeDataReceived:(NSData *)data; ```