al_bluetooth.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef __AL_BLUETOOTH_H__
  2. #define __AL_BLUETOOTH_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_bluetooth_ctrl.h"
  15. #include "al_console.h"
  16. enum {
  17. UartA,
  18. UartB,
  19. };
  20. typedef enum {
  21. BT_SUCCESS, // successful outcome
  22. BT_ERR_FAILURE, // operation failed
  23. BT_ERR_NULL_PARAM, // null parameter
  24. } BT_Status_e;
  25. typedef enum {
  26. BT_TASK_IDLE = 0,
  27. BT_TASK_SEND_MESAGE,
  28. BT_TASK_Standby,
  29. } BTTaskStatus_t;
  30. /*******************************************************************************
  31. * Constant
  32. ******************************************************************************/
  33. #define BT_DAEMON_DELAY 60
  34. typedef struct BT_Event_LinkList_Node_s {
  35. BT_MessageBody_t stEvt;
  36. struct BT_Event_LinkList_Node_s *pstNext;
  37. } BT_Event_LinkList_Node_t;
  38. typedef struct BT_Frame_LinkList_Node_s {
  39. struct BT_Frame_LinkList_Node_s *pstNext;
  40. } BT_Frame_LinkList_Node_t;
  41. typedef struct {
  42. BT_Event_LinkList_Node_t *pstEvtList;
  43. BT_Frame_LinkList_Node_t *pstFrmList;
  44. } BT_SendBuffer_t;
  45. void BlueTooth_Init(BT_ModualCfg_t * pBT_ModualCfg);
  46. void bluetooth_cmd_send(al_uint8 * str, al_uint size);
  47. void bluetooth_upgrade_cmd_send(al_uint8 * str, al_uint size);
  48. void Al_Bluetooth_Disable(void);
  49. void Al_Bluetooth_Enable(void);
  50. void Al_Bluetooth_Destory(void);
  51. BT_Status_e _bt_SendEvt(BT_MessageBody_t stEvt);
  52. pCON_DEV get_pBtCON_DEV(void);
  53. #endif