Snapdragon® Telematics Application Framework (TelAF) Interface Specification
taf_diagSecurity_common.h File Reference
#include "legato.h"
#include "taf_types_common.h"

Go to the source code of this file.

Macros

#define IFGEN_TAF_DIAGSECURITY_PROTOCOL_ID   "0a088790455849a5e5eca798ee6404d6"
 
#define IFGEN_TAF_DIAGSECURITY_MSG_SIZE   4115
 
#define TAF_DIAGSECURITY_MAX_PAYLOAD_SIZE   4095
 
#define TAF_DIAGSECURITY_MAX_SEC_ACCESS_PAYLOAD_SIZE   4093
 

Typedefs

typedef struct taf_diagSecurity_Service * taf_diagSecurity_ServiceRef_t
 
typedef struct taf_diagSecurity_RxSesTypeCheck * taf_diagSecurity_RxSesTypeCheckRef_t
 
typedef struct taf_diagSecurity_SesChange * taf_diagSecurity_SesChangeRef_t
 
typedef struct taf_diagSecurity_RxSecAccessMsg * taf_diagSecurity_RxSecAccessMsgRef_t
 
typedef struct taf_diagSecurity_RxSesTypeCheckHandler * taf_diagSecurity_RxSesTypeCheckHandlerRef_t
 
typedef struct taf_diagSecurity_SesChangeHandler * taf_diagSecurity_SesChangeHandlerRef_t
 
typedef struct taf_diagSecurity_RxSecAccessMsgHandler * taf_diagSecurity_RxSecAccessMsgHandlerRef_t
 
typedef void(* taf_diagSecurity_RxSesTypeHandlerFunc_t) (taf_diagSecurity_RxSesTypeCheckRef_t rxSesTypeRef, taf_diagSecurity_SessionType_t sesCtrlType, void *contextPtr)
 
typedef void(* taf_diagSecurity_SesChangeHandlerFunc_t) (taf_diagSecurity_SesChangeRef_t sesChangeRef, taf_diagSecurity_SessionType_t previousType, taf_diagSecurity_SessionType_t currentType, void *contextPtr)
 
typedef void(* taf_diagSecurity_RxSecAccessMsgHandlerFunc_t) (taf_diagSecurity_RxSecAccessMsgRef_t rxMsgRef, uint8_t accessType, void *contextPtr)
 

Enumerations

enum  taf_diagSecurity_SessionType_t {
  TAF_DIAGSECURITY_DEFAULT = 1, TAF_DIAGSECURITY_PROGRAMMING = 2, TAF_DIAGSECURITY_EXTENDED = 3, TAF_DIAGSECURITY_VEHICLE_MANUFACTURER_SPECIFIC = 64,
  TAF_DIAGSECURITY_FOTA = 66, TAF_DIAGSECURITY_SYSTEM_SUPPLIER_SPECIFIC = 96
}
 
enum  taf_diagSecurity_SesControlErrorCode_t { TAF_DIAGSECURITY_SES_CONTROL_NO_ERROR = 0, TAF_DIAGSECURITY_SES_CONTROL_CONDITIONS_NOT_CORRECT = 34 }
 
enum  taf_diagSecurity_SecAccessErrorCode_t { TAF_DIAGSECURITY_SEC_ACCESS_NO_ERROR = 0, TAF_DIAGSECURITY_SEC_ACCESS_CONDITIONS_NOT_CORRECT = 34, TAF_DIAGSECURITY_SEC_ACCESS_INVALID_KEY = 53 }
 

Functions

LE_SHARED bool ifgen_taf_diagSecurity_HasLocalBinding (void)
 
LE_SHARED void ifgen_taf_diagSecurity_InitCommonData (void)
 
LE_SHARED void ifgen_taf_diagSecurity_CleanupCommonData (le_msg_SessionRef_t _ifgen_sessionRef)
 
LE_SHARED le_result_t ifgen_taf_diagSecurity_OpenSession (le_msg_SessionRef_t _ifgen_sessionRef, bool isBlocking)
 
