28 #ifndef __TASK_MANAGER_H__ 29 #define __TASK_MANAGER_H__ 31 #include <tinyara/config.h> 35 #include <tinyara/task_manager_internal.h> 40 #define TM_APP_STATE_RUNNING (1) 41 #define TM_APP_STATE_PAUSE (2) 42 #define TM_APP_STATE_STOP (3) 43 #define TM_APP_STATE_UNREGISTERED (4) 44 #define TM_APP_STATE_CANCELLING (5) 54 #define TM_APP_PERMISSION_ALL (0) 55 #define TM_APP_PERMISSION_GROUP (1) 56 #define TM_APP_PERMISSION_DEDICATE (2) 63 #define TM_NO_RESPONSE (0) 64 #define TM_RESPONSE_WAIT_INF (-1) 71 TM_ALREADY_STARTED_APP = -1,
72 TM_ALREADY_PAUSED_APP = -2,
73 TM_ALREADY_STOPPED_APP = -3,
74 TM_UNREGISTERED_APP = -4,
75 TM_CANCELLING_APP = -5,
76 TM_OPERATION_FAIL = -6,
77 TM_COMMUCATION_FAIL = -7,
79 TM_INVALID_PARAM = -9,
80 TM_INVALID_DRVFD = -10,
81 TM_OUT_OF_MEMORY = -11,
82 TM_NO_PERMISSION = -12,
83 TM_NOT_SUPPORTED = -13,
84 TM_UNREGISTERED_MSG = -14,
85 TM_ALREADY_REGISTERED_CB = -15,
86 TM_REPLY_TIMEOUT = -16,
87 TM_TASK_MGR_NOT_ALIVE = -17,
98 TM_BROADCAST_WIFI_ON = 1,
99 TM_BROADCAST_WIFI_OFF = 2,
100 TM_BROADCAST_SYSTEM_MSG_MAX,
101 #ifndef CONFIG_TASK_MANAGER_USER_SPECIFIC_BROADCAST 102 TM_BROADCAST_MSG_MAX = TM_BROADCAST_SYSTEM_MSG_MAX,
186 int task_manager_register_task(
char *name,
int priority,
int stack_size, main_t entry,
char * argv[],
int permission,
int timeout);
202 int task_manager_register_pthread(
char *name, pthread_attr_t *attr, pthread_startroutine_t start_routine, pthread_addr_t arg,
int permission,
int timeout);
int task_manager_unregister(int handle, int timeout)
Request to unregister a task.
int task_manager_register_builtin(char *name, int permission, int timeout)
Request to register a built-in task.
int task_manager_start(int handle, int timeout)
Request to start the task.
int task_manager_stop(int handle, int timeout)
Request to stop the task.
void(* _tm_termination_t)(void *)
Termination callback function type.
tm_appinfo_list_t * task_manager_getinfo_with_name(char *name, int timeout)
Get task information list through task name.
void(* _tm_broadcast_t)(void *, void *)
Broadcast callback function type.
tm_appinfo_list_t * task_manager_getinfo_with_group(int group, int timeout)
Get task information list through group.
int task_manager_resume(int handle, int timeout)
Request to resume the task.
int task_manager_register_pthread(char *name, pthread_attr_t *attr, pthread_startroutine_t start_routine, pthread_addr_t arg, int permission, int timeout)
Request to register a pthread which is not in built-in list.
tm_appinfo_t * task_manager_getinfo_with_pid(int pid, int timeout)
Get the handle through pid.
void task_manager_clean_info(tm_appinfo_t **info)
Clean task information.
int task_manager_unicast(int handle, tm_msg_t *send_msg, tm_msg_t *reply_msg, int timeout)
Request to send messages to the task.
tm_appinfo_t * task_manager_getinfo_with_handle(int handle, int timeout)
Get task information through handle.
void(* _tm_unicast_t)(tm_msg_t *)
Unicast callback function type.
int task_manager_unset_broadcast_cb(int msg, int timeout)
Unregister callback function which was used for a certain broadcast message.
Application Info Structure.
int task_manager_set_exit_cb(void(*func)(void *data), tm_msg_t *cb_data)
Set callback function called when task terminates normally.
int task_manager_register_task(char *name, int priority, int stack_size, main_t entry, char *argv[], int permission, int timeout)
Request to register a task which is not in built-in list.
int task_manager_pause(int handle, int timeout)
Request to pause the task.
int task_manager_dealloc_broadcast_msg(int msg, int timeout)
Remove the broadcast message which was allocated by using task_manager_alloc_broadcast_msg() API...
void task_manager_clean_infolist(tm_appinfo_list_t **info_list)
Clean task information list.
int task_manager_set_stop_cb(void(*func)(void *data), tm_msg_t *cb_data)
Set callback function called when task is stopped by task manager.
int task_manager_set_unicast_cb(void(*func)(tm_msg_t *data))
Set unicast callback function API.
int task_manager_restart(int handle, int timeout)
Request to restart the task.
tm_defined_broadcast_msg
Broadcast message list.
int task_manager_broadcast(int msg, tm_msg_t *data, int timeout)
Request to send messages to the tasks.
tm_result_error_e
Error Type of Result Value returned from Task Manager.
int task_manager_alloc_broadcast_msg(void)
Allocate a new broadcast message which is not defined in the <task_manager/task_manager.h> and <task_manager/task_manager_broadcast_list.h>
int task_manager_set_broadcast_cb(int msg, void(*func)(void *user_data, void *data), tm_msg_t *cb_data)
Register callback function which will be used for processing a certain received broadcast message...
Unicast message Structure.
int task_manager_reply_unicast(tm_msg_t *reply_msg)
Send unicast reply message.