# AsReaderNFCDevice ## `sharedInstance` Creates and initializes an `AsReaderNFCDevice` object (Singleton pattern). ```objectivec + (instancetype)sharedInstance; ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `instancetype` - An `AsReaderNFCDevice` object ``` --- ## `sendData` Sends data. ```objectivec - (BOOL)sendData:(NSData *)sendData; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `sendData` - NSData - Data to send ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `BOOL` - Method execution result: YES = success, NO = failure ``` --- ## `startScan` Starts the AsReader NFC scan. After executing this method, the result is called back via [`receivedScanData`](../common/common/8_AsReaderDeviceProtocol.md#receivedscandata). ```objectivec - (BOOL)startScan; ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `BOOL` - Method execution result: YES = success, NO = failure ``` --- ## `stopScan` Stops scanning NFC tags on the AsReader device. ```objectivec - (BOOL)stopScan; ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `BOOL` - Method execution result: YES = success, NO = failure ``` --- ## `readMultiBlockWithBlockIndex:count:` Reads multiple consecutive blocks of data on the IC tag memory with the specified UID. **After executing this method, the result is called back via [`nfcReadMultiBlockReceived`](./6_AsReaderNFCProtocol.md#nfcreadmultiblockreceived).** ```objectivec - (BOOL)readMultiBlockWithBlockIndex:(int)index count:(int)count; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `index` - int - Starting block number (0–255) * - `count` - int - Number of blocks to read (0–255) ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `BOOL` - Method execution result: YES = success, NO = failure ``` --- ## `writeSingleBlockWithBlockIndex:writeData:uid:` Writes data to a specified block in the IC tag memory with the specified UID. **After executing this method, the result is called back via [`nfcWriteSingleBlockStatusCode`](./6_AsReaderNFCProtocol.md#nfcwritesingleblockstatuscode).** ```objectivec - (BOOL)writeSingleBlockWithBlockIndex:(int)index writeData:(NSData *)writeData uid:(NSData *)uid; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `index` - int - Starting block number (0–255) * - `writeData` - NSData - Data to write (each block size is 4 bytes) * - `uid` - NSData - NFC tag UID data ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `BOOL` - Method execution result: YES = success, NO = failure ``` --- ## `writeBytesWithBlockIndex:writeData:uid:` Writes data of specified byte length starting from the specified block with the specified UID. **After executing this method, the result is called back via [`nfcWriteBytesStatusCode`](./6_AsReaderNFCProtocol.md#nfcwritebytesstatuscode).** ```objectivec - (BOOL)writeBytesWithBlockIndex:(int)index writeData:(NSData *)writeData uid:(NSData *)uid; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `index` - int - Starting block number (0–255) * - `writeData` - NSData - Data to write (each block size is 4 bytes) * - `uid` - NSData - NFC tag UID data ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `BOOL` - Method execution result: YES = success, NO = failure ``` --- ## `setInventoryTime` Sets the reading time. ```objectivec - (BOOL)setInventoryTime:(float)inventoryTime; ``` ### Parameters ```{list-table} :align: left :class: list-table * - Name - Type - Description * - `inventoryTime` - float - Inventory time ``` ### Return Value ```{list-table} :align: left :class: list-table * - Type - Description * - `BOOL` - Method execution result: YES = success, NO = failure ```