AppFunc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /****************************************************************************
  2. *
  3. * Copy right: RL.Chen J and Zhen C
  4. * File name: AppFunc.h
  5. * Description: 应用层函数调用文件
  6. * History: 2021-07-15
  7. * Version: V3.0
  8. ****************************************************************************/
  9. #include "hal_module_adapter.h"
  10. #include "flash_ec616_rt.h"
  11. #include "commontypedef.h"
  12. #include "flash_ec616_rt.h"
  13. #include "mem_map.h"
  14. #include "AppConfig.h"
  15. #include "ec_tcpip_api.h"
  16. #include "AppSignal.h"
  17. typedef struct _Fota_Type
  18. {
  19. BOOL Fota_update_error ;
  20. UINT32 Fota_All_Data_Len ;
  21. UINT32 Fota_Current_Addres ;
  22. UINT8 Fota_Recv_Data_Len ;
  23. UINT8 Fota_Recv_Data[100] ;
  24. UINT32 Fota_Flash_Addres;
  25. UINT8 Fota_CRC ;
  26. }Fota_Type;
  27. UINT8 bcc_chk(UINT8* data, UINT16 length);
  28. void LEDDisplay(void);
  29. UINT16 GetErrorNum(UINT16 *ErrorArray,UINT8 Errorlen);
  30. UINT8 PutErrorNum(UINT16 *ErrorArray,UINT8 Errorlen,UINT16 ErrorNum);
  31. void SaveAppData(void);
  32. void LoadAppData(void);
  33. void SaveAppConfig(void);
  34. void LoadAppConfig(void);
  35. static void setDefaultAppConfigData(void);
  36. static void setDefaultAppDataInfo(void);
  37. void TcpDataAssemble(UINT8 Tcptype,UINT8 *SendBuffer,UTC8TimeType UTC8TimeTcp);
  38. void canRxMsgSetInvalidValue(UINT32 ID);
  39. void Fota_Func(UINT8 *DataPtr,INT32 connectId);
  40. static UINT8 bcc_chk_fota(UINT8* data, UINT8 length);
  41. static UINT8 Fota_crc_chk(UINT8* data,UINT8 length);
  42. void DecodeFunction(UINT32 ID,UINT8* rawData);
  43. void canRxDiagnose(void);
  44. UINT8 canCOMInTableIndexFind(UINT32 canID);
  45. void canRxMsgSetInvalidValue(UINT32 ID);
  46. BOOL snCodeCompare(UINT8* savedSN, UINT8* receivedSN);
  47. void UDS_Service(CAN_Msg_Type* CanRxMsg);
  48. UINT8 UDSPositiveAnswer(UINT8 answerLen,UINT8 messageIndex,UINT32 posCode);
  49. UINT8 UDSNegtiveAnswer(UINT8 answerLen,UINT8 messageIndex, UINT32 negCode);
  50. BOOL UDSAskforDownLoadData();
  51. BOOL UDSClearFotaDownloadRegion();
  52. void CANEncodeFunction(UINT32 ID,UINT8* msgData);
  53. BOOL VINCodeCompare(UINT8* saveVIN, UINT8* receivedVIN);
  54. void canTxTest(void);