Instance Method

sendIns:p1:p2:data:le:reply:

Asynchronously transmits a specified APDU to the Smart Card and returns a response.

Declaration

- (void)sendIns:(UInt8)ins p1:(UInt8)p1 p2:(UInt8)p2 data:(NSData *)requestData le:(NSNumber *)le reply:(void (^)(NSData *replyData, UInt16 sw, NSError *error))reply;

Parameters

ins

The INS code of the APDU.

p1

The P1 code of the APDU.

p2

The P2 code of the APDU.

requestData

The data field of the APDU, or nil if no input data field should be present—for example, an case1 or case2 APDU.

The length of the data serves as Lc field of the APDU.

le

The expected number of bytes to be returned, or nil if no output data are expected—for example, an case1 or case3 APDU. Pass 0 to accept as many bytes as the card provides.

reply

A block to be called when the response is returned.

replyData

The returned data without the first two bytes (SW1SW2), or nil if an error occured.

sw

The result code as represented by the first two bytes (SW1SW2) of the returned data.

error

If a communication error occurred or the sw result code is anything other than 0x9000, contains details about the error.

See Also

Related Symbols

- transmitRequest:reply:

Transmits data in Application Protocol Data Unit (APDU) format to the Smart Card.