at_cmd_btmsg.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _BT_MSG_H_
  13. #define _BT_MSG_H_
  14. #define APP_BT_MSG 0
  15. #define APP_BLE_MSG 1
  16. typedef void (*AppBtMsgHandler_t)(void *param);
  17. bool AppRegisterBtMsgCB(uint32_t type, AppBtMsgHandler_t handler);
  18. //--------------------------------- Classic ------------------------------------
  19. #define APP_BT_MSG_FLAG 0x80000000
  20. #define APP_BT_MSG_BASE 0x00550000
  21. #define APP_BT_ME_ON_CNF (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 1))
  22. #define APP_BT_ME_OFF_CNF (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 2))
  23. #define APP_BT_VISIBILE_CNF (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 3))
  24. #define APP_BT_HIDDEN_CNF (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 4))
  25. #define APP_BT_SET_LOCAL_NAME_RES (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 5))
  26. #define APP_BT_SET_LOCAL_ADDR_RES (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 6))
  27. #define APP_BT_INQ_DEV_NAME (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 7))
  28. #define APP_BT_INQ_COMP_CNF (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 8))
  29. #define APP_BT_INQUIRY_CANCEL (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 9))
  30. #define APP_BT_DEV_PAIR_COMPLETE (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 10))
  31. #define APP_BT_DELETE_DEVICE_RES (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 11))
  32. #define APP_BT_DEV_PIN_REQ (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 12))
  33. #define APP_BT_SSP_NUM_IND (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 13))
  34. #define APP_BT_SPP_CONNECT_IND (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 14))
  35. #define APP_BT_SPP_DISCONNECT_IND (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 15))
  36. #define APP_BT_SPP_DATA_RECIEVE_IND (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 16))
  37. #define APP_BT_SPP_DATA_SEND_IND (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 17))
  38. #define APP_BT_HFP_CONNECT_RES (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 18))
  39. #define APP_BT_HFP_DISCONNECT_RES (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 19))
  40. #define APP_BT_REOPEN_IND (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 20)) //stop of BT reopen
  41. #define APP_BT_REOPEN_ACTION_IND (APP_BT_MSG_FLAG | (APP_BT_MSG_BASE + 21)) //start of BT reopen
  42. //--------------------------------- BLE ----------------------------------------
  43. #define APP_BLE_MSG_FLAG 0x08000000
  44. #define APP_BLE_COMM_BASE 0x00600000
  45. #define APP_BLE_ADV_BASE 0x00610000
  46. #define APP_BLE_SCAN_BASE 0x00620000
  47. #define APP_BLE_SET_PUBLIC_ADDR (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 1))
  48. #define APP_BLE_SET_RANDOM_ADDR (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 2))
  49. #define APP_BLE_ADD_WHITE_LIST (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 3))
  50. #define APP_BLE_REMOVE_WHITE_LIST (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 4))
  51. #define APP_BLE_CLEAR_WHITE_LIST (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 5))
  52. #define APP_BLE_CONNECT (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 6))
  53. #define APP_BLE_DISCONNECT (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 7))
  54. #define APP_BLE_UPDATA_CONNECT (APP_BLE_MSG_FLAG | (APP_BLE_COMM_BASE + 8))
  55. #define APP_BLE_SET_ADV_PARA (APP_BLE_MSG_FLAG | (APP_BLE_ADV_BASE + 1))
  56. #define APP_BLE_SET_ADV_DATA (APP_BLE_MSG_FLAG | (APP_BLE_ADV_BASE + 2))
  57. #define APP_BLE_SET_ADV_ENABLE (APP_BLE_MSG_FLAG | (APP_BLE_ADV_BASE + 3))
  58. #define APP_BLE_SET_ADV_SCAN_RSP (APP_BLE_MSG_FLAG | (APP_BLE_ADV_BASE + 4))
  59. #define APP_BLE_SET_SCAN_PARA (APP_BLE_MSG_FLAG | (APP_BLE_SCAN_BASE + 1))
  60. #define APP_BLE_SET_SCAN_ENABLE (APP_BLE_MSG_FLAG | (APP_BLE_SCAN_BASE + 2))
  61. #define APP_BLE_SET_SCAN_DISENABLE (APP_BLE_MSG_FLAG | (APP_BLE_SCAN_BASE + 3))
  62. #define APP_BLE_SET_SCAN_REPORT (APP_BLE_MSG_FLAG | (APP_BLE_SCAN_BASE + 4))
  63. #define APP_BLE_SET_SCAN_FINISH (APP_BLE_MSG_FLAG | (APP_BLE_SCAN_BASE + 5))
  64. #endif