---
title: "discoverCharacteristics(_:for:)"
framework: corebluetooth
role: symbol
role_heading: Instance Method
path: "corebluetooth/cbperipheral/discovercharacteristics(_:for:)"
---

# discoverCharacteristics(_:for:)

Discovers the specified characteristics of a service.

## Declaration

```swift
func discoverCharacteristics(_ characteristicUUIDs: [CBUUID]?, for service: CBService)
```

## Parameters

- `characteristicUUIDs`: An array of doc://com.apple.corebluetooth/documentation/CoreBluetooth/CBUUID objects that you are interested in. Each doc://com.apple.corebluetooth/documentation/CoreBluetooth/CBUUID object represents a UUID that identifies the type of a characteristic you want to discover.
- `service`: The service whose characteristics you want to discover.

## Discussion

Discussion You can provide an array of CBUUID objects—representing characteristic UUIDs— in the characteristicUUIDs parameter. When you do, the peripheral returns only the characteristics of the service that match the provided UUIDs. If the characteristicUUIDs parameter is nil, this method returns all characteristics of the service. note: If the characteristicUUIDs parameter is nil, this method returns all of the service’s characteristics. This is much slower than providing an array of characteristic UUIDs to search for. When the peripheral discovers one or more characteristics of the specified service, it calls the peripheral(_:didDiscoverCharacteristicsFor:error:) method of its delegate object. After the peripheral discovers the service’s characteristics, you can access them through the service’s characteristics property.

## See Also

### Discovering Characteristics and Descriptors

- [discoverDescriptors(for:)](corebluetooth/cbperipheral/discoverdescriptors(for:).md)
