<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: -",
    "macOS: 10.12.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CryptoTokenKit",
  "identifier" : "/documentation/CryptoTokenKit/TKSmartCard/send(ins:p1:p2:data:le:)-1kbga",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CryptoTokenKit"
    ],
    "preciseIdentifier" : "s:So11TKSmartCardC14CryptoTokenKitE4send3ins2p12p24data2les6UInt16V2sw_10Foundation4DataV8responsets5UInt8V_A2rOSgSiSgtKF"
  },
  "title" : "send(ins:p1:p2:data:le:)"
}
-->

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

Synchronously sends an APDU command to the smart card.

```
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

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

## Discussion

Use this method when you need synchronous execution, such as within
`withSession` blocks or when calling from synchronous code paths.

> Throws: An error if the command fails.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)