Transmission of FeliCa Command Packet Data at the application layer. Refer to the FeliCa specification for details.
Manufacturer ID (IDm) of the currently selected system can be read from the currentIDm property.
- Parameters:
- commandPacket: Command packet send to the FeliCa card. Maximum packet length is 254. Data length (LEN) byte and CRC bytes are calculated and inserted
automatically to the provided packet data frame.
- resultHandler: Completion handler called when the operation is completed. A `NFCErrorDomain` error is returned when there is a communication issue with the tag.
Request Service command defined by FeliCa card specification. Refer to the FeliCa specification for details.
- Parameters:
- nodeCodeList: Node Code list represented in an array of Data objects. Number of nodes specified should be between 1 to 32 inclusive.
Each node code should be 2 bytes stored in Little Endian format.
- resultHandler: Completion handler called when the operation is completed. Node key version list is returned as an array of Data objects,
and each data object is stored in Little Endian format per FeliCa specification.
method · iOS 14.0+
requestResponse
Swift declaration
@preconcurrency func requestResponse(resultHandler: @escaping @Sendable (Result<Int, any Error>) -> Void)
Request Response command defined by FeliCa card specification. Refer to the FeliCa specification for details.
- Parameters:
- resultHandler: Returns the mode as Int or a `NFCErrorDomain` error when the operation is completed. Valid mode value ranges from 0 to 3 inclusively.
Request Service V2 command defined by FeliCa card specification. Refer to the FeliCa specification for details.
- Parameters:
- nodeCodeList: Node Code list represent in an array of Data. Number of nodes specified should be between 1 to 32 inclusive. Each node code should be 2 bytes stored in Little Endian format.
- resultHandler: Completion handler called when the operation is completed. `encryptionIdentifier` value shall be ignored if Status Flag 1 value indicates an error.
`nodeKeyVersionListAES` and `nodeKeyVersionListDES` may be nil depending on the Status Flag 1 value and the Encryption Identifier value.
The 2 bytes node key version (AES and DES) is in Little Endian format.
method · iOS 14.0+
requestSystemCode
Swift declaration
@preconcurrency func requestSystemCode(resultHandler: @escaping @Sendable (Result<[Data], any Error>) -> Void)
Request System Code command defined by FeliCa card specification. Refer to the FeliCa specification for details.
- Parameters:
- resultHandler: Returns an array of system code as Data or a `NFCErrorDomain` error when the operation is completed. Each system code is 2 bytes stored in Little Endian format.
Read Without Encryption command defined by FeliCa card specification. Refer to the FeliCa specification for details.
- Parameters:
- serviceCodeList: Service Code list represented in an array of Data objects. Number of nodes specified should be between 1 to 16 inclusive.
Each service code should be 2 bytes stored in Little Endian format.
- blockList: Block List represent in an array of Data objects. 2-Byte or 3-Byte block list element is supported.
- resultHandler: Completion handler called when the operation is completed. Valid read data blocks (block length of 16 bytes) are returned
in an array of Data objects when Status Flag 1 equals zero.
Write Without Encryption command defined by FeliCa card specification. Refer to the FeliCa specification for details.
- Parameters:
- serviceCodeList: Service Code list represented in an array of Data objects. Number of nodes specified should be between 1 to 16 inclusive.
Each service code should be 2 bytes stored in Little Endian format.
- blockList: Block List represent in an array of Data objects. Total blockList items and blockData items should match. 2-Byte or 3-Byte block list element is supported.
- blockData: Block data represent in an array of Data objects. Total blockList items and blockData items should match. Data block should be 16 bytes in length.
- resultHandler: Returns `NFCFeliCaStatusFlag` or a `NFCErrorDomain` error when operation is completed.
method · iOS 14.0+
requestSpecificationVersion
Swift declaration
@preconcurrency func requestSpecificationVersion(resultHandler: @escaping @Sendable (Result<NFCFeliCaRequestSpecificationVersionResponse, any Error>) -> Void)
Request Specification Version command defined by FeliCa card specification. This command supports response format version `00`h. Refer to the FeliCa specification for details.
- Parameters:
- resultHandler: Returns `NFCFeliCaRequestSpecificationVersionResponse` or a `NFCErrorDomain` error when the operation is completed.
`basicVersion` and `optionVersion` may be nil depending on the Status Flag 1 value and if the tag supports AES/DES.
Polling command defined by FeliCa card specification. Refer to the FeliCa specification for details.
System code must be one of the provided values in the "com.apple.developer.nfc.readersession.felica.systemcodes" in the Info.plist;
`NFCReaderErrorSecurityViolation` will be returned when an invalid system code is used. Polling with wildcard value in the upper or lower byte is not supported.
- Parameters:
- systemCode: Designation of System Code. Wildcard value (0xFF) in the upper or the lower byte is not supported.
- requestCode: Designation of Requset Data output.
- timeSlot: Maximum number of slots possible to respond.
- resultHandler: Returns `NFCFeliCaPollingResponse` or a `NFCErrorDomain` error when the operation is completed. Valid `requestData` is return when
`requestCode` is a non-zero parameter and feature is supported by the tag. The `currentIDM` property will be updated on each execution,
except when an invalid `systemCode` is provided and the existing selected system will stay selected.
method · iOS 14.0+
resetMode
Swift declaration
@preconcurrency func resetMode(resultHandler: @escaping @Sendable (Result<NFCFeliCaStatusFlag, any Error>) -> Void)
Reset Mode command defined by FeliCa card specification. Refer to the FeliCa specification for details.
- Parameters:
- resultHandler: Returns `NFCFeliCaStatusFlag` or a `NFCErrorDomain` error when the operation is completed.