AppFunc.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * @Author : ChenJie
  3. * @Date : 2021-11-09 12:08:17
  4. * @Version : V3.0
  5. * @LastEditors : ChenJie
  6. * @LastEditTime : 2021-11-23 19:08:59
  7. * @Description : file content
  8. * @FilePath : \PLAT\project\ec616_0h00\apps\qx_app\inc\AppFunc.h
  9. */
  10. #include "hal_module_adapter.h"
  11. #include "flash_ec616_rt.h"
  12. #include "commontypedef.h"
  13. #include "flash_ec616_rt.h"
  14. #include "mem_map.h"
  15. #include "AppConfig.h"
  16. #include "ec_tcpip_api.h"
  17. #include "AppSignal.h"
  18. typedef struct _Fota_Type
  19. {
  20. BOOL Fota_update_error;
  21. UINT32 Fota_All_Data_Len;
  22. UINT32 Fota_Current_Addres;
  23. UINT8 Fota_Recv_Data_Len;
  24. UINT8 Fota_Recv_Data[100];
  25. UINT32 Fota_Flash_Addres;
  26. UINT8 Fota_CRC;
  27. } Fota_Type;
  28. UINT8 bcc_chk(UINT8 *data, UINT16 length);
  29. void LEDDisplay(void);
  30. UINT16 GetErrorNum(UINT16 *ErrorArray, UINT8 Errorlen);
  31. UINT8 PutErrorNum(UINT16 *ErrorArray, UINT8 Errorlen, UINT16 ErrorNum);
  32. void SaveAppData(void);
  33. void LoadAppData(void);
  34. void SaveAppConfig(void);
  35. void LoadAppConfig(void);
  36. static void setDefaultAppConfigData(void);
  37. static void setDefaultAppDataInfo(void);
  38. void TcpDataAssemble(UINT8 Tcptype, UINT8 *SendBuffer, UTC8TimeType UTC8TimeTcp);
  39. void canRxMsgSetInvalidValue(UINT32 ID);
  40. void Fota_Func(UINT8 *DataPtr, INT32 connectId);
  41. static UINT8 bcc_chk_fota(UINT8 *data, UINT8 length);
  42. static UINT8 Fota_crc_chk(UINT8 *data, UINT8 length);
  43. void DecodeFunction(UINT32 ID, UINT8 *rawData);
  44. void canRxDiagnose(void);
  45. UINT8 canCOMInTableIndexFind(UINT32 canID);
  46. void canRxMsgSetInvalidValue(UINT32 ID);
  47. BOOL snCodeCompare(UINT8 *savedSN, UINT8 *receivedSN);
  48. void UDS_Service(CAN_Msg_Type *CanRxMsg);
  49. UINT8 UDSPositiveAnswer(UINT8 answerLen, UINT8 messageIndex, UINT32 posCode);
  50. UINT8 UDSNegtiveAnswer(UINT8 answerLen, UINT8 messageIndex, UINT32 negCode);
  51. BOOL UDSAskforDownLoadData();
  52. BOOL UDSClearFotaDownloadRegion();
  53. void CANEncodeFunction(UINT32 ID, UINT8 *msgData);
  54. BOOL VINCodeCompare(UINT8 *saveVIN, UINT8 *receivedVIN);
  55. void canTxTest(void);
  56. void canRxMsgSetInitValue(void);