---
title: "sendL2CAPEchoRequest(_:length:)"
framework: IOBluetooth
role: symbol
role_heading: Instance Method
path: "iobluetooth/iobluetoothdevice/sendl2capechorequest(_:length:)"
---

# sendL2CAPEchoRequest(_:length:)

Send an echo request over the L2CAP connection to a remote device.

## Declaration

```swift
func sendL2CAPEchoRequest(_ data: UnsafeMutableRawPointer!, length: UInt16) -> IOReturn
```

## Parameters

- `data`: (Void *) - Pointer to buffer to send.
- `length`: (UInt16) - Length of the buffer to send

## Return Value

Return Value Returns kIOReturnSuccess if the echo request was able to be sent.

## Discussion

Discussion The current implementation returns when the request has been sent, but does not indicate when a response is received. Also, the baseband connection must be up for the echo request to be sent. In the future, this method will also open the connection if necessary. The API will be updated to allow the client to be informed when the echo response has been received (both synchronously and asynchronously).
