---
title: "cancelPeripheralConnection(_:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbcentralmanager/cancelperipheralconnection(_:)"
---

# cancelPeripheralConnection(_:)

Cancels an active or pending local connection to a peripheral.

## Declaration

```swift
func cancelPeripheralConnection(_ peripheral: CBPeripheral)
```

## Parameters

- `peripheral`: The peripheral to which the central manager is either trying to connect or has already connected.

## Discussion

Discussion This method is nonblocking, and any CBPeripheral class commands that are still pending to peripheral may not complete. Because other apps may still have a connection to the peripheral, canceling a local connection doesn’t guarantee that the underlying physical link is immediately disconnected. From the app’s perspective, however, the peripheral is effectively disconnected, and the central manager object calls the centralManager(_:didDisconnectPeripheral:error:) method of its delegate object.

## See Also

### Establishing or Canceling Connections with Peripherals

- [connect(_:options:)](corebluetooth/cbcentralmanager/connect(_:options:).md)
- [Peripheral Connection Options](corebluetooth/peripheral-connection-options.md)
