ql_wifi_uart.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /**
  2. @file
  3. ql_wifi_uart.h
  4. @brief
  5. Quectel wifi uart api header.
  6. */
  7. /*============================================================================
  8. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  9. Quectel Wireless Solution Proprietary and Confidential.
  10. =============================================================================*/
  11. /*===========================================================================
  12. EDIT HISTORY FOR MODULE
  13. This section contains comments describing changes made to the module.
  14. Notice that changes are listed in reverse chronological order.
  15. WHEN WHO WHAT, WHERE, WHY
  16. ---------- ------------ ----------------------------------------------------
  17. =============================================================================*/
  18. #ifndef QL_WIFI_UART_H
  19. #define QL_WIFI_UART_H
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /*========================================================================
  24. * Marco Definition
  25. *========================================================================*/
  26. #define QL_WIFI_UART_MAGIC0 0xAA
  27. #define QL_WIFI_UART_MAGIC1 0x55
  28. /*========================================================================
  29. * Enumeration Definition
  30. *========================================================================*/
  31. typedef enum
  32. {
  33. QL_WIFI_UART_SUCCESS = 0,
  34. QL_WIFI_UART_EXECUTE_ERR = 1 | (QL_COMPONENT_LWIP_WIFI << 16),
  35. QL_WIFI_UART_INVALID_PARAM_ERR,
  36. QL_WIFI_UART_TASK_CREATE_ERR,
  37. QL_WIFI_UART_MUTEX_CREATE_ERR,
  38. QL_WIFI_UART_PORT_SET_ERR,
  39. QL_WIFI_UART_PIN_SET_ERR,
  40. QL_WIFI_UART_OPEN_ERR,
  41. QL_WIFI_UART_CB_REG_ERR,
  42. } ql_wifi_uart_errcode_e;
  43. /*========================================================================
  44. * Type Definition
  45. *========================================================================*/
  46. typedef int (*ql_wifi_uart_notify_cb)(void *ctx);
  47. /*========================================================================
  48. * function Definition
  49. *========================================================================*/
  50. unsigned char npto_CRC(void *src, int ilen);
  51. /*****************************************************************
  52. * Function: ql_wifi_uart_output_data_msg
  53. *
  54. * Description: Wi-Fi command output function.Use this function to send command.
  55. *
  56. * Parameters:
  57. * ctx [in] See ql_wifi_msg_output_data_info_s in ql_wifi_msg.h
  58. *
  59. * Return:
  60. * 0 success
  61. * other error code
  62. *
  63. *****************************************************************/
  64. int ql_wifi_uart_output_data_msg(void *ctx);
  65. /*****************************************************************
  66. * Function: ql_wifi_uart_notify_cb_register
  67. *
  68. * Description: Register UART notificatiion callback
  69. *
  70. * Parameters:
  71. * cb [in] UART notificatiion callback
  72. *
  73. * Return:
  74. * 0 success
  75. * other error code
  76. *
  77. *****************************************************************/
  78. ql_wifi_uart_errcode_e ql_wifi_uart_notify_cb_register(ql_wifi_uart_notify_cb cb);
  79. /*****************************************************************
  80. * Function: ql_wifi_uart_init
  81. *
  82. * Description: Initialize Wi-Fi uart engine.
  83. *
  84. * Parameters:
  85. * argv [in] No defined yet.
  86. *
  87. * Return:
  88. * 0 success
  89. * other error code
  90. *
  91. *****************************************************************/
  92. ql_wifi_uart_errcode_e ql_wifi_uart_init(void *argv);
  93. /*****************************************************************
  94. * Function: ql_wifi_uart_deinit
  95. *
  96. * Description: Deinitialize Wi-Fi uart engine.
  97. *
  98. * Parameters:
  99. * argv [in] No defined yet.
  100. *
  101. * Return:
  102. * 0 success
  103. * other error code
  104. *
  105. *****************************************************************/
  106. ql_wifi_uart_errcode_e ql_wifi_uart_deinit(void* argv);
  107. #ifdef __cplusplus
  108. }/*"C" */
  109. #endif
  110. #endif