Snapdragon® Telematics Application Framework (TelAF) Interface Specification
Diag Update Service

API Reference


The diag update service APIs are used by applications to handle transfer requests from UDS clients. The diag update service includes the TransferData(0x36), RequestTransferExit(0x37), and RequestFileTransfer(0x38) services.

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 update service.

bindings:
{
     clientExe.clientComponent.taf_diagUpdate -> tafDiagSvc.taf_diagUpdate
}

Request file transfer

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

diagFileXferMsgRef = taf_diagUpdate_AddRxFileXferMsgHandler( diagUpdateSvcRef,
fileXferMsgHandler, NULL );

An application can get a file path and name, and length by using taf_diagUpdate_GetFilePathAndName().

(uint8_t *)filePathAndName, &fileLen );
if (result != LE_OK)
{
LE_ERROR("Fail to get file path and name, and length.");
return result;
}

An application can set the file position by using taf_diagUpdate_SetFilePosition().

result = taf_diagUpdate_SetFilePosition(rxMsgRef, sizeOfFilePosition);
if (result != LE_OK)
{
LE_ERROR("Fail to set file position as response: %d", result);
return result;
}

An application can set the file size or directory information length by using taf_diagUpdate_SetFileSizeOrDirInfoLength().

fileSizeUncompressedOrDirInfoLength,
fileSizeCompressed);
if (result != LE_OK)
{
LE_ERROR("Fail to set file size or dir info len as response: %d", result);
return result;
}

An application can send a file transfer response by using taf_diagUpdate_SendFileXferResp().

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

The following APIs are provided for request file transfer.

Transfer data

An application registers a transfer data handler using taf_diagUpdate_AddRxXferDataMsgHandler(). Once a transfer data request message is received, the handler will be called indicating the new message.

diagXferDataMsgRef = taf_diagUpdate_AddRxXferDataMsgHandler( diagUpdateSvcRef,
xferDataMsgHandler, NULL );

An application can get the data length and payload by using taf_diagUpdate_GetXferDataParamRecLen() and taf_diagUpdate_GetXferDataParamRec() referring to the following sample code snippets.

result = taf_diagUpdate_GetXferDataParamRecLen( rxMsgRef, (uint16_t *)&xferDataLen);
if (result != LE_OK)
{
LE_ERROR("Fail to get data length.");
return result;
}
result = taf_diagUpdate_GetXferDataParamRec( rxMsgRef, xferData, &xferDataLen);
if (result != LE_OK)
{
LE_ERROR("Fail to get data payload.");
return result;
}

An application can send a transfer data response by using taf_diagUpdate_SendXferDataResp().

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

The following APIs are provided for transfer data.

Request transfer exit

An application registers a transfer exit handler using taf_diagUpdate_AddRxXferExitMsgHandler(). Once a transfer exit request message is received, the handler will be called indicating the new message.

diagXferExitMsgRef = taf_diagUpdate_AddRxXferExitMsgHandler( diagUpdateSvcRef,
xferExitMsgHandler, NULL );

An application can send a transfer exit response by using taf_diagUpdate_SendXferDataResp().

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

The following APIs are provided for request transfer exit.

The following APIs are provided for service reference.