LE_SHARED taf_diagSecurity_ServiceRef_t ifgen_taf_diagSecurity_GetService (le_msg_SessionRef_t _ifgen_sessionRef)
 
LE_SHARED taf_diagSecurity_RxSesTypeCheckHandlerRef_t ifgen_taf_diagSecurity_AddRxSesTypeCheckHandler (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_ServiceRef_t svcRef, taf_diagSecurity_RxSesTypeHandlerFunc_t handlerPtr, void *contextPtr)
 
LE_SHARED void ifgen_taf_diagSecurity_RemoveRxSesTypeCheckHandler (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_RxSesTypeCheckHandlerRef_t handlerRef)
 
LE_SHARED le_result_t ifgen_taf_diagSecurity_SendSesTypeCheckResp (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_RxSesTypeCheckRef_t rxSesTypeRef, taf_diagSecurity_SesControlErrorCode_t errCode)
 
LE_SHARED taf_diagSecurity_SesChangeHandlerRef_t ifgen_taf_diagSecurity_AddSesChangeHandler (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_ServiceRef_t svcRef, taf_diagSecurity_SesChangeHandlerFunc_t handlerPtr, void *contextPtr)
 
LE_SHARED void ifgen_taf_diagSecurity_RemoveSesChangeHandler (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_SesChangeHandlerRef_t handlerRef)
 
LE_SHARED le_result_t ifgen_taf_diagSecurity_GetCurrentSesType (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_ServiceRef_t svcRef, taf_diagSecurity_SessionType_t *currentTypePtr)
 
LE_SHARED taf_diagSecurity_RxSecAccessMsgHandlerRef_t ifgen_taf_diagSecurity_AddRxSecAccessMsgHandler (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_ServiceRef_t svcRef, taf_diagSecurity_RxSecAccessMsgHandlerFunc_t handlerPtr, void *contextPtr)
 
LE_SHARED void ifgen_taf_diagSecurity_RemoveRxSecAccessMsgHandler (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_RxSecAccessMsgHandlerRef_t handlerRef)
 
LE_SHARED le_result_t ifgen_taf_diagSecurity_GetSecAccessPayloadLen (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_RxSecAccessMsgRef_t rxMsgRef, uint16_t *payloadLenPtr)
 
LE_SHARED le_result_t ifgen_taf_diagSecurity_GetSecAccessPayload (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_RxSecAccessMsgRef_t rxMsgRef, uint8_t *payloadPtr, size_t *payloadSizePtr)
 
LE_SHARED le_result_t ifgen_taf_diagSecurity_SendSecAccessResp (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_RxSecAccessMsgRef_t rxMsgRef, taf_diagSecurity_SecAccessErrorCode_t errCode, const uint8_t *dataPtr, size_t dataSize)
 
LE_SHARED le_result_t ifgen_taf_diagSecurity_RemoveSvc (le_msg_SessionRef_t _ifgen_sessionRef, taf_diagSecurity_ServiceRef_t svcRef)
 

Macro Definition Documentation

◆ IFGEN_TAF_DIAGSECURITY_PROTOCOL_ID

#define IFGEN_TAF_DIAGSECURITY_PROTOCOL_ID   "0a088790455849a5e5eca798ee6404d6"

◆ IFGEN_TAF_DIAGSECURITY_MSG_SIZE

#define IFGEN_TAF_DIAGSECURITY_MSG_SIZE   4115

◆ TAF_DIAGSECURITY_MAX_PAYLOAD_SIZE

#define TAF_DIAGSECURITY_MAX_PAYLOAD_SIZE   4095

The maximum size of the payload data in bytes.

◆ TAF_DIAGSECURITY_MAX_SEC_ACCESS_PAYLOAD_SIZE

#define TAF_DIAGSECURITY_MAX_SEC_ACCESS_PAYLOAD_SIZE   4093

The maximum size of the SecurityAccess request payload data in bytes.

Typedef Documentation

◆ taf_diagSecurity_ServiceRef_t

