app.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /****************************************************************************
  2. *
  3. * Copy right: 2017-, Copyrigths of EigenComm Ltd.
  4. * File name: app.h
  5. * Description: EC616 onenet demo entry header file
  6. * History: Rev1.0 2018-07-12
  7. *
  8. ****************************************************************************/
  9. #ifndef APP_H
  10. #define APP_H
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif
  14. #include "cisAsynEntry.h"
  15. // #define QMSG_ID_BASE (0x160)
  16. // #define QMSG_ID_NW_IPV4_READY (QMSG_ID_BASE)
  17. // #define QMSG_ID_NW_IPV6_READY (QMSG_ID_BASE + 1)
  18. // #define QMSG_ID_NW_IPV4_6_READY (QMSG_ID_BASE + 2)
  19. // #define QMSG_ID_NW_DISCONNECT (QMSG_ID_BASE + 3)
  20. // #define QMSG_ID_SOCK_SENDPKG (QMSG_ID_BASE + 4)
  21. // #define QMSG_ID_SOCK_RECVPKG (QMSG_ID_BASE + 5)
  22. #define QMSG_ID_BASE (0x160)
  23. #define QMSG_ID_NW_IP_READY (QMSG_ID_BASE)
  24. #define QMSG_ID_NW_IP_SUSPEND (QMSG_ID_BASE + 1)
  25. #define QMSG_ID_NW_IP_NOREACHABLE (QMSG_ID_BASE + 2)
  26. #define QMSG_ID_SOCK_SENDPKG (QMSG_ID_BASE + 4)
  27. #define QMSG_ID_SOCK_RECVPKG (QMSG_ID_BASE + 5)
  28. typedef enum
  29. {
  30. APP_INIT_STATE,
  31. APP_DEACTIVE_STATE,
  32. APP_IPREADY_STATE,
  33. APP_REPORT_STATE,
  34. APP_IDLE_STATE,
  35. APP_WAIT_STATE
  36. } appRunningState_t;
  37. typedef struct Uart_Receive_Type
  38. {
  39. uint8_t Bms_Address;
  40. uint8_t Bms_Read_Funcode;
  41. uint8_t Reg_Begin_H;
  42. uint8_t Reg_Begin_L;
  43. uint8_t Reg_Num_H;
  44. uint8_t Reg_Num_L;
  45. }Uart_Receive_Type;
  46. typedef struct Fota_Type
  47. {
  48. bool Fota_update ;
  49. bool Fota_update_error ;
  50. uint32_t Fota_All_Data_Len ;
  51. uint32_t Fota_Current_Addres ;
  52. uint8_t Fota_Recv_Data_Len ;
  53. uint8_t Fota_Recv_Data[100] ;
  54. uint32_t Fota_Flash_Addres;
  55. uint8_t Fota_CRC ;
  56. }Fota_Type;
  57. uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  58. #ifdef __cplusplus
  59. }
  60. #endif
  61. #endif /* APP_H */