---
title: "centralManager(_:didDiscover:advertisementData:rssi:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbcentralmanagerdelegate/centralmanager(_:diddiscover:advertisementdata:rssi:)"
---

# centralManager(_:didDiscover:advertisementData:rssi:)

Tells the delegate the central manager discovered a peripheral while scanning for devices.

## Declaration

```swift
optional func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, advertisementData: [String : Any], rssi RSSI: NSNumber)
```

## Parameters

- `central`: The central manager that provides the update.
- `peripheral`: The discovered peripheral.
- `advertisementData`: A dictionary containing any advertisement data.
- `RSSI`: The current received signal strength indicator (RSSI) of the peripheral, in decibels.

## Discussion

Discussion You can access the advertisement data with the keys listed in Advertisement Data Retrieval Keys. You must retain a local copy of the peripheral if you want to perform commands on it. Use the RSSI data to determine the proximity of a discoverable peripheral device, and whether you want to connect to it automatically.

## See Also

### Discovering and Retrieving Peripherals

- [Advertisement Data Retrieval Keys](corebluetooth/advertisement-data-retrieval-keys.md)