typedef struct taf_diagSecurity_Service* taf_diagSecurity_ServiceRef_t

Reference to the security service.

◆ taf_diagSecurity_RxSesTypeCheckRef_t

typedef struct taf_diagSecurity_RxSesTypeCheck* taf_diagSecurity_RxSesTypeCheckRef_t

Reference to the SessionControl received request message.

◆ taf_diagSecurity_SesChangeRef_t

typedef struct taf_diagSecurity_SesChange* taf_diagSecurity_SesChangeRef_t

Reference to the Session change message.

◆ taf_diagSecurity_RxSecAccessMsgRef_t

typedef struct taf_diagSecurity_RxSecAccessMsg* taf_diagSecurity_RxSecAccessMsgRef_t

Reference to the SecurityAccess received request message.

◆ taf_diagSecurity_RxSesTypeCheckHandlerRef_t

typedef struct taf_diagSecurity_RxSesTypeCheckHandler* taf_diagSecurity_RxSesTypeCheckHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'taf_diagSecurity_RxSesTypeCheck'

◆ taf_diagSecurity_SesChangeHandlerRef_t

typedef struct taf_diagSecurity_SesChangeHandler* taf_diagSecurity_SesChangeHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'taf_diagSecurity_SesChange'

◆ taf_diagSecurity_RxSecAccessMsgHandlerRef_t

typedef struct taf_diagSecurity_RxSecAccessMsgHandler* taf_diagSecurity_RxSecAccessMsgHandlerRef_t

Reference type used by Add/Remove functions for EVENT 'taf_diagSecurity_RxSecAccessMsg'

◆ taf_diagSecurity_RxSesTypeHandlerFunc_t

typedef void(* taf_diagSecurity_RxSesTypeHandlerFunc_t) (taf_diagSecurity_RxSesTypeCheckRef_t rxSesTypeRef, taf_diagSecurity_SessionType_t sesCtrlType, void *contextPtr)

Handler for a Rx session control type.

◆ taf_diagSecurity_SesChangeHandlerFunc_t

typedef void(* taf_diagSecurity_SesChangeHandlerFunc_t) (taf_diagSecurity_SesChangeRef_t sesChangeRef, taf_diagSecurity_SessionType_t previousType, taf_diagSecurity_SessionType_t currentType, void *contextPtr)

Handler for a session control type change.

◆ taf_diagSecurity_RxSecAccessMsgHandlerFunc_t

typedef void(* taf_diagSecurity_RxSecAccessMsgHandlerFunc_t) (taf_diagSecurity_RxSecAccessMsgRef_t rxMsgRef, uint8_t accessType, void *contextPtr)

Handler for a Rx security access message.

Enumeration Type Documentation

◆ taf_diagSecurity_SessionType_t

Diagnostic SessionControl type.

Enumerator
TAF_DIAGSECURITY_DEFAULT 

Default session.

TAF_DIAGSECURITY_PROGRAMMING 

Programming session.

TAF_DIAGSECURITY_EXTENDED 

Extended diagnostic session.

TAF_DIAGSECURITY_VEHICLE_MANUFACTURER_SPECIFIC 

Vehicle manufacture specific session.

TAF_DIAGSECURITY_FOTA 

Fota session.

TAF_DIAGSECURITY_SYSTEM_SUPPLIER_SPECIFIC 

System supplier specific session.

◆ taf_diagSecurity_SesControlErrorCode_t

Error code for SessionControl.

Enumerator
TAF_DIAGSECURITY_SES_CONTROL_NO_ERROR 
TAF_DIAGSECURITY_SES_CONTROL_CONDITIONS_NOT_CORRECT 

◆ taf_diagSecurity_SecAccessErrorCode_t

Error code for SecurityAccess.

Enumerator
TAF_DIAGSECURITY_SEC_ACCESS_NO_ERROR 
TAF_DIAGSECURITY_SEC_ACCESS_CONDITIONS_NOT_CORRECT 
TAF_DIAGSECURITY_SEC_ACCESS_INVALID_KEY 

