---
title: "peripheral(_:didDiscoverCharacteristicsFor:error:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheraldelegate/peripheral(_:diddiscovercharacteristicsfor:error:)"
---

# peripheral(_:didDiscoverCharacteristicsFor:error:)

Tells the delegate that the peripheral found characteristics for a service.

## Declaration

```swift
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: (any Error)?)
```

## Parameters

- `peripheral`: The peripheral providing this information.
- `service`: The service to which the characteristics belong.
- `error`: The reason the call failed, or nil if no error occurred.

## Discussion

Discussion Core Bluetooth invokes this method when your app calls the discoverCharacteristics(_:for:) method. If the peripheral successfully discovers the characteristics of the specified service, you can access them through the service’s characteristics property. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

## See Also

### Discovering Characteristics and their Descriptors

- [peripheral(_:didDiscoverDescriptorsFor:error:)](corebluetooth/cbperipheraldelegate/peripheral(_:diddiscoverdescriptorsfor:error:).md)
