blob: 56261210f8c27027b91f6ddb70c179d1b20f4688 [file] [log] [blame]
b.liud440f9f2025-04-18 10:44:31 +08001#include "ql_atc.h"
2#include "ql_type.h"
3
4#include "mbtk_at.h"
5
6/*-----------------------------------------------------------------------------------------------*/
7/**
8 @brief Initialize ATC service.
9 @note You must call this function before other functions can be used in this module.
10 @return Whether the ATC service was successfully intialized.
11 @retval QL_ERR_OK successful.
12 @retval QL_ERR_SERVICE_NOT_READY service is not ready, need to retry.
13 @retval Other error code defined by ql_type.h.
14 */
15/*-----------------------------------------------------------------------------------------------*/
16int ql_atc_init(void)
17{
18 return mbtk_at_init();
19}
20
21
22/*-----------------------------------------------------------------------------------------------*/
23/**
24 @brief send at command async.
25 @param[in] req_buf At command request content
26 @param[out] async_index Async AT command index
27 @param[in] async_cb Async callback function
28 @return Whether to successfully send the AT command asynchronously
29 @retval QL_ERR_OK successful
30 @retval QL_ERR_NOT_INIT uninitialized
31 @retval QL_ERR_SERVICE_NOT_READY service is not ready
32 @retval Other error code defined by ql_type.h
33 */
34/*-----------------------------------------------------------------------------------------------*/
35int ql_atc_send_async(char *req_buf, int *async_index, void *async_cb)
36{
37 return QL_ERR_UNSUPPORTED;
38}
39
40
41/*-----------------------------------------------------------------------------------------------*/
42/**
43 @brief send AT command.
44 @param[in] req_buf At command request content
45 @param[in] rsp_buf At command response content
46 @param[in] rsp_len The length of rsp_buf
47 @return Whether to successfully send AT command
48 @retval QL_ERR_OK successful
49 @retval QL_ERR_NOT_INIT uninitialized
50 @retval QL_ERR_SERVICE_NOT_READY service is not ready
51 @retval Other error code defined by ql_type.h
52 */
53/*-----------------------------------------------------------------------------------------------*/
54int ql_atc_send(char *req_buf, char *rsp_buf, int rsp_len)
55{
56 return mbtk_at_send(req_buf, rsp_buf, rsp_len);
57}
58
59/*-----------------------------------------------------------------------------------------------*/
60/**
61 @brief Deinitialize ATC service.
62 @return Whether the DM service was successfully deintialized.
63 @retval QL_ERR_OK successful.
64 @retval Other error code defined by ql_type.h.
65 */
66/*-----------------------------------------------------------------------------------------------*/
67int ql_atc_deinit(void)
68{
69 return mbtk_at_deinit();
70}
71