Function Documentation

◆ ifgen_taf_diagSecurity_HasLocalBinding()

LE_SHARED bool ifgen_taf_diagSecurity_HasLocalBinding ( void  )

Get if this client bound locally.

◆ ifgen_taf_diagSecurity_InitCommonData()

LE_SHARED void ifgen_taf_diagSecurity_InitCommonData ( void  )

Init data that is common across all threads

◆ ifgen_taf_diagSecurity_CleanupCommonData()

LE_SHARED void ifgen_taf_diagSecurity_CleanupCommonData ( le_msg_SessionRef_t  _ifgen_sessionRef)

Cleanup the data of a session

◆ ifgen_taf_diagSecurity_OpenSession()

LE_SHARED le_result_t ifgen_taf_diagSecurity_OpenSession ( le_msg_SessionRef_t  _ifgen_sessionRef,
bool  isBlocking 
)

Perform common initialization and open a session

◆ ifgen_taf_diagSecurity_GetService()

LE_SHARED taf_diagSecurity_ServiceRef_t ifgen_taf_diagSecurity_GetService ( le_msg_SessionRef_t  _ifgen_sessionRef)

Gets the reference of a security service. If there is no security service, a new one will be created.

Returns
  • Reference to the service instance.
  • NULL if not allowed to create the service.
Note
The process exits if an invalid reference is passed.

◆ ifgen_taf_diagSecurity_AddRxSesTypeCheckHandler()

LE_SHARED taf_diagSecurity_RxSesTypeCheckHandlerRef_t ifgen_taf_diagSecurity_AddRxSesTypeCheckHandler ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_ServiceRef_t  svcRef,
taf_diagSecurity_RxSesTypeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_diagSecurity_RxSesTypeCheck'

This event provides information on Rx session control type.

Parameters
[in]svcRefService reference.
[in]handlerPtrReceived message handler.
[in]contextPtr

◆ ifgen_taf_diagSecurity_RemoveRxSesTypeCheckHandler()

LE_SHARED void ifgen_taf_diagSecurity_RemoveRxSesTypeCheckHandler ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_RxSesTypeCheckHandlerRef_t  handlerRef 
)

Remove handler function for EVENT 'taf_diagSecurity_RxSesTypeCheck'

Parameters
[in]handlerRef

◆ ifgen_taf_diagSecurity_SendSesTypeCheckResp()

LE_SHARED le_result_t ifgen_taf_diagSecurity_SendSesTypeCheckResp ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_RxSesTypeCheckRef_t  rxSesTypeRef,
taf_diagSecurity_SesControlErrorCode_t  errCode 
)

Sends a response message for the condition check of Rx session control type.

Note
This function must be called to send a response if receiving a message.
Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid rxMsgRef.
  • LE_NOT_FOUND – Reference not found.
  • LE_FAULT – Failed.
Note
The process exits if an invalid reference is passed.
Parameters
[in]rxSesTypeRefReceived session type reference.
[in]errCodeError code type.

◆ ifgen_taf_diagSecurity_AddSesChangeHandler()

LE_SHARED taf_diagSecurity_SesChangeHandlerRef_t ifgen_taf_diagSecurity_AddSesChangeHandler ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_ServiceRef_t  svcRef,
taf_diagSecurity_SesChangeHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_diagSecurity_SesChange'

This event provides information on session control type change.

Parameters
[in]svcRefService reference.
[in]handlerPtrReceived message handler.
[in]contextPtr

◆ ifgen_taf_diagSecurity_RemoveSesChangeHandler()

LE_SHARED void ifgen_taf_diagSecurity_RemoveSesChangeHandler ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_SesChangeHandlerRef_t  handlerRef 
)

Remove handler function for EVENT 'taf_diagSecurity_SesChange'

Parameters
[in]handlerRef

◆ ifgen_taf_diagSecurity_GetCurrentSesType()

