app.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. typedef struct _GPS_INFO
  58. {
  59. uint8_t timedata[6];
  60. uint8_t status;
  61. uint8_t satellite_num;
  62. uint16_t direction;
  63. uint16_t speed;
  64. uint16_t altitude;
  65. uint32_t latitude;
  66. uint32_t longitude;
  67. }GPS_INFO;
  68. uint8_t* Uart_Receive_func(Uart_Receive_Type Uart_Receive_Msg,uint8_t* Uart_Rece_buffer,uint8_t Data_Len);
  69. #ifdef __cplusplus
  70. }
  71. #endif
  72. #endif /* APP_H */