refresh 开发指南.pdf

add new interface develop guide and sample code
This commit is contained in:
daishengdong
2019-11-14 19:27:36 +08:00
parent 943db74fc7
commit 74572d20fe
26 changed files with 1671 additions and 445 deletions

View File

@@ -144,7 +144,7 @@ typedef struct at_agent_st {
* @retval -1 write failed(error).
* @retval none -1 the number of bytes written.
*/
int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_len);
__API__ int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_len);
/**
* @brief Read data from a channel.
@@ -161,7 +161,7 @@ int tos_at_channel_write(int channel_id, uint8_t *buffer, size_t buffer_len);
* @retval -1 read failed(error).
* @retval none -1 the number of bytes read.
*/
int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t buffer_len, uint32_t timeout);
__API__ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t buffer_len, uint32_t timeout);
/**
* @brief Read data from a channel.
@@ -177,7 +177,7 @@ int tos_at_channel_read_timed(int channel_id, uint8_t *buffer, size_t buffer_len
* @retval -1 read failed(error).
* @retval none -1 the number of bytes read.
*/
int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_len);
__API__ int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_len);
/**
* @brief Allocate a channel.
@@ -193,7 +193,7 @@ int tos_at_channel_read(int channel_id, uint8_t *buffer, size_t buffer_len);
* @retval -1 allocate failed(error).
* @retval none -1 the id of the channel.
*/
int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *port);
__API__ int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *port);
/**
* @brief Allocate a channel.
@@ -208,7 +208,7 @@ int tos_at_channel_alloc_id(int channel_id, const char *ip, const char *port);
* @retval -1 allocate failed(error).
* @retval none -1 the id of the channel.
*/
int tos_at_channel_alloc(const char *ip, const char *port);
__API__ int tos_at_channel_alloc(const char *ip, const char *port);
/**
* @brief Free a channel.
@@ -222,7 +222,7 @@ int tos_at_channel_alloc(const char *ip, const char *port);
* @retval -1 free failed(error).
* @retval 0 free successfully.
*/
int tos_at_channel_free(int channel_id);
__API__ int tos_at_channel_free(int channel_id);
/**
* @brief Set channel broken.
@@ -261,7 +261,7 @@ __API__ int tos_at_channel_is_working(int channel_id);
* @retval -1 initialize failed(error).
* @retval 0 initialize successfully.
*/
int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event_table_size);
__API__ int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event_table_size);
/**
* @brief De-initialize the at framework.
@@ -270,7 +270,7 @@ int tos_at_init(hal_uart_port_t uart_port, at_event_t *event_table, size_t event
*
* @return
None
*/
*/
__API__ void tos_at_deinit(void);
/**
@@ -286,7 +286,7 @@ void tos_at_deinit(void);
* @return errcode
* @retval -1 create failed(error).
* @retval 0 create successfully.
*/
*/
__API__ int tos_at_echo_create(at_echo_t *echo, char *buffer, size_t buffer_size, char *echo_expect);
/**
@@ -301,7 +301,7 @@ int tos_at_echo_create(at_echo_t *echo, char *buffer, size_t buffer_size, char *
* @return errcode
* @retval -1 execute failed(error).
* @retval 0 execute successfully.
*/
*/
__API__ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd, ...);
/**
@@ -317,7 +317,7 @@ int tos_at_cmd_exec(at_echo_t *echo, uint32_t timeout, const char *cmd, ...);
* @return errcode
* @retval -1 execute failed(error).
* @retval 0 execute successfully.
*/
*/
__API__ int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char *cmd, ...);
/**
@@ -333,7 +333,7 @@ int tos_at_cmd_exec_until(at_echo_t *echo, uint32_t timeout, const char *cmd, ..
* @return errcode
* @retval -1 execute failed(error).
* @retval 0 execute successfully.
*/
*/
__API__ int tos_at_raw_data_send(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size);
/**
@@ -350,7 +350,7 @@ int tos_at_raw_data_send(at_echo_t *echo, uint32_t timeout, const uint8_t *buf,
* @return errcode
* @retval -1 execute failed(error).
* @retval 0 execute successfully.
*/
*/
__API__ int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const uint8_t *buf, size_t size);
/**
@@ -362,7 +362,7 @@ int tos_at_raw_data_send_until(at_echo_t *echo, uint32_t timeout, const uint8_t
* @param[in] data uart received data.
*
* @return None
*/
*/
__API__ void tos_at_uart_write_byte(uint8_t data);
/**
@@ -376,7 +376,7 @@ void tos_at_uart_write_byte(uint8_t data);
* @return errcode
* @retval -1 pend failed(error).
* @retval 0 pend successfully.
*/
*/
__API__ int tos_at_global_lock_pend(void);
/**
@@ -390,7 +390,7 @@ int tos_at_global_lock_pend(void);
* @return errcode
* @retval -1 post failed(error).
* @retval 0 post successfully.
*/
*/
__API__ int tos_at_global_lock_post(void);
/**
@@ -403,7 +403,7 @@ int tos_at_global_lock_post(void);
* @param[in] buffer_len length of the buffer.
*
* @return length of the data read from the uart.
*/
*/
__API__ int tos_at_uart_read(uint8_t *buffer, size_t buffer_len);
/**
@@ -416,7 +416,7 @@ int tos_at_uart_read(uint8_t *buffer, size_t buffer_len);
* @param[in] buffer_len length of the buffer.
*
* @return length of the data read from the uart.
*/
*/
__API__ int tos_at_uart_readline(uint8_t *buffer, size_t buffer_len);
/**
@@ -429,7 +429,7 @@ int tos_at_uart_readline(uint8_t *buffer, size_t buffer_len);
* @param[in] buffer_len length of the buffer.
*
* @return length of the data read from the uart.
*/
*/
__API__ int tos_at_uart_drain(uint8_t *buffer, size_t buffer_len);
/**
@@ -441,7 +441,7 @@ int tos_at_uart_drain(uint8_t *buffer, size_t buffer_len);
* @param[in] channel_id id of the channel.
*
* @return remote ip of the channel.
*/
*/
__API__ const char *tos_at_agent_channel_ip_get(int channel_id);
/**
@@ -453,7 +453,7 @@ const char *tos_at_agent_channel_ip_get(int channel_id);
* @param[in] channel_id id of the channel.
*
* @return remote port of the channel.
*/
*/
__API__ const char *tos_at_agent_channel_port_get(int channel_id);
#endif /* __AT_AGENT_H_ */