app.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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_IP_READY (QMSG_ID_BASE)
  17. #define QMSG_ID_NW_IP_SUSPEND (QMSG_ID_BASE + 1)
  18. #define QMSG_ID_NW_IP_NOREACHABLE (QMSG_ID_BASE + 2)
  19. #define QMSG_ID_SOCK_SENDPKG (QMSG_ID_BASE + 4)
  20. #define QMSG_ID_SOCK_RECVPKG (QMSG_ID_BASE + 5)
  21. #define QMSG_ID_SOCK_EXIT (QMSG_ID_BASE + 6)
  22. typedef enum
  23. {
  24. APP_INIT_STATE,
  25. APP_DEACTIVE_STATE,
  26. APP_IPREADY_STATE,
  27. APP_REPORT_STATE,
  28. APP_IDLE_STATE,
  29. APP_WAIT_STATE
  30. } appRunningState_t;
  31. typedef enum
  32. {
  33. APP_SOCKET_CONNECTION_CLOSED,
  34. APP_SOCKET_CONNECTION_CONNECTING,
  35. APP_SOCKET_CONNECTION_CONNECTED,
  36. }AppSocketConnectionStatus;
  37. typedef struct AppSocketConnectionContext_Tag
  38. {
  39. INT32 id;
  40. INT32 status;
  41. }AppSocketConnectionContext;
  42. typedef struct Uart_Receive_Type
  43. {
  44. uint8_t Bms_Address;
  45. uint8_t Bms_Read_Funcode;
  46. uint8_t Reg_Begin_H;
  47. uint8_t Reg_Begin_L;
  48. uint8_t Reg_Num_H;
  49. uint8_t Reg_Num_L;
  50. }Uart_Receive_Type;
  51. typedef struct Fota_Type
  52. {
  53. bool Fota_update_flag ;
  54. bool Fota_update_error ;
  55. uint32_t Fota_All_Data_Len ;
  56. uint32_t Fota_Current_Addres ;
  57. uint8_t Fota_Recv_Data_Len ;
  58. uint8_t Fota_Recv_Data[100] ;
  59. uint32_t Fota_Flash_Addres;
  60. uint8_t Fota_CRC ;
  61. }Fota_Type;
  62. typedef struct _GPS_INFO
  63. {
  64. uint8_t timedata[6];
  65. uint8_t status;
  66. uint8_t satellite_num;
  67. uint16_t direction;
  68. uint16_t speed;
  69. uint16_t altitude;
  70. uint32_t latitude;
  71. uint32_t longitude;
  72. }GPS_INFO;
  73. uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  74. #ifdef __cplusplus
  75. }
  76. #endif
  77. #endif /* APP_H */