Snapdragon® Telematics Application Framework (TelAF) Interface Specification
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
}

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;
}

After getting a reference, an application registers a message handler using taf_diagRoutineCtrl_AddRxMsgHandler(). Once a routine control request message is received, the handler will be called indicating the new message.

diagRoutineCtrlMsgRef = taf_diagRoutineCtrl_AddRxMsgHandler(diagRoutineCtrlSvcRef,
(taf_diagRoutineCtrl_RxMsgHandlerFunc_t)routineCtrl_MsgHandler, NULL);

An application can send a response by using taf_diagRoutineCtrl_SendResp().

if (result != LE_OK)
{
LE_ERROR("Fail to send response.");
return result;
}

The following APIs are provided for diag routine control service.