AppFunc.h 2.0 KB

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