peripheral(_:didDiscoverIncludedServicesFor:error:)
Tells the delegate that discovering included services within the indicated service completed.
Declaration
optional func peripheral(_ peripheral: CBPeripheral, didDiscoverIncludedServicesFor service: CBService, error: (any Error)?)Parameters
- peripheral:
The peripheral providing this information.
- service:
The Cbservice object containing the included service.
- error:
The reason the call failed, or
nilif no error occurred.
Discussion
Core Bluetooth invokes this method when your app calls the discoverIncludedServices(_:for:) method. If the peripheral successfully discovers services, you can access them through the service’s includedServices property. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.