al_uart_vehicle.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef __AL_UART_VEHICLE_H__
  2. #define __AL_UART_VEHICLE_H__
  3. #include "al_basictypes.h"
  4. #include <unistd.h>
  5. #include <stdbool.h>
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <signal.h>
  9. #include <sys/file.h>
  10. #include <termios.h>
  11. #include <time.h>
  12. #include <sys/ioctl.h>
  13. #include "types.h"
  14. #include "al_uart_vehicle_ctrl.h"
  15. #include "al_console.h"
  16. enum {
  17. UartA,
  18. UartB,
  19. };
  20. typedef enum {
  21. VEHICLE_SUCCESS, // successful outcome
  22. VEHICLE_ERR_FAILURE, // operation failed
  23. VEHICLE_ERR_NULL_PARAM, // null parameter
  24. } Vehicle_Status_e;
  25. typedef enum {
  26. VEHICLE_TASK_IDLE = 0,
  27. VEHICLE_TASK_SEND_MESAGE,
  28. VEHICLE_TASK_Standby,
  29. } VehicleTaskStatus_t;
  30. /*******************************************************************************
  31. * Constant
  32. ******************************************************************************/
  33. #define VEHICLE_DAEMON_DELAY 60
  34. typedef struct Event_LinkList_Node_s {
  35. Vehicle_MessageBody_t stEvt;
  36. struct Event_LinkList_Node_s *pstNext;
  37. } Event_LinkList_Node_t;
  38. typedef struct Frame_LinkList_Node_s {
  39. struct Frame_LinkList_Node_s *pstNext;
  40. } Frame_LinkList_Node_t;
  41. typedef struct {
  42. Event_LinkList_Node_t *pstEvtList;
  43. Frame_LinkList_Node_t *pstFrmList;
  44. } Vehicle_SendBuffer_t;
  45. void Vehicle_Init(Vehicle_ModualCfg_t * pVehicle_ModualCfg);
  46. void Al_Vehicle_Enable(void);
  47. void Al_Vehicle_Disable(void);
  48. void Al_Vehicle_Destory(void);
  49. al_uint32 AL_Vehicle_getDecNumFromBCD(al_uint32 bcd);
  50. al_uint32 AL_Vehicle_getBCDFromDecNum(al_uint32 num);
  51. Vehicle_Status_e Vehicle_SendEvtToAp(Vehicle_MessageBody_t stEvt);
  52. void Vehicle_sendCmdToModule(al_uint8 * str, int size);
  53. pCON_DEV get_pVehicleCON_DEV(void);
  54. al_uint8 AL_Vehicle_Get_UARTCmd_CheckSum(al_uint8 * cmdtable, int len);
  55. #endif