TASK模块接口实现文件, 其中包含了TASK的所有用户API. 更多...
#include "core_mqtt.h"#include "core_string.h"#include "core_log.h"#include "core_global.h"#include "task_private.h"
函数 | |
| static void | _task_recv_notify_handler (void *handle, const aiot_mqtt_recv_t *msg, void *userdata) |
| static void | _task_recv_get_reply_handler (void *handle, const aiot_mqtt_recv_t *msg, void *userdata) |
| static void | _task_recv_update_reply_handler (void *handle, const aiot_mqtt_recv_t *msg, void *userdata) |
| static char * | _task_convert_status_to_str (aiot_task_status_t status) |
| static aiot_task_status_t | _task_cover_status_to_enum (char *str) |
| static int32_t | _task_parse_json (aiot_sysdep_portfile_t *sysdep, const void *input, uint32_t input_len, char *key_word, char **out) |
| static int32_t | _task_parse_task_detail (task_handle_t *task_handle, const char *payload, uint32_t payload_len, task_desc_t *task) |
| static void | _task_free_task_list (task_handle_t *task_handle, task_get_list_reply_t *list) |
| static void | _task_free_task_detail (task_handle_t *task_handle, task_desc_t *task) |
| static void | _task_free_update_reply (task_update_reply_t *reply) |
| static int32_t | _task_send_notify_reply (task_handle_t *task_handle, char *msg_id, uint32_t code) |
| static int32_t | _task_parse_notify (task_handle_t *task_handle, const char *payload, uint32_t payload_len, task_desc_t *task) |
| static int32_t | _task_parse_get_list_reply_array (char *str, int32_t str_len, task_list_json *array) |
| static uint32_t | _task_parse_get_list_reply (task_handle_t *task_handle, void *input, uint32_t input_len, task_get_list_reply_t *reply) |
| static int32_t | _task_setup_topic_mapping (void *mqtt_handle, void *task_handle) |
| static void | _task_core_mqtt_process_handler (void *context, aiot_mqtt_event_t *event, core_mqtt_event_t *core_event) |
| static int32_t | _task_core_mqtt_operate_process_handler (task_handle_t *task_handle, core_mqtt_option_t option) |
| static int32_t | _task_send_query_task (task_handle_t *task_handle, char *task_id) |
| int32_t | aiot_task_get_task_list (void *handle) |
| 从云端获取task列表 更多... | |
| int32_t | aiot_task_get_task_detail (void *handle, char *task_id) |
| 从云端获取task详细内容 更多... | |
| int32_t | aiot_task_update (void *handle, task_desc_t *task) |
| 更新任务状态到云端 更多... | |
| int32_t | aiot_task_setopt (void *handle, aiot_task_option_t option, void *data) |
| 设置task句柄的参数 更多... | |
| void * | aiot_task_init (void) |
| 创建一个task实例 更多... | |
| int32_t | aiot_task_deinit (void **p_handle) |
| 销毁task实例句柄 更多... | |
变量 | |
| static const task_status_map_t | g_task_stauts_mapping [] |
| static const task_recv_topic_map_t | g_task_recv_topic_mapping [] |
TASK模块接口实现文件, 其中包含了TASK的所有用户API.
|
static |

|
static |

|
static |

|
static |
|
static |
|
static |
|
static |

|
static |
|
static |

|
static |

|
static |

|
static |

|
static |
|
static |

|
static |

|
static |
|
static |

|
static |

| int32_t aiot_task_get_task_list | ( | void * | handle | ) |
从云端获取task列表
从云端获取task列表
| [in] | handle | task句柄 |
| STATE_TASK_SETOPT_DATA_IS_NULL | 参数的handle字段为空 |
| STATE_SUCCESS | 发送成功 |

| int32_t aiot_task_get_task_detail | ( | void * | handle, |
| char * | user_task_id | ||
| ) |
从云端获取task详细内容
从云端获取task详细内容
| [in] | handle | task句柄 |
| [in] | user_task_id | task的id或者$next |
| STATE_TASK_SETOPT_DATA_IS_NULL或user_task_id | 参数的handle字段为空 |
| STATE_SUCCESS | 发送成功 |

| int32_t aiot_task_update | ( | void * | handle, |
| task_desc_t * | task | ||
| ) |
更新任务状态到云端
更新任务状态到云端
| [in] | handle | task句柄 |
| [in] | task | task信息 |
| STATE_TASK_SETOPT_DATA_IS_NULL或task | 参数的handle字段为空 |
| STATE_SUCCESS | 更新成功 |

| int32_t aiot_task_setopt | ( | void * | handle, |
| aiot_task_option_t | option, | ||
| void * | data | ||
| ) |
设置task句柄的参数
对task会话进行配置, 常见的配置选项包括
| [in] | handle | task句柄 |
| [in] | option | 配置选项, 更多信息请参考aiot_task_option_t |
| [in] | data | 配置选项数据, 更多信息请参考aiot_task_option_t |
| STATE_TASK_SETOPT_HANDLE_IS_NULL | task句柄为空 |
| STATE_TASK_SETOPT_DATA_IS_NULL | 参数data字段为空 |
| STATE_USER_INPUT_UNKNOWN_OPTION | option不支持 |
| STATE_SUCCESS | 参数设置成功 |

| void* aiot_task_init | ( | void | ) |
创建一个task实例
| 非NULL | task实例句柄 |
| NULL | 初始化失败, 或者是因为没有设置portfile, 或者是内存分配失败导致 |

| int32_t aiot_task_deinit | ( | void ** | handle | ) |
销毁task实例句柄
| [in] | handle | 指向task实例句柄的指针 |
| STATE_USER_INPUT_NULL_POINTER | handle或者handle所指向的地址为空 |
| STATE_SUCCESS | 执行成功 |

|
static |
|
static |
1.8.11