LE_SHARED le_result_t ifgen_taf_diagSecurity_GetCurrentSesType ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_ServiceRef_t  svcRef,
taf_diagSecurity_SessionType_t currentTypePtr 
)

Gets the current session control type.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid svcRef.
  • LE_NOT_FOUND – Reference not found.
Note
The process exits if an invalid reference is passed.
Parameters
[in]svcRefService reference.
[out]currentTypePtrCurrent session control type.

◆ ifgen_taf_diagSecurity_AddRxSecAccessMsgHandler()

LE_SHARED taf_diagSecurity_RxSecAccessMsgHandlerRef_t ifgen_taf_diagSecurity_AddRxSecAccessMsgHandler ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_ServiceRef_t  svcRef,
taf_diagSecurity_RxSecAccessMsgHandlerFunc_t  handlerPtr,
void *  contextPtr 
)

Add handler function for EVENT 'taf_diagSecurity_RxSecAccessMsg'

This event provides information about the Rx security access message.

Parameters
[in]svcRefService reference.
[in]handlerPtrReceived message handler.
[in]contextPtr

◆ ifgen_taf_diagSecurity_RemoveRxSecAccessMsgHandler()

LE_SHARED void ifgen_taf_diagSecurity_RemoveRxSecAccessMsgHandler ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_RxSecAccessMsgHandlerRef_t  handlerRef 
)

Remove handler function for EVENT 'taf_diagSecurity_RxSecAccessMsg'

Parameters
[in]handlerRef

◆ ifgen_taf_diagSecurity_GetSecAccessPayloadLen()

LE_SHARED le_result_t ifgen_taf_diagSecurity_GetSecAccessPayloadLen ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_RxSecAccessMsgRef_t  rxMsgRef,
uint16_t *  payloadLenPtr 
)

Gets the payload length of the Rx security access message.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid rxMsgRef.
  • LE_NOT_FOUND – Reference not found.
Note
The process exits if an invalid reference is passed.
Parameters
[in]rxMsgRefReceived message reference.
[out]payloadLenPtrSecurity access payload length.

◆ ifgen_taf_diagSecurity_GetSecAccessPayload()

LE_SHARED le_result_t ifgen_taf_diagSecurity_GetSecAccessPayload ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_RxSecAccessMsgRef_t  rxMsgRef,
uint8_t *  payloadPtr,
size_t *  payloadSizePtr 
)

Gets the payload of the Rx security access message. The payload can be either securityAccessDataRecord or securityKey based on request accessType.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid rxMsgRef.
  • LE_OVERFLOW – Payload size is too small.
  • LE_NOT_FOUND – Reference not found.
Note
The process exits if an invalid reference is passed.
Parameters
[in]rxMsgRefReceived message reference.
[out]payloadPtrSecurity access payload.
[in,out]payloadSizePtr

◆ ifgen_taf_diagSecurity_SendSecAccessResp()

LE_SHARED le_result_t ifgen_taf_diagSecurity_SendSecAccessResp ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_RxSecAccessMsgRef_t  rxMsgRef,
taf_diagSecurity_SecAccessErrorCode_t  errCode,
const uint8_t *  dataPtr,
size_t  dataSize 
)

Sends a response message for the Rx security access message.

Note
This function must be called to send a response if receiving a message.
Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid rxMsgRef.
  • LE_NOT_FOUND – Reference not found.
  • LE_FAULT – Failed.
Note
The process exits if an invalid reference is passed.
Parameters
[in]rxMsgRefReceived message reference.
[in]errCodeError code type.
[in]dataPtrPayload data.
[in]dataSize

◆ ifgen_taf_diagSecurity_RemoveSvc()

LE_SHARED le_result_t ifgen_taf_diagSecurity_RemoveSvc ( le_msg_SessionRef_t  _ifgen_sessionRef,
taf_diagSecurity_ServiceRef_t  svcRef 
)

Removes the security service.

Returns
  • LE_OK – Succeeded.
  • LE_BAD_PARAMETER – Invalid svcRef.
Parameters
[in]svcRefService reference.