56 lines
1.3 KiB
C
56 lines
1.3 KiB
C
#ifndef ATE_AT_PROCESS_H
|
|
#define ATE_AT_PROCESS_H
|
|
|
|
#include "at_cmd_api.h"
|
|
#include "ate_msg_manager.h"
|
|
#include "soc_osal.h"
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
extern "C" {
|
|
#endif /* __cplusplus */
|
|
#endif /* __cplusplus */
|
|
|
|
#define AT_MAX_PARAM_CNT 64
|
|
|
|
#define IS_ON(argv) (strncasecmp((const char *)argv, "on", 2) == EOK ? 1 : 0)
|
|
#define IS_OFF(argv) (strncasecmp((const char *)argv, "off", 3) == EOK ? 1 : 0)
|
|
|
|
static inline void free_argv(uint8_t *argv[], int argc)
|
|
{
|
|
for (int i = 0; i < argc; i++) {
|
|
if (argv[i] != NULL) {
|
|
osal_kfree(argv[i]);
|
|
argv[i] = NULL;
|
|
}
|
|
}
|
|
}
|
|
|
|
typedef result_t (*ProcessFunc)(uint8_t *para, uint32_t para_len);
|
|
|
|
typedef struct {
|
|
const uint16_t msg_id;
|
|
ProcessFunc func;
|
|
} ProcessType;
|
|
|
|
/**
|
|
* @brief 从字符串获得参数
|
|
* @param[in] inParam 处理的数据
|
|
* @param[in] paramLen 数据长度
|
|
* @param[out] outArgv 输出参数
|
|
* @param[out] outArgc 输出参数个数
|
|
* @return
|
|
*/
|
|
int32_t convert_at_param(uint8_t *inParam, uint16_t paramLen, int32_t *outArgc, char **outArgv);
|
|
|
|
void ate_at_process(uint8_t *data, uint32_t data_len);
|
|
|
|
void ate_module_api_init(void);
|
|
|
|
#ifdef __cplusplus
|
|
#if __cplusplus
|
|
}
|
|
#endif /* __cplusplus */
|
|
#endif /* __cplusplus */
|
|
|
|
#endif |