# Diag Routine Control Service

- API reference

The Diag Routine Control service APIs are used by applications to handle routine control(0x31) requests from UDS clients.

## IPC interfaces binding

All functions of this API are provided by the **tafDiagSvc** platform service.

The following example illustrates how to bind to the diag routine control service.

bindings:
    {
         clientExe.clientComponent.taf_diagRoutineCtrl -> tafDiagSvc.taf_diagRoutineCtrl
    }
    Copy to clipboard

## Routine control

A diag routine control service reference can be retrieved using taf\_diagRoutineCtrl\_GetService() with the identifier passed as a parameter.

diagRoutineCtrlSvcRef = taf_diagRoutineCtrl_GetService(identifier);
    if (diagRoutineCtrlSvcRef == NULL)
    {
         LE_ERROR("Fail to get routine control reference.");
         return;
    }
    Copy to clipboard

## Set/get VLAN ID

After getting a service reference, an application can set the VLAN ID to the service to filter routine control requests using taf\_diagRoutineCtrl\_SetVlanId(). It shall be called before registering the handler for the RoutineControl(0x31) request message. An application can get the VLAN ID of the request message using taf\_diagRoutineCtrl\_GetVlanIdFromMsg().

- taf\_diagRoutineCtrl\_SetVlanId() — Sets the VLAN ID.
- taf\_diagRoutineCtrl\_GetVlanIdFromMsg() — Gets the VLAN ID of the request message.

Last Published: May 11, 2026

Previous Topic
 
Diag Reset Service Next Topic

Diag Security Service