---
title: "sendResponse(_:withOK:)"
framework: IOBluetooth
role: symbol
role_heading: Instance Method
platforms: [macOS 10.7+]
path: "iobluetooth/iobluetoothhandsfreeaudiogateway/sendresponse(_:withok:)"
---

# sendResponse(_:withOK:)

Sends data followed by an optional success message to a connected Bluetooth hands-free phone or headset.

## Declaration

```swift
func sendResponse(_ response: String!, withOK: Bool)
```

## Parameters

- `response`: A string containing the data.
- `withOK`: If true, send an OK message after sending the response.

## See Also

### Sending and Receiving Commands

- [sendResponse(_:)](iobluetooth/iobluetoothhandsfreeaudiogateway/sendresponse(_:).md)
- [sendOKResponse()](iobluetooth/iobluetoothhandsfreeaudiogateway/sendokresponse().md)
- [process(atCommand:)](iobluetooth/iobluetoothhandsfreeaudiogateway/process(atcommand:).md)
