---
title: "send(ins:p1:p2:data:le:)"
framework: cryptotokenkit
role: symbol
role_heading: Instance Method
path: "cryptotokenkit/tksmartcard/send(ins:p1:p2:data:le:)-1kbga"
---

# send(ins:p1:p2:data:le:)

Synchronously sends an APDU command to the smart card.

## Declaration

```swift
func send(ins: UInt8, p1: UInt8, p2: UInt8, data: Data? = nil, le: Int? = nil) throws -> (sw: UInt16, response: Data)
```

## Parameters

- `ins`: Instruction byte of the APDU command.
- `p1`: P1 parameter byte.
- `p2`: P2 parameter byte.
- `data`: Optional command data.
- `le`: Optional expected response length.

## Return Value

Return Value A tuple containing the status word (sw) and response data.

## Discussion

Discussion Use this method when you need synchronous execution, such as within withSession blocks or when calling from synchronous code paths. note: An error if the command fails.
