> ## Documentation Index
> Fetch the complete documentation index at: https://notevil.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CAPLfunctionSetService

# SetService (obsolete)

[Valid for](../../../Shared/FeatureAvailability.md): CANoe DE

## Method Syntax

* `long consumedServiceRef::SetService(service svc);`
* `long providedServiceRef::SetService(service svc);`
* `long serviceConsumerRef::SetService(service svc);`
* `long serviceProviderRef::SetService(service svc);`

## Description

Sets the referred-to service for the CO reference.

## Parameters

* **svc**: The new service.

## Return Values

* **0**: Success
* **3**: Given service doesn’t have the correct type
* **-1**: Given reference is invalid

## Example

```plaintext theme={null}
consumedServiceRef Services::IMirrors csr;
csr.SetService(Services::Mirrors);
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.