failed

protected open suspend fun failed(peripheral: Peripheral<*, *>, reason: RemoteServices.Failed.Reason)

Notifies the profile implementation that service discovery has failed.

This method is called instead of prepare and initialize when service discovery failed, so it could not be determined whether requiredServiceUuids are present on the peripheral.

Note

As with unsupported, this is purely a notification and does not affect the connection lifecycle: if the profile was registered as required, the peripheral will still be disconnected with reason RequiredServiceNotFound regardless of what this method does, and without waiting for it to return.

The default implementation does nothing.

Parameters

peripheral

The peripheral the profile is being resolved on.

reason

The reason of the service discovery failure.

See also