AppFunc.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * @Author : ChenJie
  3. * @Date : 2021-10-14 09:27:15
  4. * @Version : V3.0
  5. * @LastEditors : ChenJie
  6. * @LastEditTime : 2021-10-14 18:15:45
  7. * @Description : file content
  8. * @FilePath : \PLAT\project\ec616_0h00\apps\qx_app\inc\AppFunc.h
  9. */
  10. /****************************************************************************
  11. *
  12. * Copy right: RL.Chen J and Zhen C
  13. * File name: AppFunc.h
  14. * Description: 应用层函数调用文件
  15. * History: 2021-07-15
  16. * Version: V3.0
  17. ****************************************************************************/
  18. #include "hal_module_adapter.h"
  19. #include "flash_ec616_rt.h"
  20. #include "commontypedef.h"
  21. #include "flash_ec616_rt.h"
  22. #include "mem_map.h"
  23. #include "AppConfig.h"
  24. #include "ec_tcpip_api.h"
  25. #include "AppSignal.h"
  26. typedef struct _Fota_Type
  27. {
  28. BOOL Fota_update_error;
  29. UINT32 Fota_All_Data_Len;
  30. UINT32 Fota_Current_Addres;
  31. UINT8 Fota_Recv_Data_Len;
  32. UINT8 Fota_Recv_Data[100];
  33. UINT32 Fota_Flash_Addres;
  34. UINT8 Fota_CRC;
  35. } Fota_Type;
  36. void ExpiryTimeCal(UINT8 *StartTimeArray, UINT16 rentalDays, UINT8 *ExpiryTimeArray);
  37. INT8 rentalEndDetectFunc(void);
  38. void BattLockFunc(void);
  39. void BattWorkDelayFunc(UINT8 battWorkCurrentState);
  40. UINT8 bcc_chk(UINT8 *data, UINT16 length);
  41. void LEDDisplay(void);
  42. BOOL uartBattInfoDecode(UINT8 *dataPtr);
  43. static UINT8 BmsErrorDecode(UINT32 battWarningState);
  44. UINT16 GetErrorNum(UINT16 *ErrorArray, UINT8 Errorlen);
  45. UINT8 PutErrorNum(UINT16 *ErrorArray, UINT8 Errorlen, UINT16 ErrorNum);
  46. UINT8 LookUpRTtable(UINT32 R_value);
  47. BOOL BattHeaterSwitch(UINT8 *heaterSwitch, UINT8 HeatForceControl);
  48. void SaveAppData(void);
  49. void LoadAppData(void);
  50. void SaveBcuData(void);
  51. void LoadBcuData(void);
  52. void SaveAppConfig(void);
  53. void LoadAppConfig(void);
  54. static void setDefaultAppConfigData(void);
  55. static void setDefaultAppDataInfo(void);
  56. static void setDefaultBcuDataInfo(void);
  57. void CanMsgTx1000ms(void);
  58. void UDS_Service(CAN_Msg_Type *CanRxMsg);
  59. void CANEncodeFunction(UINT32 ID, UINT8 *msgData);
  60. void relayControlFunc(UINT8 BuzzerPeriod, float DutyRatio);
  61. BOOL UDSClearFotaDownloadRegion();
  62. BOOL UDSAskforDownLoadData();
  63. UINT8 UDSNegtiveAnswer(UINT8 answerLen, UINT8 messageIndex, UINT32 negCode);
  64. UINT8 UDSPositiveAnswer(UINT8 answerLen, UINT8 messageIndex, UINT32 posCode);
  65. UINT16 encryptionAlgorithm(UINT16 plainText);
  66. void Fota_Func(UINT8 *DataPtr, INT32 connectId);
  67. static UINT8 bcc_chk_fota(UINT8 *data, UINT8 length);
  68. static UINT8 Fota_crc_chk(UINT8 *data, UINT8 length);
  69. void ErrorNumHandleFunc(void);