#ifndef _UDS_FBL_SERVICE_31_SOURCE #define _UDS_FBL_SERVICE_31_SOURCE /******************************************************************************* ** Include Section ** *******************************************************************************/ #include "uds_fbl_mgr.h" #include "uds_fbl_service31.h" #include "uds_fbl_service11.h" #include "../cantp/CanTp.h" #include "../app/bl_flash.h" /******************************************************************************* ** Version Information ** *******************************************************************************/ /******************************************************************************* ** Version Check ** *******************************************************************************/ /******************************************************************************* ** Macro definition ** *******************************************************************************/ static uint8_t u8_g_checkroutineflag = FALSE; static uint8_t u8_g_checkdependflag = FALSE; static uint8_t driver_valid = FALSE; extern void JumpToApp(void); extern void SysDeInit(void); /******************************************************************************* ** Global Data ** *******************************************************************************/ #define START_ROUTINE 0x01 #define ALL_FLAGERASE_ADDR 0x00026000U #define ALL_FLAGSTART_ADDR 0x00027FF0U #define APPVALIDFLAG_INDEX 0x04 #define CODVALIDFLAG_INDEX 0x08 #define FBLVALIDFLAG_INDEX 0x0C #define UPDATEFLAG_SUCC 0x00 #define UPDATEFLAG_FAIL 0x01 #define DEFAULT_DID 0x00 const uds_nrc nrc_310202[4] = { UDSsecurityAccessDenied,\ UDSsubfunctionNotSupported,\ UDSincorrectMessageLengthOrInvalidFormat,\ UDSconditionNotCorrect }; const uds_nrc nrc_310203[4] = { UDSsecurityAccessDenied,\ UDSsubfunctionNotSupported,\ UDSincorrectMessageLengthOrInvalidFormat,\ UDSconditionNotCorrect }; const uds_nrc nrc_31ff00[5] = { UDSsecurityAccessDenied,\ UDSsubfunctionNotSupported,\ UDSincorrectMessageLengthOrInvalidFormat,\ UDSrequestOutOfRange,\ UDSconditionNotCorrect }; const uds_nrc nrc_31ff01[3] = { UDSsecurityAccessDenied,\ UDSsubfunctionNotSupported,\ UDSincorrectMessageLengthOrInvalidFormat }; /*--------- <0x31> sub function config start-------------*/ static const DIAG_sunfunction_t SessionSubfunction[] = { {0x0202,2,true ,6 ,4,NULL,{nrc_310202, 4}}, {0x0203,6,false,4 ,4,NULL,{nrc_310203, 4}}, {0xFF00,2,true ,12 ,4,NULL,{nrc_31ff00, 5}}, {0xFF01,2,true ,4 ,4,NULL,{nrc_31ff01, 3}} }; /*--------- <0x31>sub function config end---------------*/ FLASH_BLOCK_INFO FlashProgramInfo[FLASH_PROGRAM_TYPE] = { {FLASH_FBL, FALSE, FALSE}, {FLASH_APPL, FALSE, FALSE} }; /*-------------------------------------------------------*/ /******************************************************************************* ** Function Definitions ** *******************************************************************************/ void service31_Set_Program_Info(uint8_t type, uint8_t download_sts, uint8_t check_sts); static bool Check_Nrc_12_Of_Service31(uint8_t routineControlType); static bool Check_Nrc_13_Of_Service31(uint16_t sourceLength, uint16_t targetLength); static bool Check_Nrc_22_Of_Service31(uint16_t routineId, uint8_t curr_session, uint8_t session_mask); static bool Check_Nrc_31_Of_Service31(UDSpacket_t* qUDSpacket); static uint8_t udsFbl_service31ProgrmValidFlag(uint32_t startaddr,uint32_t validflag,uint8_t flash_type,uint32_t FlagSectorStartAddr); void service31_Set_Program_Info(uint8_t type, uint8_t download_sts, uint8_t check_sts) { switch(type) { case MEM_FLASHDRIVER: if((download_sts == TRUE) && (check_sts == TRUE)) { driver_valid = TRUE; } else { driver_valid = FALSE; } break; case MEM_FBL: FlashProgramInfo[MEM_FBL].download_sts = download_sts; FlashProgramInfo[MEM_FBL].checkmemory_sts = check_sts; break; case MEM_CAL_APP: FlashProgramInfo[MEM_CAL_APP].download_sts = download_sts; FlashProgramInfo[MEM_CAL_APP].checkmemory_sts = check_sts; break; default: break; } } /*===============================================================================================*/ /* static bool Check_Nrc_12_Of_Service31(uint8_t routineControlType) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: Check $31 sub-function validity */ /* Arguments: routineControlType : routine control type */ /* Return: Yes or No */ /*===============================================================================================*/ static bool Check_Nrc_12_Of_Service31(uint8_t routineControlType) { if (routineControlType != START_ROUTINE) { return true; } else { return false; } } /*===============================================================================================*/ /* static bool Check_Nrc_13_Of_Service31(uint16_t sourceLength, uint16_t targetLength) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: Check if the length of the service request is wrong */ /* Arguments: sourceLength : Actual service request length */ /* targetLength : Expected service request length */ /* Return: Yes or No */ /*===============================================================================================*/ static bool Check_Nrc_13_Of_Service31(uint16_t sourceLength, uint16_t targetLength) { if (sourceLength != targetLength) { return true; } else { return false; } } /*=========================================================================================================*/ /* static bool Check_Nrc_22_Of_Service31(uint16_t routineId, uint16_t sourceLength, uint16_t targetLength) */ /* --------------------------------------------------------------------------------------------------------*/ /* Function: Check whether the conditions are Correct */ /* Arguments: curr_session : current session */ /* session_mask : session mask */ /* Return: Yes or No */ /*=========================================================================================================*/ static bool Check_Nrc_22_Of_Service31(uint16_t routineId, uint8_t curr_session, uint8_t session_mask) { bool result; uint8_t dl_finished; dl_finished = udsFbl_Get_DownloadStatus(); if ((curr_session & session_mask) == 0) { result = true; } else { if((routineId == 0xFF00) && (driver_valid == FALSE)) /* before erase should download driver */ { result = true; } else if((routineId == 0x0202) && (dl_finished == FALSE)) { result =true; /* before check memory should finish dl data */ } else { result = false; } } return result; } /*===============================================================================================*/ /* static bool Check_Nrc_31_Of_Service31(uint16_t rid, UDSpacket_t* qUDSpacket) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: Check if the service request out of range */ /* Arguments: rid : routine identifer */ /* qUDSpacket : CAN message structure pointer */ /* Return: Yes or No */ /*===============================================================================================*/ static bool Check_Nrc_31_Of_Service31(UDSpacket_t* qUDSpacket) { uint8_t addrFormat_u8 = 0; /* address Format Identifier */ uint8_t lenFormat_u8 = 0; /* Length Format Identifier */ uint32_t addr_u32 = 0; uint32_t len_u32 = 0; uint8_t formatIndex_u8 = 0; MEM_TYPE memtype; bool result = false; addrFormat_u8 = 4; lenFormat_u8 = 4; /* Get address */ for(formatIndex_u8=addrFormat_u8;formatIndex_u8>0;formatIndex_u8--) { addr_u32 |= ((((uint32_t)qUDSpacket->Data.Byte[formatIndex_u8+3])&0x000000ff) << (addrFormat_u8-formatIndex_u8)*8); } /* Get length */ for(formatIndex_u8=lenFormat_u8+addrFormat_u8;formatIndex_u8>addrFormat_u8;formatIndex_u8--) { len_u32 |= ((((uint32_t)qUDSpacket->Data.Byte[formatIndex_u8+3])&0x000000ff) << (lenFormat_u8+addrFormat_u8-formatIndex_u8)*8); } memtype = MEM_GetType(addr_u32, len_u32); if(memtype == MEM_ERROR) { result = true; } else { if((memtype == MEM_CAL_APP) && ((addr_u32 != COD_APPL_ADDR_START) || (len_u32 != MEM_COD_APP_LEN))) { result = true; } else if((memtype == MEM_FBL) && ((addr_u32 != FLU_FBL_ADDR_START_OnApp) || (len_u32 != MEM_FBL_LEN))) { result = true; } else { /* do nothing */ } } return result; } /*===============================================================================================*/ /* uds_nrc UdsFbl_CheckProgrammingIntegrity(UDSpacket_t* qUDSpacket) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: Handle $31 $01 $0202 service */ /* Arguments: qUDSpacket : CAN message structure pointer */ /* Return: Yes or No */ /*===============================================================================================*/ uds_nrc UdsFbl_CheckProgrammingIntegrity(UDSpacket_t* qUDSpacket) { u8_g_checkroutineflag = TRUE; /* 31 01 02 02 routine only used for Flash Driver download check */ udsFbl_StartTimer(TIMER_UDS_ROUTINE); return UDSreqCorrectlyRx_RespPending; } /*===============================================================================================*/ /* void verifyFlsDrv(void) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: verify hash with signature */ /* Arguments: - */ /* Return: - */ /*===============================================================================================*/ void verifyFlsDrv(void) { uint8_t transdata[4]; uint8_t curr_memtype; transdata[0] = 0x71; /* response data */ transdata[1] = 0x01; transdata[2] = 0x02; transdata[3] = 0x02; curr_memtype = udsFbl_Get_Curr_Download_Type(); /* In PC Tester side Flash Driver CRC16 Verify passed */ network_send_udsmsg(transdata,4); udsFbl_StartTimer(TIMER_UDS_SESSION); service31_Set_Program_Info(curr_memtype,TRUE,TRUE); if(curr_memtype == MEM_FLASHDRIVER) { InitFlashDrvAPI(); /*Update Finger printer into Data Flash*/ Dataflash_Common_Write(DEFAULT_DID,TRUE); } udsFbl_StopTimer(TIMER_UDS_ROUTINE); } /*===============================================================================================*/ /* uds_nrc UdsFbl_checkProgrammingPreconditions(UDSpacket_t* qUDSpacket) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: Handle $31 $01 $0203 service */ /* Arguments: qUDSpacket : CAN message structure pointer */ /* Return: Yes or No */ /*===============================================================================================*/ uds_nrc UdsFbl_checkProgrammingPreconditions(UDSpacket_t* qUDSpacket) { qUDSpacket->Data.Byte[0] = UDS_GET_POSITIVE_RSP(qUDSpacket->Data.Byte[0]); qUDSpacket->Data.Byte[4] = 0x00; return UDSpositiveResp; } /*==========================================================================================================*/ /* static uint8_t udsFbl_service31ProgrmValidFlag(uint32_t startaddr,uint32_t validflag,uint8_t flash_type,uint32_t FlagSectorStartAddr) */ /* ---------------------------------------------------------------------------------------------------------*/ /* Function: write valid flag and version number */ /* Arguments: startaddr :valid flag start address */ /* Arguments: validflag :valid flag */ /* Arguments: flash_type :flash type */ /* Return: Yes or No */ /*==========================================================================================================*/ static uint8_t udsFbl_service31ProgrmValidFlag(uint32_t startaddr,uint32_t validflag,uint8_t flash_type,uint32_t FlagSectorStartAddr) { uint8_t result; uint8_t u8Index; uint8_t ValidFlagTemp[16] = {0xFF}; result = UPDATEFLAG_SUCC; for (u8Index = 0; u8Index < 16; u8Index++) { /*Read FBL/APP/CODING flag from Code Flash*/ ValidFlagTemp[u8Index] = *((uint32_t *)(ALL_FLAGSTART_ADDR + u8Index));; } if((flash_type == FLASH_APPL) || (flash_type == FLASH_FBL)) { ValidFlagTemp[APPVALIDFLAG_INDEX] = (uint8_t)((validflag >> 24)& 0xFF); ValidFlagTemp[APPVALIDFLAG_INDEX + 1] = (uint8_t)((validflag >> 16)& 0xFF); ValidFlagTemp[APPVALIDFLAG_INDEX + 2] = (uint8_t)((validflag >> 8)& 0xFF); ValidFlagTemp[APPVALIDFLAG_INDEX + 3] = (uint8_t)((validflag >> 0)& 0xFF); } else { /* do nothing */ } /*Must Erase one Sector before Writing*/ if(FlashEraseSector(FlagSectorStartAddr) != SUCC) { result = UPDATEFLAG_FAIL; } if(FlashWriteWithPadding(ValidFlagTemp,16,startaddr) != SUCC) { result = UPDATEFLAG_FAIL; } return result; } /*===============================================================================================*/ /* uds_nrc UdsFbl_checkProgrammingDependencies(UDSpacket_t* qUDSpacket) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: Handle $31 $01 $FF01 service */ /* Arguments: qUDSpacket : CAN message structure pointer */ /* Return: Yes or No */ /*===============================================================================================*/ uds_nrc UdsFbl_checkProgrammingDependencies(UDSpacket_t* qUDSpacket) { u8_g_checkdependflag = TRUE; udsFbl_StartTimer(TIMER_UDS_DEPENDENCY); return UDSreqCorrectlyRx_RespPending; } /*===============================================================================================*/ /* void CheckDependencies(void) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: check programming dependencies */ /* Arguments: - */ /* Return: - */ /*===============================================================================================*/ void CheckDependencies(void) { uint8_t curr_memtype; uint8_t rspdata[4]; uint8_t transdata_temp[3]; /* response data */ rspdata[0] = 0x71; rspdata[1] = 0x01; rspdata[2] = 0xFF; rspdata[3] = 0x01; /*When we received check dependencies routine, it means CRC16 verify passed on PC Tester side*/ curr_memtype = udsFbl_Get_Curr_Download_Type(); if(curr_memtype == MEM_FBL) { udsFbl_service31ProgrmValidFlag(ALL_VALID_FLAG_STARTADDR,APPL_VALID_FLAG,FLASH_FBL,ALL_FLAGERASE_ADDR); /* set flu/APP valid flag */ service31_Set_Program_Info(curr_memtype,FALSE,FALSE); /*Whether we need send 7F 31 78 to Tester before we jump to FLU???*/ transdata_temp[0] = 0x7F; transdata_temp[1] = 0x31; transdata_temp[2] = 0x78; network_send_udsmsg(transdata_temp,3); /*when finished FLU+FBL flash and set FLU flag to valid,then from old FBL jump directly to FLU*/ SysDeInit(); JumpToApp();/*FLU use same start address with APP*/ } if(curr_memtype == MEM_CAL_APP) { /*This case means both APP and coding been flashed and CRC16 verify passed, we should set valid flag for both Coding and APP*/ udsFbl_service31ProgrmValidFlag(ALL_VALID_FLAG_STARTADDR,APPL_VALID_FLAG,FLASH_APPL,ALL_FLAGERASE_ADDR); /* set coding and app valid flag */ service31_Set_Program_Info(curr_memtype,FALSE,FALSE); } network_send_udsmsg(rspdata,4); udsFbl_StartTimer(TIMER_UDS_SESSION); udsFbl_StopTimer(TIMER_UDS_DEPENDENCY); } /*===============================================================================================*/ /* uds_nrc UdsFbl_eraseMemory(UDSpacket_t* qUDSpacket) */ /* ----------------------------------------------------------------------------------------------*/ /* Function: Handle $31 $01 $FF00 service */ /* Arguments: qUDSpacket : CAN message structure pointer */ /* Return: Yes or No */ /*===============================================================================================*/ uds_nrc UdsFbl_eraseMemory(UDSpacket_t* qUDSpacket) { /* Decompose the data, take out the address and length */ uint8_t addrFormat_u8 = 0; /* address Format Identifier */ uint8_t lenFormat_u8 = 0; /* Length Format Identifier */ uint32_t addr_u32 = 0; uint32_t len_u32 = 0; uint8_t formatIndex_u8 = 0; uds_nrc returnType = 0x00; addrFormat_u8 = 4; lenFormat_u8 = 4; /* Get address */ for(formatIndex_u8=addrFormat_u8;formatIndex_u8>0;formatIndex_u8--) { addr_u32 |= ((((uint32_t)qUDSpacket->Data.Byte[formatIndex_u8+3])&0x000000ff) << (addrFormat_u8-formatIndex_u8)*8); } /* Get length */ for(formatIndex_u8=lenFormat_u8+addrFormat_u8;formatIndex_u8>addrFormat_u8;formatIndex_u8--) { len_u32 |= ((((uint32_t)qUDSpacket->Data.Byte[formatIndex_u8+3])&0x000000ff) << (lenFormat_u8+addrFormat_u8-formatIndex_u8)*8); } /*Cy_SysTick_Disable(); NVIC_DisableIRQ(CPUIntIdx2_IRQn); */ /* disable cantp interrupt */ if ((FLU_FBL_ADDR_START_OnApp == addr_u32)&&(len_u32 == MEM_FBL_LEN)) { udsFbl_Set_FlashProgram_Type(FLASH_FBL); returnType = MEM_Erase(FLU_FBL_ADDR_START_OnApp,MEM_FBL_LEN); /* erase the whole APP flash area */ } else if((COD_APPL_ADDR_START == addr_u32)&&(len_u32 == MEM_COD_APP_LEN)) { udsFbl_Set_FlashProgram_Type(FLASH_APPL); returnType = MEM_Erase(COD_APPL_ADDR_START,MEM_COD_APP_LEN); /* erase APPL code flash */ } else { returnType = UDSrequestOutOfRange; /* request address invalid */ } /*NVIC_EnableIRQ(CPUIntIdx2_IRQn); Cy_SysTick_Enable();*/ if(UDSreqCorrectlyRx_RespPending == returnType) { udsFbl_StartTimer(TIMER_UDS_ERASE); } else if(UDSpositiveResp == returnType) { qUDSpacket->Data.Byte[0] = UDS_GET_POSITIVE_RSP(qUDSpacket->Data.Byte[0]); qUDSpacket->Data.Byte[4] = 0x00; } else { /* do nothing */ } return returnType; } /********************************************************************************************* * Prototype * uds_nrc service31_nrc_check(UDSpacket_t* qUDSpacket) * Parameter * parameter [in] : * * Return code * return * * Functional Description * * Particularities and Limitations * * Expected Caller Context * *********************************************************************************************/ uds_nrc service31_nrc_check(UDSpacket_t* qUDSpacket) { uds_nrc returnType = 0; uint8_t const kwpdiag_num = (sizeof(SessionSubfunction)/sizeof(DIAG_sunfunction_t)); uint8_t index = 0; uint16_t routineId = 0; uint8_t index_nrc = 0; uint8_t subFunc = qUDSpacket->Data.Byte[1]; uint8_t currentSession = 0; if(qUDSpacket->size < 4) { returnType = UDSincorrectMessageLengthOrInvalidFormat; } else { routineId = (((uint16_t)qUDSpacket->Data.Byte[2])<<8); routineId |= ((uint16_t)qUDSpacket->Data.Byte[3]); for(index = 0; index < kwpdiag_num; index++) { if(routineId == SessionSubfunction[index].sub_requestsid) { break; } } if(index < kwpdiag_num) { nrc_table_t nrc_table = SessionSubfunction[index].nrc_table; uint16_t length = SessionSubfunction[index].rx_dataLen; currentSession = udsFbl_GetCurrentSessionMode(); for (index_nrc = 0; (index_nrc < nrc_table.nrc_cnt) && (returnType == 0); index_nrc++) { switch (nrc_table.nrc_list[index_nrc]) { case UDSsecurityAccessDenied: if (Uds_Nrc33_Occur(routineId, SessionSubfunction, kwpdiag_num)) { returnType = UDSsecurityAccessDenied; } break; case UDSsubfunctionNotSupported: if (Check_Nrc_12_Of_Service31(subFunc)) { returnType = UDSsubfunctionNotSupported; } break; case UDSincorrectMessageLengthOrInvalidFormat: if (Check_Nrc_13_Of_Service31(qUDSpacket->size, length)) { returnType = UDSincorrectMessageLengthOrInvalidFormat; } break; case UDSconditionNotCorrect: if (Check_Nrc_22_Of_Service31(routineId,currentSession, SessionSubfunction[index].session_mask)) { returnType = UDSconditionNotCorrect; } break; case UDSrequestOutOfRange: if (Check_Nrc_31_Of_Service31(qUDSpacket)) { returnType = UDSrequestOutOfRange; } break; default: break; } } } else { returnType = UDSrequestOutOfRange; } } return returnType; /* return prioritiest nrc*/ } /********************************************************************************************* * Prototype * uint8_t ApplDiagStartRoutineByLocaldentifier_31(UDSpacket_t* qUDSpacket) * Parameter * pdiagdata [in] : * diagrequestlength [in] : * * Functional Description * * Particularities and Limitations * * Expected Caller Context * *********************************************************************************************/ uint8_t ApplDiagStartRoutineByLocaldentifier_31(UDSpacket_t* qUDSpacket) { uds_nrc returnType = 0; uint16_t routineId = 0; routineId = (((uint16_t)qUDSpacket->Data.Byte[2])<<8); routineId |= ((uint16_t)qUDSpacket->Data.Byte[3]); returnType = service31_nrc_check(qUDSpacket); if (UDSpositiveResp == returnType) { switch (routineId) { case 0x0202: returnType = UdsFbl_CheckProgrammingIntegrity(qUDSpacket); qUDSpacket->size = 4; break; case 0x0203: returnType = UdsFbl_checkProgrammingPreconditions(qUDSpacket); qUDSpacket->size = 5; break; case 0xFF00: returnType = UdsFbl_eraseMemory(qUDSpacket); qUDSpacket->size = 5; break; case 0xFF01: returnType = UdsFbl_checkProgrammingDependencies(qUDSpacket); qUDSpacket->size = 4; break; default: break; } } return returnType; } /*==============================================================================================================*/ /* void eraseCounterCheck(uint16_t* pEraseCounter) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: flash erase counter check */ /* Arguments: pEraseCounter:erase counter */ /* Return: - */ /*==============================================================================================================*/ void eraseCounterCheck(uint16_t* pEraseCounter) { if((*pEraseCounter)) { if((*pEraseCounter) == 1) { eraseSendPendingRsp(); } else { (*pEraseCounter)--; } } else { /* do nothing */ } } /*==============================================================================================================*/ /* void eraseSendPendingRsp(void) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: erase not finish, send pending response */ /* Arguments: - */ /* Return: - */ /*==============================================================================================================*/ void eraseSendPendingRsp(void) { udsFbl_StartTimer(TIMER_UDS_ERASE); uint8_t transdata[3]; transdata[0] = NEGATIVE_RSP; transdata[1] = 0x31; transdata[2] = 0x78; network_send_udsmsg(transdata,3); } /*==============================================================================================================*/ /* void checkRoutineCounterCheck(uint16_t *pcheckRoutineCounter) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: check memory counter check */ /* Arguments: pcheckRoutineCounter : check memory counter */ /* Return: - */ /*==============================================================================================================*/ void checkRoutineCounterCheck(uint16_t *pcheckRoutineCounter) { if((*pcheckRoutineCounter)) { if((*pcheckRoutineCounter) == 1) { checkRoutineSendPendingRsp(); } else { (*pcheckRoutineCounter)--; } } else { /* do nothing */ } } /*==============================================================================================================*/ /* void checkRoutineSendPendingRsp(void) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: check memory not finish,send pending response */ /* Arguments: - */ /* Return: - */ /*==============================================================================================================*/ void checkRoutineSendPendingRsp(void) { udsFbl_StartTimer(TIMER_UDS_ROUTINE); uint8_t transdata[3]; transdata[0] = 0x7F; transdata[1] = 0x31; transdata[2] = 0x78; network_send_udsmsg(transdata,3); } /*==============================================================================================================*/ /* void checkDependCounterCheck(uint16_t *pcheckDependCounter) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: check dependencies counter check */ /* Arguments: pcheckDependCounter : check dependencies counter */ /* Return: - */ /*==============================================================================================================*/ void checkDependCounterCheck(uint16_t *pcheckDependCounter) { if((*pcheckDependCounter)) { if((*pcheckDependCounter) == 1) { checkDependSendPendingRsp(); } else { (*pcheckDependCounter)--; } } else { /* do nothing */ } } /*==============================================================================================================*/ /* void checkDependSendPendingRsp(void) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: check dependencies not finish,send pending response */ /* Arguments: - */ /* Return: - */ /*==============================================================================================================*/ void checkDependSendPendingRsp(void) { udsFbl_StartTimer(TIMER_UDS_DEPENDENCY); uint8_t transdata[3]; transdata[0] = 0x7F; transdata[1] = 0x31; transdata[2] = 0x78; network_send_udsmsg(transdata,3); } /*==============================================================================================================*/ /* void setCheckRoutineInfo(uint8_t checkroutineinfo) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: set check memory process flag */ /* Arguments: checkroutineinfo:check memory flag */ /* Return: - */ /*==============================================================================================================*/ void setCheckRoutineInfo(uint8_t checkroutineinfo) { u8_g_checkroutineflag = checkroutineinfo; } /*==============================================================================================================*/ /* uint8_t getCheckRoutineInfo(void) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: get check memory process flag */ /* Arguments: - */ /* Return: - */ /*==============================================================================================================*/ uint8_t getCheckRoutineInfo(void) { return u8_g_checkroutineflag; } /*==============================================================================================================*/ /* void setCheckDependInfo(uint8_t checkDependinfo) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: set check dependencies process flag */ /* Arguments: checkDependinfo:check dependencies flag */ /* Return: - */ /*==============================================================================================================*/ void setCheckDependInfo(uint8_t checkDependinfo) { u8_g_checkdependflag = checkDependinfo; } /*==============================================================================================================*/ /* uint8_t getCheckDependInfo(void) */ /* -------------------------------------------------------------------------------------------------------------*/ /* Function: get check dependencies process flag */ /* Arguments: - */ /* Return: - */ /*==============================================================================================================*/ uint8_t getCheckDependInfo(void) { return u8_g_checkdependflag; } /******************************************************************************* ** End of File ** *******************************************************************************/ #endif /*_UDS_FBL_SERVICE_31_SOURCE*/