Snapdragon® Telematics Application Framework (TelAF) Interface Specification
|
The diag security service APIs are part of the diagnostic service. The diag security service provides diag SessionControl(0x10) and SecurityAccess(0x27) service. The SessionControl service is used to enable different diagnostic sessions in the server. It enables a specific set of diagnostic services or functionality in the server. There shall always be exactly one diagnostic session active in a server. A server shall always start the default diagnostic session when powered up. The SecurityAccess service provides a means to access data and/or diagnostic services, which have restricted access for security, emissions, or safety reasons.
The functions of this API are provided by the tafDiagSvc platform service.
The following example illustrates how to bind to the diag security service.
bindings: { clientExe.clientComponent.taf_diagSecurity -> tafDiagSvc.taf_diagSecurity }
A diag security service reference can be got using taf_diagSecurity_GetService(). Use the returned reference for subsequent operations.
The following example illustrates how to set up a diag security server-service-instance.
After getting the service reference, an application can call taf_diagSecurity_AddRxSesTypeCheckHandler() to register a message handler for SessionControl(0x10) service. Once a diag session control request message is received, the handler will be called with the message reference and received session type passed as input parameters. The application will check condition for the received session type and uses the message reference to send a response message using taf_diagSecurity_SendSesTypeCheckResp().
If the application sends a positive response with TAF_DIAGSECURITY_SES_CONTROL_NO_ERROR for the requested session type using taf_diagSecurity_SendSesTypeCheckResp(), then service will change the session type and maintain it. An application can call taf_diagSecurity_AddSesChangeHandler() to register a message handler for session type change. Once session type is changed in diag service, the handler will be called with message reference and receive the previous and current session type. An application can also get the current active session type using taf_diagSecurity_GetCurrentSesType().
The API of taf_diagSecurity_GetCurrentSesType() is provided to get the current active session type.
Finally call taf_diagSecurity_RemoveSvc() to remove the created service.
After getting the service reference, an application can call taf_diagSecurity_AddRxSecAccessMsgHandler() to register a message handler for SecurityAccess(0x27) service. Once a diag security access request message is received, the handler will be called with the message reference and received security accessType passed as input parameters. The application performs the requested security operation based on the received security accessType and uses the message reference to send a response message using taf_diagSecurity_SendSecAccessResp(). Finally call taf_diagSecurity_RemoveSvc() to remove the created service.
The following APIs are provided to get the security access payload. The payload can be either securityAccessDataRecord or securityKey based on the accessType input of the registered RxSecAccessMsgHandler. The payload of requestSeed(0x01) acessType is securityAccessDataRecord and sendKey(0x02) accessType is securityKey.
An application can send a response by calling taf_diagSecurity_SendSecAccessResp().
An application can remove the diag security server service by calling taf_diagSecurity_RemoveSvc().