1 Star 1 Fork 0

tangtao/latserver

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
lxz_atc_req.h 19.72 KB
一键复制 编辑 原始数据 按行查看 历史
tangtao 提交于 2021-03-16 15:34 . no commit message
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
#ifndef __LXZ_ATC_REQ_H__
#define __LXZ_ATC_REQ_H__
#define LXZAT_MAX_PARAM_NUM 10
#define LXZAT_END_CHAR_CR 0x0D
#define LXZAT_END_CHAR_LF 0x0A
#define LXZAT_END_CHAR_SUB 0x1A
#define LXZAT_END_CHAR_ESC 0x1B
#define LXZAT_LSP_OK_INIT 0x0000
#define LXZAT_LSP_OK_DONE 0x0001
#define LXZAT_LSP_OK_GOON 0x0002
#define LXZAT_LSP_NOK_CHAR 0x0003
#define LXZAT_LSP_NOK_HEADER 0x0004
#define LXZAT_LSP_NOK_KEYWORD 0x0005
#define LXZAT_LSP_NOK_NUMERIC 0x0006
#define LXZAT_LSP_NOK_STRING 0x0007
#define LXZAT_LSP_NOK_UNKNOWN 0x0008
/*
* LXZAT_RSP_MODE_PxNy
* -- x, the number of "\r\n" will be added before element;
* -- y, the number of "\r\n" will be added after element;
*
* LXZAT_RSP_MODE_MASK
* -- the mask-value of the element flag;
*/
#define LXZAT_RSP_MODE_P0N0 0x0000
#define LXZAT_RSP_MODE_P0N1 0x0001
#define LXZAT_RSP_MODE_P0N2 0x0002
#define LXZAT_RSP_MODE_P0N3 0x0003
#define LXZAT_RSP_MODE_P1N0 0x0100
#define LXZAT_RSP_MODE_P1N1 0x0101
#define LXZAT_RSP_MODE_P1N2 0x0102
#define LXZAT_RSP_MODE_P1N3 0x0103
#define LXZAT_RSP_MODE_P2N0 0x0200
#define LXZAT_RSP_MODE_P2N1 0x0201
#define LXZAT_RSP_MODE_P2N2 0x0202
#define LXZAT_RSP_MODE_P2N3 0x0203
#define LXZAT_RSP_MODE_P3N0 0x0300
#define LXZAT_RSP_MODE_P3N1 0x0301
#define LXZAT_RSP_MODE_P3N2 0x0302
#define LXZAT_RSP_MODE_P3N3 0x0303
#define LXZAT_RSP_MODE_MASK 0xffff
#define LXZAT_CMEE_MODE_CODE 0
#define LXZAT_CMEE_MODE_BRIEF 1
#define LXZAT_CMEE_MODE_DETAIL 2
#define LXZAT_TYPE_INIT_INVALID 0x00000000
#define LXZAT_TYPE_RANGE_LOCAL 0x00000001
#define LXZAT_TYPE_RANGE_GLOBAL 0x00000002
#define LXZAT_TYPE_RANGE_MASK 0x0000ffff
#define LXZAT_TYPE_STRING_BASIC 0x00010000
#define LXZAT_TYPE_STRING_EXTEND 0x00020000
#define LXZAT_TYPE_STRING_MASK 0xffff0000
#define LXZPPP_TXBUF_SIZE_MAX 512
#define LXZPPP_RXBUF_SIZE_MAX 512
typedef struct _lxzat_param_t
{
sint32 it_type;
sint32 it_flag;
union
{
sint32 it_number;
struct _lxz_dstring_t * pt_str;
} pv;
struct _lxzat_param_t * next;
} lxzat_param_t;
typedef struct _lxzat_req_t
{
sint32 it_req_type;
sint32 it_nb_param;
struct _lxz_dstring_t * pt_at_head;
struct _lxzat_param_t * pt_at_param;
} lxzat_req_t;
typedef sint32 (*lxzat_f_init_t)(void * pctxt);
typedef sint32 (*lxzat_f_req_t)(void * pctxt);
typedef sint32 (*lxzat_f_resp_t)(void * pctxt);
typedef sint32 (*lxzat_f_reset_t)(void * pctxt);
typedef struct _lxzat_info_t
{
sint32 it_ai_type;
uint08 * pt_ai_keyword;
lxzat_f_init_t fp_atc_init;
lxzat_f_req_t fp_atc_req;
lxzat_f_resp_t fp_atc_resp;
lxzat_f_reset_t fp_atc_reset;
} lxzat_info_t;
typedef struct _lxzat_nvcfg_t
{
sint32 i_e_reg;
sint32 i_s1_reg;
sint32 i_s2_reg;
sint32 i_s3_reg;
sint32 i_s4_reg;
sint32 i_s5_reg;
sint32 i_v_reg;
sint32 i_cmee_reg;
sint32 i_cfun_reg;
sint32 i_cpin_status;
sint32 i_creg_status;
uint32 i_mark_ticks;
uint32 i_cpin_msecs;
uint32 i_creg_msecs;
} lxzat_nvcfg_t;
typedef sint32 (*lxzdata_f_handler_t)(sint32 i_end_flag, void * pctxt);
typedef struct _lxzdata_info_t
{
void * p_param_ctxt;
lxzdata_f_handler_t fp_data_handler;
} lxzdata_info_t;
typedef struct _lxzat_spcfg_t
{
sint32 i_vsp_id;
sint32 i_opened_flag;
uint32 u_end_char1;
uint32 u_end_char2;
sint32 i_resp_format;
sint32 i_jump_length;
uint32 u_vsp_fd;
uint32 u_vcom_fd;
uint32 u_ppp_mfd;
sint32 i_link_mode;
sint32 i_echo_auxiliary;
lxz_ring_t * pt_rx_ring;
lxz_ring_t * pt_tx_ring;
lxz_ring_t * pt_urc_cache;
lxzat_nvcfg_t * pt_nv_cfg;
lxzdata_info_t * pt_di_cfg;
} lxzat_spcfg_t;
typedef struct _lxzat_context_t
{
sint32 it_vsp_id; /* 当前AT命令所属的串口ID */
sint32 it_pos_record;/* 解析AT字串过程中,记录已解析的长度 */
uint08 * pt_rcv_str; /* 指向新收到的数据,内容存放后不再修改 */
uint08 * pt_atc_str; /* 指向新收到的AT命令,解析时会小幅修改 */
lxzat_info_t * pt_ai_cfg; /* 指向全局常量,具体AT命令相关的操作接口 */
lxzat_req_t * pt_req_data; /* 指向解析后的AT命令,在命令结束后释放 */
void * pt_rsp_data; /* 指向AT命令的私有数据,由具体的AT负责释放 */
} lxzat_context_t;
typedef enum _LXZAT_ERROR_CODE_E
{
/* Fail, General Error Code */
E_LEC_ERR_PHONE_FAILURE = 0x00000000,
E_LEC_ERR_NO_CONNECTION,
E_LEC_ERR_PHONE_ADAPTOR_RESERVED,
E_LEC_ERR_OPERATION_NOT_ALLOWED,
E_LEC_ERR_OPERATION_NOT_SUPPORTED,
E_LEC_ERR_PH_SIM_PIN_REQUIRED,
E_LEC_ERR_PH_FSIM_PIN_REQUIRED,
E_LEC_ERR_PH_FSIM_PUK_REQUIRED,
E_LEC_ERR_SIM_NOT_INSERTED,
E_LEC_ERR_SIM_PIN_REQUIRED,
E_LEC_ERR_SIM_PUK_REQUIRED,
E_LEC_ERR_SIM_FAILURE,
E_LEC_ERR_SIM_BUSY,
E_LEC_ERR_SIM_WRONG,
E_LEC_ERR_SIM_PASSWORD,
E_LEC_ERR_SIM_PIN2_REQUIRED,
E_LEC_ERR_SIM_PUK2_REQUIRED,
/* Success */
E_LEC_OK = 0x00010000,
E_LEC_OK_NOTHING,
E_LEC_OK_CHAR_0x3E,
E_LEC_OK_CONNECT,
/* Fail, General Error Code */
E_LEC_ERR_NOK = 0x00020000,
E_LEC_ERR_UNSUPPORTED,
E_LEC_ERR_NOT_ALLOWED,
E_LEC_ERR_AT_PREFIX,
E_LEC_ERR_MEM_ADDRESS,
/* Fail, parameter error code */
E_LEC_ERR_P_OTHER = 0x00030000,
E_LEC_ERR_P_TYPE,
E_LEC_ERR_P_TOO_BIG,
E_LEC_ERR_P_TOO_TINY,
E_LEC_ERR_P_TOO_SHORT,
E_LEC_ERR_P_TOO_LONG,
E_LEC_ERR_P_RANGE,
E_LEC_ERR_P_LENGTH,
E_LEC_ERR_P_NB_PARAM,
/* Fail, PDP(packet data protocol) Error Code */
E_LEC_ERR_PDP_OTHER = 0x00040000,
/* Fail, SIMCard Error Code */
E_LEC_ERR_SIM_OTHER = 0x00050000,
/* Fail, NETWork Error Code */
E_LEC_ERR_NET_OTHER = 0x00060000,
E_LEC_ERR_NET_SOCKET_INVALID,
E_LEC_ERR_NET_CONNECT_TIMEOUT,
E_LEC_ERR_NET_SOCKET_BIND,
/* Fail, Memory Error Code */
E_LEC_ERR_MEM_OTHER = 0x00070000,
E_LEC_ERR_MEM_MALLOC,
E_LEC_ERR_MEM_NOT_ENOUGH,
/* Fail, File read/write Error Code */
E_LEC_ERR_FILE_OTHER = 0x00070000,
E_LEC_ERR_FILE_OPEN_FAILURE,
E_LEC_ERR_FILE_READ_FAILURE,
E_LEC_ERR_FILE_SEEK_FAILURE,
E_LEC_ERR_FILE_WRITE_FAILURE,
E_LEC_ERR_FILE_CLOSE_FAILURE,
E_LEC_ERR_FILE_NOT_EXIST,
/* State-Grid(only for china) */
E_LEC_SGCC_STATUS = 0x00090000,
E_LEC_SGCC_ERROR = E_LEC_SGCC_STATUS + 1,
E_LEC_SGCC_PDP_ACTIVE_REJECT = E_LEC_SGCC_STATUS + 900,
E_LEC_SGCC_PDP_NO_ACTIVED = E_LEC_SGCC_STATUS + 901,
E_LEC_SGCC_PDP_ACTIVED = E_LEC_SGCC_STATUS + 902,
/* 903-909 reserved */
E_LEC_SGCC_TCP_CONNECT_REJECT = E_LEC_SGCC_STATUS + 910,
E_LEC_SGCC_TCP_CONNECT_TIMEOUT = E_LEC_SGCC_STATUS + 911,
E_LEC_SGCC_SOCKET_CONNECT = E_LEC_SGCC_STATUS + 912,
E_LEC_SGCC_SOCKET_NO_CONNECT = E_LEC_SGCC_STATUS + 913,
E_LEC_SGCC_SOCKET_BUFFER_FULL = E_LEC_SGCC_STATUS + 914,
E_LEC_SGCC_SEND_DATA_TIMEOUT = E_LEC_SGCC_STATUS + 915,
E_LEC_SGCC_DNS_NOT_FOUND = E_LEC_SGCC_STATUS + 916,
E_LEC_SGCC_DNS_TIMEOUT = E_LEC_SGCC_STATUS + 917,
E_LEC_SGCC_DNS_UNKNOWN = E_LEC_SGCC_STATUS + 918,
/* 919-979 reserved */
E_LEC_SGCC_PARAM_NOT_CORRECT = E_LEC_SGCC_STATUS + 980,
E_LEC_SGCC_UNKNOWN = E_LEC_SGCC_STATUS + 981,
E_LEC_ERR_UNKNOWN = 0x7FFFFFFF
}LXZAT_ERROR_CODE_E;
typedef enum _LXZAT_SP_MODE_E
{
E_LSMX_ATC,
E_LSMA_PPP,
E_LSMA_FIXED_LEN,
E_LSMA_FIXED_CHAR,
E_LSMA_FIXED_WORD,
E_LSMA_FIXED_3PLUS,
E_LSMA_LEN_3PLUS,
E_LSMA_CHAR_3PLUS,
E_LSMA_WORD_3PLUS,
E_LSMB_PPP,
E_LSMB_FIXED_LEN,
E_LSMB_FIXED_CHAR,
E_LSMB_FIXED_WORD,
E_LSMB_FIXED_3PLUS,
E_LSMB_LEN_3PLUS,
E_LSMB_CHAR_3PLUS,
E_LSMB_WORD_3PLUS,
E_LSMX_CLOSING = 0xfe,
E_LSMX_INVALID = 0xff
}LXZAT_SP_MODE_E;
#define LXZAT_STREAM_FRAME_MASK 0xffffffff
#define LXZAT_STREAM_ATLEN_MASK 0x00ffffff
#define LXZAT_STREAM_EFLAG_MASK 0xff000000
#define LXZAT_STREAM_PPPLEN_MASK LXZAT_STREAM_ATLEN_MASK
#define LXZAT_STREAM_EFLAG_NONE 0x00000000
#define LXZAT_STREAM_EFLAG_LEN 0x01000000
#define LXZAT_STREAM_EFLAG_CHAR 0x02000000
#define LXZAT_STREAM_EFLAG_WORD 0x04000000
#define LXZAT_STREAM_EFLAG_3PLUS 0x08000000
#define PARAM1_FLAG(p_cur_cmd) p_cur_cmd->param_used[0]
#define PARAM2_FLAG(p_cur_cmd) p_cur_cmd->param_used[1]
#define PARAM3_FLAG(p_cur_cmd) p_cur_cmd->param_used[2]
#define PARAM4_FLAG(p_cur_cmd) p_cur_cmd->param_used[3]
#define PARAM5_FLAG(p_cur_cmd) p_cur_cmd->param_used[4]
#define PARAM6_FLAG(p_cur_cmd) p_cur_cmd->param_used[5]
#define PARAM7_FLAG(p_cur_cmd) p_cur_cmd->param_used[6]
#define PARAM8_FLAG(p_cur_cmd) p_cur_cmd->param_used[7]
#define PARAM9_FLAG(p_cur_cmd) p_cur_cmd->param_used[8]
#define PARAM10_FLAG(p_cur_cmd) p_cur_cmd->param_used[9]
#define PARAM1(p_cur_cmd) p_cur_cmd->pt_at_param->pv
#define PARAM2(p_cur_cmd) p_cur_cmd->pt_at_param->next->pv
#define PARAM3(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->pv
#define PARAM4(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->pv
#define PARAM5(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->pv
#define PARAM6(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->pv
#define PARAM7(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->pv
#define PARAM8(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->next->pv
#define PARAM9(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->next->next->pv
#define PARAM10(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->next->next->next->pv
#define PARAM1_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->it_type
#define PARAM2_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->it_type
#define PARAM3_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->it_type
#define PARAM4_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->it_type
#define PARAM5_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->it_type
#define PARAM6_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->it_type
#define PARAM7_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->it_type
#define PARAM8_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->next->it_type
#define PARAM9_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->next->next->it_type
#define PARAM10_TYPE(p_cur_cmd) p_cur_cmd->pt_at_param->next->next->next->next->next->next->next->next->next->it_type
/*******************************************************************************
** AT commands action type *
******************************************************************************/
#define LXZAT_REQ_TYPE_ERR 0
#define LXZAT_REQ_TYPE_EXE 1
#define LXZAT_REQ_TYPE_SET 2
#define LXZAT_REQ_TYPE_READ 3
#define LXZAT_REQ_TYPE_TEST 4
#define LXZAT_REQ_TYPE_EWPD 5 /* Ended with '#' */
#define LXZAT_CUR_REQ_TYPE(p_cur_cmd) p_cur_cmd->it_req_type
/*******************************************************************************
** AT commands parameter type *
******************************************************************************/
#define LXZAT_PARAM_TYPE_NUMERIC 1
#define LXZAT_PARAM_TYPE_STRING 2
#define LXZAT_PARAM_TYPE_DEFAULT 3
#define LXZAT_ASSERT(exp) (void)( (exp) || (_assert(#exp, __FILE__, __LINE__), 0) )
/*
* Description:
* find an at-information descriptor.
* Param: i_index_id, a specified index
* Return: an at-information descriptor;
*/
const lxzat_info_t * lxzat_info_f_get(sint32 i_index_id);
/*
* Description:
* find an at-information descriptor.
* Param: i_index_id, a specified index
* Return: an at-information descriptor;
*/
const lxzat_info_t * lxzat_uat_f_get(sint32 i_index_id);
/*
* Description:
* find an usable serial-port.
* Param: none
* Return: i_vsp_id, the ID of serial-port;
*/
sint32 lxzat_spcomm_f_find(void);
/*
* Description:
* open the specified serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Return: the descriptor of serial-port.
* History:
*/
lxzat_spcfg_t * lxzat_spcomm_f_open(sint32 i_vsp_id);
/*
* Description:
* release all resource related to serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Return: i_op_status, 0, fail;1, success.
* History:
*/
sint32 lxzat_spcomm_f_close(sint32 i_vsp_id);
/*
* Description:
* Get the descriptor of serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Return: the descriptor of serial-port.
* History:
*/
lxzat_spcfg_t * lxzat_spcomm_f_get(sint32 i_vsp_id);
/*
* Description:
* send data through the serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Param: p_data_buf, data buffer;
* Param: i_data_len, length of data;
* Return: i_len_write, length of data has been written.
* History:
*/
sint32 lxzat_spcomm_f_writebyid(sint32 i_vsp_id, uint08 * p_data_buf, sint32 i_data_len);
/*
* Description:
* send data through the serial-port.
* Param: u_vsp_fd, the descriptor of serial-port;
* Param: p_data_buf, data buffer;
* Param: i_data_len, length of data;
* Return: i_len_write, length of data has been written.
* History:
*/
sint32 lxzat_spcomm_f_writebyfd(uint32 u_vsp_fd, uint08 * p_data_buf, sint32 i_data_len);
/*
* Description:
* send data through the serial-port.
* Param: u_vsp_fd, the descriptor of serial-port;
* Param: p_data_buf, data buffer;
* Param: i_data_len, length of data;
* Return: i_len_write, length of data has been written.
* History:
*/
sint32 lxzat_spcomm_f_flush(uint32 i_vsp_id);
/*
* Description:
* clear all data that stored in ring buffer.
* Param: p_lxzat_ctxt, the context of current AT-Command;
* Return: i_op_status, 0, fail;1, success.
* History:
*/
sint32 lxzat_spcomm_f_clear(sint32 i_vsp_id);
/*
* Description:
* Change the work mode of the serial-port and related conditions.
* Param: i_vsp_id, the ID of serial-port;
* Param: i_link_mode, the new work-mode of serial-port;
* Param: u_end_char1, the primary end-character;
* Param: u_end_char1, the auxiliary end-character;
* Return: i_op_status, 0, fail;1, success.
* History:
*/
sint32 lxzat_spcomm_f_ChangeWorkMode(sint32 i_vsp_id, sint32 i_link_mode,
uint08 u_end_char1, uint08 u_end_char2);
/*
* Description:
* Get the status of a specified serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Return: i_spcomm_isopen, 1, opened;0, closed.
* History:
*/
sint32 lxzat_spcomm_f_isopen(sint32 i_vsp_id);
/*
* Description:
* send data through the serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Param: p_data_buf, data buffer;
* Param: i_data_len, length of data;
* Return: i_op_status, 0, fail;1, success.
* History:
*/
sint32 lxzurc_cache_f_write(sint32 i_vsp_id, sint32 i_data_len, uint08 * p_data_buf);
/*
* Description:
* Get the baudrate of a specified serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Return: the descriptor of serial-port.
* History:
*/
sint32 lxzat_spcomm_baudrate_f_get(sint32 i_vsp_id);
/*
* Description:
* Set the baudrate of a specified serial-port.
* Param: i_vsp_id, the ID of serial-port;
* Return: the descriptor of serial-port.
* History:
*/
sint32 lxzat_spcomm_baudrate_f_set(sint32 i_vsp_id, sint32 i_new_baudrate);
/*
* Description:
* format string and then write to the specified file.
* Param: i_vsp_id, the ID of serial-port;
* Param: i_rsp_fmt, the format of current response;
* Param: vfmt, the format of stirng;
*
* NOTE: 1023 bytes is the maximum length can be supported
*/
sint32 lxzat_rsp_f_printf(sint32 i_vsp_id, sint32 i_rsp_fmt, const char * vfmt, ...);
/*
* Description:
* format string and then write to the specified file.
* Param: i_vsp_id, the ID of serial-port;
* Param: i_urc_flag, the flag of URC status;
* Param: i_rsp_fmt, the format of current response;
* Param: vfmt, the format of stirng;
*
* NOTE: 1023 bytes is the maximum length can be supported
*/
uint32 lxzat_urc_f_printf(sint32 i_vsp_id, sint32 i_rsp_fmt, const char * vfmt, ...);
/*
* Description:
* format string and then write to the specified file.
* Param: i_vsp_id, the ID of serial-port;
* Param: i_rsp_fmt, the format of current response;
* Param: vbuf, a data buffer;
* Param: ilen, the length of data that stored in vbuf;
*/
sint32 lxzat_rsp_f_printfhex(sint32 i_vsp_id, sint32 i_rsp_fmt, const char * vbuf, sint32 ilen);
/*
* Description:
* format string and then write to the specified file.
* Param: i_vsp_id, the ID of serial-port;
* Param: i_rsp_fmt, the format of current response;
* Param: vbuf, a data buffer;
* Param: ilen, the length of data that stored in vbuf;
*/
sint32 lxzat_rsp_f_printfbin(sint32 i_vsp_id, sint32 i_rsp_fmt, const char * vbuf, sint32 ilen);
/*
* Description:
* Before start, initialize environment.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_f_init(sint32 i_vsp_id);
/*
* Description:
* Before exit, release all resource.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_f_reset(sint32 i_vsp_id);
/*
* Description:
* Echo what received.
* Param: i_vsp_id, the ID of serial-port;
* Param: p_data_buf, data buffer;
* Param: i_data_len, length of data;
*
* Return: NONE.
*/
void lxzat_f_echo(sint32 i_vsp_id, uint08 * p_data_recved, sint32 i_data_len);
/*
* Description:
* Entry-point of AT-server.
* Param: i_vsp_id, the ID of serial-port;
* Param: p_data_buf, data buffer;
* Param: i_data_len, length of data;
*
* Return: i_op_status, 0, fail;1, success.
*/
sint32 lxzat_main(sint32 i_vsp_id, uint08 * p_data_buf, sint32 i_data_len);
/*
* Description:
* format string and then write to the specified file.
* Param: i_vsp_id, the ID of serial-port;
* Param: i_rsp_fmt, the format of current response;
* Param: vfmt, the format of stirng;
*
* NOTE: 1023 bytes is the maximum length can be supported
*/
sint32 lxzat_dbg_printf(sint32 i_vsp_id, sint32 i_rsp_fmt, const char * vfmt, ...);
/*
* Description:
* new task, urcflush task.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_task_urcflush_newtask(sint32 i_vsp_id);
/*
* Description:
* update the time of SIM boot-time.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_ticks_cpintime_update(sint32 i_vsp_id);
/*
* Description:
* update the time of register-to-network.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_ticks_cregtime_update(sint32 i_vsp_id);
/*
* Description:
* update the time of mark-ticks.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_ticks_marktime_update(sint32 i_vsp_id);
/*
* Description:
* new task, cpinstatus task.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_task_cpinstatus_newtask(sint32 i_vsp_id);
/*
* Description:
* new task, cregstatus task.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_task_cregstatus_newtask(sint32 i_vsp_id);
/*
* Description:
* new task, myurchome task.
* Param: i_vsp_id, the ID of serial-port;
*
* Return: NONE.
*/
sint32 lxzat_task_myurchome_newtask(sint32 i_vsp_id);
#endif /* __LXZ_ATC_REQ_H__ */
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C
1
https://gitee.com/cyctspace/latserver.git
git@gitee.com:cyctspace/latserver.git
cyctspace
latserver
latserver
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385