Instance Method

sendIns:p1:p2:data:le:sw:error:

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

Declaration

- (NSData *)sendIns:(UInt8)ins p1:(UInt8)p1 p2:(UInt8)p2 data:(NSData *)requestData le:(NSNumber *)le sw:(UInt16 *)sw error:(NSError * _Nullable *)error;

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.

sw

On return, contains the result code as represented by the first two bytes (SW1SW2) of the returned data.

error

On return, if an error occurred when attempting to create a session or execute the block, contains details about the error.

Return Value

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

See Also

Related Symbols

- beginSessionWithReply:

Begins a session with the Smart Card.