AppFunc.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. void ExpiryTimeCal(UINT8 *StartTimeArray,UINT16 rentalDays,UINT8 *ExpiryTimeArray);
  28. INT8 rentalEndDetectFunc(void);
  29. void BattLockFunc(void);
  30. void BattWorkDelayFunc(UINT8 battWorkCurrentState);
  31. UINT8 bcc_chk(UINT8* data, UINT16 length);
  32. void LEDDisplay(void);
  33. BOOL uartBattInfoDecode(UINT8* dataPtr);
  34. static UINT8 BmsErrorDecode(UINT32 battWarningState);
  35. UINT16 GetErrorNum(UINT16 *ErrorArray,UINT8 Errorlen);
  36. UINT8 PutErrorNum(UINT16 *ErrorArray,UINT8 Errorlen,UINT16 ErrorNum);
  37. UINT8 LookUpRTtable(UINT32 R_value);
  38. BOOL BattHeaterSwitch(UINT8* heaterSwitch,UINT8 HeatForceControl);
  39. void SaveAppData(void);
  40. void LoadAppData(void);
  41. void SaveBcuData(void);
  42. void LoadBcuData(void);
  43. void SaveAppConfig(void);
  44. void LoadAppConfig(void);
  45. static void setDefaultAppConfigData(void);
  46. static void setDefaultAppDataInfo(void);
  47. static void setDefaultBcuDataInfo(void);
  48. void CanMsgTx1000ms(void);
  49. void UDS_Service(CAN_Msg_Type* CanRxMsg);
  50. void CANEncodeFunction(UINT32 ID,UINT8* msgData);
  51. void relayControlFunc(float DutyRatio);
  52. BOOL UDSClearFotaDownloadRegion();
  53. BOOL UDSAskforDownLoadData();
  54. UINT8 UDSNegtiveAnswer(UINT8 answerLen,UINT8 messageIndex, UINT32 negCode);
  55. UINT8 UDSPositiveAnswer(UINT8 answerLen,UINT8 messageIndex,UINT32 posCode);
  56. UINT16 encryptionAlgorithm (UINT16 plainText);
  57. void Fota_Func(UINT8 *DataPtr,INT32 connectId);
  58. static UINT8 bcc_chk_fota(UINT8* data, UINT8 length);
  59. static UINT8 Fota_crc_chk(UINT8* data,UINT8 length);
  60. void ErrorNumHandleFunc(void);